Skip to content

Commit e5d46a5

Browse files
committedJan 7, 2023
Auto merge of rust-lang#106573 - matthiaskrgr:rollup-zkgfsta, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#101936 (Migrating rustc_infer to session diagnostics (part 3)) - rust-lang#104081 (PhantomData layout guarantees) - rust-lang#104543 (Migrate `codegen_ssa` to diagnostics structs - [Part 3]) - rust-lang#105128 (Add O(1) `Vec -> VecDeque` conversion guarantee) - rust-lang#105517 (Fix process-panic-after-fork.rs to pass on newer versions of Android.) - rust-lang#105859 (Point out span where we could introduce higher-ranked lifetime) - rust-lang#106509 (Detect closures assigned to binding in block) - rust-lang#106553 (docs: make `HashSet::retain` doctest more clear) - rust-lang#106556 (rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`) - rust-lang#106564 (Change to immutable borrow when cloning element of RepeatN) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ee0412d + 3076f26 commit e5d46a5

File tree

44 files changed

+1913
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1913
-753
lines changed
 

‎Cargo.lock

+2
Original file line numberDiff line numberDiff line change
@@ -3890,6 +3890,7 @@ dependencies = [
38903890
"rustc_span",
38913891
"rustc_symbol_mangling",
38923892
"rustc_target",
3893+
"rustc_type_ir",
38933894
"serde_json",
38943895
"smallvec",
38953896
"snap",
@@ -4024,6 +4025,7 @@ dependencies = [
40244025
"rustc_serialize",
40254026
"rustc_span",
40264027
"rustc_target",
4028+
"rustc_type_ir",
40274029
"serde",
40284030
"serde_json",
40294031
"termcolor",

‎compiler/rustc_borrowck/src/borrowck_errors.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,14 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
440440
closure_kind: &str,
441441
borrowed_path: &str,
442442
capture_span: Span,
443+
scope: &str,
443444
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
444445
let mut err = struct_span_err!(
445446
self,
446447
closure_span,
447448
E0373,
448-
"{} may outlive the current function, but it borrows {}, which is owned by the current \
449-
function",
450-
closure_kind,
451-
borrowed_path,
449+
"{closure_kind} may outlive the current {scope}, but it borrows {borrowed_path}, \
450+
which is owned by the current {scope}",
452451
);
453452
err.span_label(capture_span, format!("{} is borrowed here", borrowed_path))
454453
.span_label(closure_span, format!("may outlive borrowed value {}", borrowed_path));

0 commit comments

Comments
 (0)
Please sign in to comment.