rust/src/test/ui/nll/closure-requirements/escape-argument.stderr

40 lines
1.3 KiB
Plaintext
Raw Normal View History

note: External requirements
--> $DIR/escape-argument.rs:34:38
|
34 | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^^^^^^^^
|
= note: defining type: DefId(0/1:9 ~ escape_argument[317d]::test[0]::{{closure}}[0]) with closure substs [
i16,
for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 's)) i32))
]
= note: number of external vids: 1
note: No external requirements
--> $DIR/escape-argument.rs:28:1
|
28 | / fn test() {
29 | | let x = 44;
30 | | let mut p = &x;
31 | |
... |
39 | | deref(p);
40 | | }
| |_^
|
= note: defining type: DefId(0/0:3 ~ escape_argument[317d]::test[0]) with substs []
error[E0597]: borrowed value does not live long enough
--> $DIR/escape-argument.rs:36:6
|
33 | let y = 22;
| - temporary value created here
...
36 | }
| ^ temporary value dropped here while still borrowed
|
= note: consider using a `let` binding to increase its lifetime
error: aborting due to previous error