Use tcx.hir() utils for spans in MIR building.

This corrects the `span_with_body` in the case of closures, which was
incorrectly shortened to the `def_span`.
This commit is contained in:
Camille GILLOT 2022-08-27 14:36:14 +02:00
parent ffe20d61d6
commit 1f370d9437
49 changed files with 352 additions and 298 deletions

View file

@ -360,7 +360,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
diag.span_label(upvar_span, "captured outer variable");
diag.span_label(
self.body.span,
self.infcx.tcx.def_span(def_id),
format!("captured by this `{closure_kind}` closure"),
);

View file

@ -970,6 +970,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
let hir = self.infcx.tcx.hir();
let closure_id = self.mir_hir_id();
let closure_span = self.infcx.tcx.def_span(self.mir_def_id());
let fn_call_id = hir.get_parent_node(closure_id);
let node = hir.get(fn_call_id);
let def_id = hir.enclosing_body_owner(fn_call_id);
@ -1021,7 +1022,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
if let Some(span) = arg {
err.span_label(span, "change this to accept `FnMut` instead of `Fn`");
err.span_label(func.span, "expects `Fn` instead of `FnMut`");
err.span_label(self.body.span, "in this closure");
err.span_label(closure_span, "in this closure");
look_at_return = false;
}
}
@ -1047,7 +1048,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
sig.decl.output.span(),
"change this to return `FnMut` instead of `Fn`",
);
err.span_label(self.body.span, "in this closure");
err.span_label(closure_span, "in this closure");
}
_ => {}
}

View file

@ -68,50 +68,25 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
}
// Figure out what primary body this item has.
let (body_id, return_ty_span, span_with_body) = match tcx.hir().get(id) {
Node::Expr(hir::Expr {
kind: hir::ExprKind::Closure(hir::Closure { fn_decl, body, .. }),
..
}) => (*body, fn_decl.output.span(), None),
let body_id = tcx.hir().body_owned_by(def.did);
let span_with_body = tcx.hir().span_with_body(id);
let return_ty_span = if let Some(fn_decl) = tcx.hir().fn_decl_by_hir_id(id) {
fn_decl.output.span()
} else {
match tcx.hir().get(id) {
Node::Item(hir::Item {
kind: hir::ItemKind::Fn(hir::FnSig { decl, .. }, _, body_id),
span,
kind: hir::ItemKind::Static(ty, _, _) | hir::ItemKind::Const(ty, _),
..
})
| Node::ImplItem(hir::ImplItem {
kind: hir::ImplItemKind::Fn(hir::FnSig { decl, .. }, body_id),
span,
..
})
| Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Fn(hir::FnSig { decl, .. }, hir::TraitFn::Provided(body_id)),
span,
..
}) => {
// Use the `Span` of the `Item/ImplItem/TraitItem` as the body span,
// since the def span of a function does not include the body
(*body_id, decl.output.span(), Some(*span))
| Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(ty, _), .. })
| Node::TraitItem(hir::TraitItem { kind: hir::TraitItemKind::Const(ty, _), .. }) => {
ty.span
}
Node::Item(hir::Item {
kind: hir::ItemKind::Static(ty, _, body_id) | hir::ItemKind::Const(ty, body_id),
..
})
| Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(ty, body_id), .. })
| Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Const(ty, Some(body_id)),
..
}) => (*body_id, ty.span, None),
Node::AnonConst(hir::AnonConst { body, hir_id, .. }) => {
(*body, tcx.hir().span(*hir_id), None)
Node::AnonConst(_) => tcx.def_span(def.did),
_ => span_bug!(tcx.def_span(def.did), "can't build MIR for {:?}", def.did),
}
_ => span_bug!(tcx.hir().span(id), "can't build MIR for {:?}", def.did),
};
// If we don't have a specialized span for the body, just use the
// normal def span.
let span_with_body = span_with_body.unwrap_or_else(|| tcx.hir().span(id));
tcx.infer_ctxt().enter(|infcx| {
let body = if let Some(error_reported) = typeck_results.tainted_by_errors {
build::construct_error(&infcx, def, id, body_id, body_owner_kind, error_reported)
@ -245,8 +220,6 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
// of `mir_build`, so now we can steal it
let thir = thir.steal();
let span_with_body = span_with_body.to(tcx.hir().span(body_id.hir_id));
build::construct_const(
&thir,
&infcx,

View file

@ -40,11 +40,11 @@
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:43: +0:44
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:43: +0:44
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:43: +0:44
return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:44
return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:45
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:44
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:45
}
- }
-

View file

@ -12,6 +12,6 @@ static BOP: &i32 = {
_1 = &_2; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:20: +0:23
_0 = &(*_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:20: +0:23
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:22: +0:23
return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:23
return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:24
}
}

View file

@ -42,11 +42,11 @@
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:54: +0:55
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:54: +0:55
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:54: +0:55
return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:55
return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:56
}
bb2 (cleanup): {
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:55
resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:56
}
}
-

