Skip to content

Commit a98aff7

Browse files
committed
Updated test to reflect expected Mir output.
1 parent 7db49b9 commit a98aff7

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/test/compile-fail/issue-36082.rs

+18-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// revisions: ast mir
12+
//[mir]compile-flags: -Z emit-end-regions -Z borrowck-mir
13+
1114
use std::cell::RefCell;
1215

1316
fn main() {
@@ -16,10 +19,20 @@ fn main() {
1619
let x = RefCell::new((&mut r,s));
1720

1821
let val: &_ = x.borrow().0;
19-
//~^ ERROR borrowed value does not live long enough
20-
//~| temporary value dropped here while still borrowed
21-
//~| temporary value created here
22-
//~| consider using a `let` binding to increase its lifetime
22+
//[ast]~^ ERROR borrowed value does not live long enough [E0597]
23+
//[ast]~| NOTE temporary value dropped here while still borrowed
24+
//[ast]~| NOTE temporary value created here
25+
//[ast]~| NOTE consider using a `let` binding to increase its lifetime
26+
//[mir]~^^^^^ ERROR borrowed value does not live long enough (Ast) [E0597]
27+
//[mir]~| NOTE temporary value dropped here while still borrowed
28+
//[mir]~| NOTE temporary value created here
29+
//[mir]~| NOTE consider using a `let` binding to increase its lifetime
30+
//[mir]~| ERROR borrowed value does not live long enough (Mir) [E0597]
31+
//[mir]~| NOTE temporary value dropped here while still borrowed
32+
//[mir]~| NOTE temporary value created here
33+
//[mir]~| NOTE consider using a `let` binding to increase its lifetime
2334
println!("{}", val);
2435
}
25-
//~^ temporary value needs to live until here
36+
//[ast]~^ NOTE temporary value needs to live until here
37+
//[mir]~^^ NOTE temporary value needs to live until here
38+
//[mir]~| NOTE temporary value needs to live until here

0 commit comments

Comments
 (0)