Fix misleading "borrowed data escapes outside of function" diagnostic#155295
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Apr 18, 2026
Merged
Fix misleading "borrowed data escapes outside of function" diagnostic#155295rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
JohnTitor
approved these changes
Apr 18, 2026
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Apr 18, 2026
Rollup of 12 pull requests Successful merges: - #147811 (naked functions: respect `function-sections`) - #154935 (Add Sized supertrait for CoerceUnsized and DispatchFromDyn) - #139690 (`impl Default for RepeatN`) - #153511 (`std::any::TypeId`: remove misplaced "and" in `Unique<T>` example) - #154943 (Move recursion out of `MatchPairTree::for_pattern` helpers ) - #155295 (Fix misleading "borrowed data escapes outside of function" diagnostic) - #155427 (ptr: update text in intro text to one in with_addr doc) - #155428 (Fix ICE in borrowck mutability suggestion with multi-byte ref sigil) - #155435 (rustdoc: Fix `redundant_explicit_links` incorrectly firing (or not firing) under certain scenarios) - #155450 (Remove unnecessary safety conditions related to unchecked uint arithmetic) - #155454 (docs: Fix typo in std/src/thready/scoped.rs) - #155467 (`std::error::Request`: clean up documentation)
rust-timer
added a commit
that referenced
this pull request
Apr 18, 2026
Rollup merge of #155295 - lapla-cogito:issue_154350, r=JohnTitor Fix misleading "borrowed data escapes outside of function" diagnostic Fixes #154350 Fall back to `report_general_error()` when `fr_name_and_span` is `None` in function items, since the "escaping data" framing is only appropriate for closures capturing outside variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #154350
Fall back to
report_general_error()whenfr_name_and_spanisNonein function items, since the "escaping data" framing is only appropriate for closures capturing outside variables.