View file

@ -15,70 +15,70 @@
} */
fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 10:17]) -> () {
let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15
let _4: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14
let mut _5: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14
let mut _6: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:18: 10:18
let mut _7: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
let mut _8: u32; // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:+1:13: +1:15
let _4: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+2:9: +2:14
let mut _5: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+2:9: +2:14
let mut _6: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:18: +0:18
let mut _7: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
let mut _8: u32; // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
scope 1 {
debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator-drop-cleanup.rs:11:13: 11:15
debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator-drop-cleanup.rs:+1:13: +1:15
}
bb0: {
_8 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
_8 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb1: {
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
StorageDead(_5); // scope 1 at $DIR/generator-drop-cleanup.rs:+2:13: +2:14
StorageDead(_4); // scope 1 at $DIR/generator-drop-cleanup.rs:+2:14: +2:15
drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator-drop-cleanup.rs:+3:5: +3:6
}
bb2: {
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:+3:5: +3:6
goto -> bb8; // scope 0 at $DIR/generator-drop-cleanup.rs:+3:5: +3:6
}
bb3: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb4 (cleanup): {
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb5 (cleanup): {
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
goto -> bb4; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
nop; // scope 0 at $DIR/generator-drop-cleanup.rs:+3:5: +3:6
goto -> bb4; // scope 0 at $DIR/generator-drop-cleanup.rs:+3:5: +3:6
}
bb6: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb7: {
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb8: {
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
goto -> bb3; // scope 0 at $DIR/generator-drop-cleanup.rs:+3:5: +3:6
}
bb9: {
goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb10: {
StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb11: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
}

View file

@ -3,122 +3,122 @@
fn main::{closure#0}(_1: [generator@$DIR/generator-storage-dead-unwind.rs:22:16: 22:18], _2: ()) -> ()
yields ()
{
let mut _0: (); // return place in scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 22:19
let _3: Foo; // in scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
let _5: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
let mut _6: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
let _7: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
let mut _8: Foo; // in scope 0 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
let _9: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
let mut _10: Bar; // in scope 0 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
let mut _0: (); // return place in scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:19: +0:19
let _3: Foo; // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:13: +1:14
let _5: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
let mut _6: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
let _7: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+4:9: +4:16
let mut _8: Foo; // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+4:14: +4:15
let _9: (); // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+5:9: +5:16
let mut _10: Bar; // in scope 0 at $DIR/generator-storage-dead-unwind.rs:+5:14: +5:15
scope 1 {
debug a => _3; // in scope 1 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
let _4: Bar; // in scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
debug a => _3; // in scope 1 at $DIR/generator-storage-dead-unwind.rs:+1:13: +1:14
let _4: Bar; // in scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:13: +2:14
scope 2 {
debug b => _4; // in scope 2 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
debug b => _4; // in scope 2 at $DIR/generator-storage-dead-unwind.rs:+2:13: +2:14
}
}
bb0: {
StorageLive(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
_3 = Foo(const 5_i32); // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
StorageLive(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
_4 = Bar(const 6_i32); // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
StorageLive(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
StorageLive(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
_6 = (); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
_5 = yield(move _6) -> [resume: bb1, drop: bb6]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
StorageLive(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:13: +1:14
_3 = Foo(const 5_i32); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:17: +1:23
StorageLive(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:13: +2:14
_4 = Bar(const 6_i32); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:17: +2:23
StorageLive(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
StorageLive(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
_6 = (); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
_5 = yield(move _6) -> [resume: bb1, drop: bb6]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
}
bb1: {
StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
StorageLive(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
StorageLive(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
_8 = move _3; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
_7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb10]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:13: +3:14
StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:14: +3:15
StorageLive(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:9: +4:16
StorageLive(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:14: +4:15
_8 = move _3; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:14: +4:15
_7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb10]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:9: +4:16
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:26:9: 26:13
// + literal: Const { ty: fn(Foo) {take::<Foo>}, val: Value(<ZST>) }
}
bb2: {
StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
StorageLive(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
StorageLive(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
_10 = move _4; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
_9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:15: +4:16
StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:16: +4:17
StorageLive(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:9: +5:16
StorageLive(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:14: +5:15
_10 = move _4; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:14: +5:15
_9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:9: +5:16
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:27:9: 27:13
// + literal: Const { ty: fn(Bar) {take::<Bar>}, val: Value(<ZST>) }
}
bb3: {
StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
_0 = const (); // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
goto -> bb4; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:15: +5:16
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:16: +5:17
_0 = const (); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:19: +6:6
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
goto -> bb4; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb4: {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
drop(_1) -> [return: bb5, unwind: bb14]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
drop(_1) -> [return: bb5, unwind: bb14]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb5: {
return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:18: +0:18
return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:6: +6:6
}
bb6: {
StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
drop(_3) -> [return: bb7, unwind: bb15]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:13: +3:14
StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:14: +3:15
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
drop(_3) -> [return: bb7, unwind: bb15]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb7: {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
drop(_1) -> [return: bb8, unwind: bb14]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
drop(_1) -> [return: bb8, unwind: bb14]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb8: {
generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +0:18
generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +6:6
}
bb9 (cleanup): {
StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:15: +5:16
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:16: +5:17
goto -> bb12; // scope 2 at no-location
}
bb10 (cleanup): {
goto -> bb11; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
goto -> bb11; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:15: +4:16
}
bb11 (cleanup): {
StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:15: +4:16
StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:16: +4:17
goto -> bb12; // scope 2 at no-location
}
bb12 (cleanup): {
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
goto -> bb13; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
goto -> bb13; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb13 (cleanup): {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
drop(_1) -> bb14; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
drop(_1) -> bb14; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb14 (cleanup): {
resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +0:18
resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +6:6
}
bb15 (cleanup): {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
drop(_1) -> bb14; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
drop(_1) -> bb14; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
}

View file

@ -16,69 +16,69 @@
fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]>, _2: u8) -> GeneratorState<(), ()> {
debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:+0:17: +0:19
let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:20:13: 20:15
let mut _4: !; // in scope 0 at $DIR/generator-tiny.rs:21:9: 24:10
let mut _5: (); // in scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
let _6: u8; // in scope 0 at $DIR/generator-tiny.rs:22:13: 22:18
let mut _7: (); // in scope 0 at $DIR/generator-tiny.rs:22:13: 22:18
let _8: (); // in scope 0 at $DIR/generator-tiny.rs:23:13: 23:21
let mut _9: (); // in scope 0 at $DIR/generator-tiny.rs:19:25: 19:25
let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:+1:13: +1:15
let mut _4: !; // in scope 0 at $DIR/generator-tiny.rs:+2:9: +5:10
let mut _5: (); // in scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
let _6: u8; // in scope 0 at $DIR/generator-tiny.rs:+3:13: +3:18
let mut _7: (); // in scope 0 at $DIR/generator-tiny.rs:+3:13: +3:18
let _8: (); // in scope 0 at $DIR/generator-tiny.rs:+4:13: +4:21
let mut _9: (); // in scope 0 at $DIR/generator-tiny.rs:+0:25: +0:25
let _10: u8; // in scope 0 at $DIR/generator-tiny.rs:+0:17: +0:19
let mut _11: u32; // in scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
let mut _11: u32; // in scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
scope 1 {
debug _d => (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator-tiny.rs:20:13: 20:15
debug _d => (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator-tiny.rs:+1:13: +1:15
}
bb0: {
_11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
_11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
}
bb1: {
_10 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
nop; // scope 0 at $DIR/generator-tiny.rs:20:13: 20:15
(((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator-tiny.rs:20:18: 20:25
StorageLive(_4); // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10
goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10
_10 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
nop; // scope 0 at $DIR/generator-tiny.rs:+1:13: +1:15
(((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator-tiny.rs:+1:18: +1:25
StorageLive(_4); // scope 1 at $DIR/generator-tiny.rs:+2:9: +5:10
goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:+2:9: +5:10
}
bb2: {
StorageLive(_6); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
StorageLive(_7); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
_7 = (); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
Deinit(_0); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
((_0 as Yielded).0: ()) = move _7; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
discriminant(_0) = 0; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))) = 3; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
return; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
StorageLive(_6); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
StorageLive(_7); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
_7 = (); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
Deinit(_0); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
((_0 as Yielded).0: ()) = move _7; // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
discriminant(_0) = 0; // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))) = 3; // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
return; // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
}
bb3: {
StorageDead(_7); // scope 1 at $DIR/generator-tiny.rs:22:17: 22:18
StorageDead(_6); // scope 1 at $DIR/generator-tiny.rs:22:18: 22:19
StorageLive(_8); // scope 1 at $DIR/generator-tiny.rs:23:13: 23:21
_8 = callee() -> bb4; // scope 1 at $DIR/generator-tiny.rs:23:13: 23:21
StorageDead(_7); // scope 1 at $DIR/generator-tiny.rs:+3:17: +3:18
StorageDead(_6); // scope 1 at $DIR/generator-tiny.rs:+3:18: +3:19
StorageLive(_8); // scope 1 at $DIR/generator-tiny.rs:+4:13: +4:21
_8 = callee() -> bb4; // scope 1 at $DIR/generator-tiny.rs:+4:13: +4:21
// mir::Constant
// + span: $DIR/generator-tiny.rs:23:13: 23:19
// + literal: Const { ty: fn() {callee}, val: Value(<ZST>) }
}
bb4: {
StorageDead(_8); // scope 1 at $DIR/generator-tiny.rs:23:21: 23:22
_5 = const (); // scope 1 at $DIR/generator-tiny.rs:21:14: 24:10
goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10
StorageDead(_8); // scope 1 at $DIR/generator-tiny.rs:+4:21: +4:22
_5 = const (); // scope 1 at $DIR/generator-tiny.rs:+2:14: +5:10
goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:+2:9: +5:10
}
bb5: {
StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
_6 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
_6 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
}
bb6: {
unreachable; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
unreachable; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
}
}

View file

@ -19,8 +19,8 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:+0:17: +0:18
let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:17
let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:17
let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:24
let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:24
}
}

View file

@ -29,10 +29,10 @@
+ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:15:9: 15:9
+ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ }
bb0: {
@ -75,9 +75,9 @@
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
}
- bb3: {
@ -98,7 +98,7 @@
+ }
+
+ bb3: {
+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
@ -126,23 +126,23 @@
+ }
+
+ bb7: {
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:8: 15:8
+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
+ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:41: 15:41
+ }
+
+ bb8: {
+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ }
+
+ bb9: {
+ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
}
}

View file

@ -3,20 +3,20 @@
fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 {
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:32: +0:33
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:+0:44: +0:48
let _3: &i32; // in scope 0 at $DIR/retag.rs:42:13: 42:15
let _3: &i32; // in scope 0 at $DIR/retag.rs:+1:13: +1:15
scope 1 {
debug _y => _3; // in scope 1 at $DIR/retag.rs:42:13: 42:15
debug _y => _3; // in scope 1 at $DIR/retag.rs:+1:13: +1:15
}
bb0: {
Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:31: +0:48
Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:31: +3:6
Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:32: +0:33
StorageLive(_3); // scope 0 at $DIR/retag.rs:42:13: 42:15
_3 = _2; // scope 0 at $DIR/retag.rs:42:18: 42:19
Retag(_3); // scope 0 at $DIR/retag.rs:42:18: 42:19
_0 = _2; // scope 1 at $DIR/retag.rs:43:9: 43:10
Retag(_0); // scope 1 at $DIR/retag.rs:43:9: 43:10
StorageDead(_3); // scope 0 at $DIR/retag.rs:44:5: 44:6
return; // scope 0 at $DIR/retag.rs:+0:48: +0:48
StorageLive(_3); // scope 0 at $DIR/retag.rs:+1:13: +1:15
_3 = _2; // scope 0 at $DIR/retag.rs:+1:18: +1:19
Retag(_3); // scope 0 at $DIR/retag.rs:+1:18: +1:19
_0 = _2; // scope 1 at $DIR/retag.rs:+2:9: +2:10
Retag(_0); // scope 1 at $DIR/retag.rs:+2:9: +2:10
StorageDead(_3); // scope 0 at $DIR/retag.rs:+3:5: +3:6
return; // scope 0 at $DIR/retag.rs:+3:6: +3:6
}
}

View file

@ -198,6 +198,6 @@ static XXX: &Foo = {
_0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:1: +18:2
return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:1: +18:3
}
}

View file

@ -5,6 +5,6 @@ const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 =
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:+0:38: +0:39
return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:39
return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:40
}
}

View file

@ -2,13 +2,13 @@ error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
--> $DIR/defaults-cyclic-fail.rs:5:5
|
LL | const A: u8 = Self::B;
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `Tr::B`...
--> $DIR/defaults-cyclic-fail.rs:8:5
|
LL | const B: u8 = Self::A;
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle
note: cycle used when const-evaluating + checking `main::promoted[1]`
--> $DIR/defaults-cyclic-fail.rs:16:16

View file

@ -13,7 +13,7 @@ note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
|
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
|

View file

@ -13,7 +13,7 @@ note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
|
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
|

View file

@ -13,7 +13,7 @@ note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
|
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
|

View file

@ -8,7 +8,7 @@ note: ...which requires const-evaluating + checking `A`...
--> $DIR/issue-36163.rs:1:1
|
LL | const A: isize = Foo::B as isize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `Foo::B::{constant#0}`, completing the cycle
note: cycle used when simplifying constant for the type system `Foo::B::{constant#0}`
--> $DIR/issue-36163.rs:4:9

View file

@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO`
--> $DIR/issue-17252.rs:1:1
|
LL | const FOO: usize = FOO;
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires const-evaluating + checking `FOO` again
note: cycle used when const-evaluating + checking `main::{constant#0}`

View file

@ -2,13 +2,13 @@ error[E0391]: cycle detected when const-evaluating + checking `A`
--> $DIR/issue-23302-3.rs:1:1
|
LL | const A: i32 = B;
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `B`...
--> $DIR/issue-23302-3.rs:3:1
|
LL | const B: i32 = A;
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `A`, completing the cycle
note: cycle used when simplifying constant for the type system `A`
--> $DIR/issue-23302-3.rs:1:1

View file

@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/escape-argument-callee.rs:26:38
|
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^
| ^^^^^^^^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/escape-argument.rs:26:38
|
LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^
| ^^^^^^^^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/escape-upvar-nested.rs:21:32
|
LL | let mut closure1 = || p = &y;
| ^^
| ^^^^^^^^^
|
= note: defining type: test::{closure#0}::{closure#0} with closure substs [
i16,
@ -16,7 +16,11 @@ note: external requirements
--> $DIR/escape-upvar-nested.rs:20:27
|
LL | let mut closure = || {
| ^^
| ___________________________^
LL | | let mut closure1 = || p = &y;
LL | | closure1();
LL | | };
| |_________^
|
= note: defining type: test::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/escape-upvar-ref.rs:23:27
|
LL | let mut closure = || p = &y;
| ^^
| ^^^^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,

View file

@ -1,8 +1,12 @@
note: no external requirements
--> $DIR/propagate-approximated-fail-no-postdom.rs:43:9
|
LL | |_outlives1, _outlives2, _outlives3, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | / |_outlives1, _outlives2, _outlives3, x, y| {
LL | | // Only works if 'x: 'y:
LL | | let p = x.get();
LL | | demand_y(x, y, p)
LL | | },
| |_________^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,12 @@ note: external requirements
--> $DIR/propagate-approximated-ref.rs:43:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| _______________________________________________^
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | |
LL | | });
| |_____^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,11 @@ note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:21:15
|
LL | foo(cell, |cell_a, cell_x| {
| ^^^^^^^^^^^^^^^^
| _______________^
LL | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
LL | |
LL | | })
| |_____^
|
= note: defining type: case1::{closure#0} with closure substs [
i32,
@ -38,7 +42,10 @@ note: external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:35:15
|
LL | foo(cell, |cell_a, cell_x| {
| ^^^^^^^^^^^^^^^^
| _______________^
LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error
LL | | })
| |_____^
|
= note: defining type: case2::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,13 @@ note: external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:32:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| ^^^^^^^^^^^^^^^^^
| _______________________________________________^
LL | |
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
| |_____^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,13 @@ note: external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:35:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| _______________________________________________^
LL | |
LL | |
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | | });
| |_____^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,12 @@ note: external requirements
--> $DIR/propagate-approximated-val.rs:36:45
|
LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| _____________________________________________^
LL | | // Only works if 'x: 'y:
LL | | demand_y(outlives1, outlives2, x.get())
LL | |
LL | | });
| |_____^
|
= note: defining type: test::{closure#0} with closure substs [
i16,

View file

@ -1,8 +1,12 @@
note: external requirements
--> $DIR/propagate-despite-same-free-region.rs:42:9
|
LL | |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | / |_outlives1, _outlives2, x, y| {
LL | | // Only works if 'x: 'y:
LL | | let p = x.get();
LL | | demand_y(x, y, p)
LL | | },
| |_________^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,12 @@ note: no external requirements
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:35:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
| ^^^^^^^^^^^^^^^^^
| _______________________________________________^
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | |
LL | | });
| |_____^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,12 @@ note: no external requirements
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:39:47
|
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| _______________________________________________^
LL | | // Only works if 'x: 'y:
LL | | demand_y(x, y, x.get())
LL | |
LL | | });
| |_____^
|
= note: defining type: supply::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,14 @@ note: external requirements
--> $DIR/propagate-from-trait-match.rs:32:36
|
LL | establish_relationships(value, |value| {
| ^^^^^^^
| ____________________________________^
LL | |
LL | |
LL | | // This function call requires that
... |
LL | | require(value);
LL | | });
| |_____^
|
= note: defining type: supply::<'_#1r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/return-wrong-bound-region.rs:11:16
|
LL | expect_sig(|a, b| b); // ought to return `a`
| ^^^^^^
| ^^^^^^^^
|
= note: defining type: test::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/projection-no-regions-closure.rs:25:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -39,7 +39,7 @@ note: external requirements
--> $DIR/projection-no-regions-closure.rs:34:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -66,7 +66,7 @@ note: external requirements
--> $DIR/projection-no-regions-closure.rs:42:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: wrong_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -103,7 +103,7 @@ note: external requirements
--> $DIR/projection-no-regions-closure.rs:52:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/projection-one-region-closure.rs:45:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -56,7 +56,7 @@ note: external requirements
--> $DIR/projection-one-region-closure.rs:56:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -109,7 +109,7 @@ note: external requirements
--> $DIR/projection-one-region-closure.rs:70:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -137,7 +137,7 @@ note: external requirements
--> $DIR/projection-one-region-closure.rs:80:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:37:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -44,7 +44,7 @@ note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:47:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -85,7 +85,7 @@ note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:60:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -113,7 +113,7 @@ note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:69:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -141,7 +141,7 @@ note: external requirements
--> $DIR/projection-one-region-trait-bound-closure.rs:81:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:36:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_late::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -28,7 +28,7 @@ note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:45:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -54,7 +54,7 @@ note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:64:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -80,7 +80,7 @@ note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:73:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: elements_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -106,7 +106,7 @@ note: no external requirements
--> $DIR/projection-one-region-trait-bound-static-closure.rs:85:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:38:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_late::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -40,7 +40,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
@ -77,7 +77,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:61:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
@ -105,7 +105,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:70:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
@ -133,7 +133,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:79:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>::{closure#0} with closure substs [
i32,
@ -161,7 +161,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:87:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: two_regions::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -203,7 +203,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:97:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,
@ -231,7 +231,7 @@ note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:109:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: one_region::<'_#1r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/ty-param-closure-approximate-lower-bound.rs:24:24
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^
| ^^^^^^^^^^^^^^^^^^^
|
= note: defining type: generic::<T>::{closure#0} with closure substs [
i16,
@ -27,7 +27,7 @@ note: external requirements
--> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^
| ^^^^^^^^^^^^^^^^^^^
|
= note: defining type: generic_fail::<T>::{closure#0} with closure substs [
i16,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23
|
LL | with_signature(x, |y| y)
| ^^^
| ^^^^^
|
= note: defining type: no_region::<'_#1r, T>::{closure#0} with closure substs [
i32,

View file

@ -2,7 +2,14 @@ note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
| __________________________^
LL | |
LL | | //
LL | | // See `correct_region`, which explains the point of this
... |
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: no_region::<T>::{closure#0} with closure substs [
i32,
@ -49,7 +56,14 @@ note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
| __________________________^
LL | | // Key point of this test:
LL | | //
LL | | // The *closure* is being type-checked with all of its free
... |
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -77,7 +91,12 @@ note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
| __________________________^
LL | |
LL | | // See `correct_region`
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [
i32,
@ -122,7 +141,11 @@ note: external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26
|
LL | with_signature(a, b, |x, y| {
| ^^^^^^
| __________________________^
LL | | // See `correct_region`
LL | | require(&x, &y)
LL | | })
| |_____^
|
= note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [
i32,

View file

@ -30,14 +30,15 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
LL | let _closure = || {
| - `c` dropped here while still borrowed
...
LL | SomeEnum::SomeVariant(Cell::new(&c)),
| ----------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
...
LL | };
| - `c` dropped here while still borrowed
error: aborting due to 3 previous errors

View file

@ -28,28 +28,28 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
LL | let _closure = || {
| - `c` dropped here while still borrowed
...
LL | f(&c);
| --^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
LL | };
| - `c` dropped here while still borrowed
error[E0597]: `c` does not live long enough
--> $DIR/adt-tuple-struct-calls.rs:53:11
|
LL | let f = SomeStruct::<&'a u32>;
| - lifetime `'1` appears in the type of `f`
LL | let _closure = || {
| - `c` dropped here while still borrowed
LL | let c = 66;
...
LL | f(&c);
| --^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'1`
LL | };
| - `c` dropped here while still borrowed
error: aborting due to 4 previous errors

View file

@ -28,14 +28,14 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
LL | let _closure = || {
| - `c` dropped here while still borrowed
LL | let c = 66;
...
LL | some_fn::<&'a u32>(&c);
| -------------------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
LL | };
| - `c` dropped here while still borrowed
error: aborting due to 3 previous errors

View file

@ -29,14 +29,13 @@ error[E0597]: `c` does not live long enough
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
...
LL | let _closure = || {
| - `c` dropped here while still borrowed
LL | let c = 66;
LL | a.method::<&'a u32>(b, &c);
| ------------------------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
LL | };
| - `c` dropped here while still borrowed
error: aborting due to 3 previous errors

View file

@ -29,14 +29,13 @@ error[E0597]: `c` does not live long enough
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
...
LL | let _closure = || {
| - `c` dropped here while still borrowed
LL | let c = 66;
LL | <_ as Bazoom<_>>::method::<&'a u32>(&a, b, &c);
| -------------------------------------------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
LL | };
| - `c` dropped here while still borrowed
error: aborting due to 3 previous errors