fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.1 KiB41 linesraw
1note: no external requirements
2  --> $DIR/escape-argument.rs:26:38
3   |
4LL |         let mut closure = expect_sig(|p, y| *p = y);
5   |                                      ^^^^^^^^^^^^^
6   |
7   = note: defining type: test::{{closure}}#0 with closure substs [
8               i16,
9               for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed('r)) mut &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32, &ReLateBound(DebruijnIndex(0), BrNamed('s)) i32)),
10               (),
11           ]
12
13note: no external requirements
14  --> $DIR/escape-argument.rs:20:1
15   |
16LL | / fn test() {
17LL | |     let x = 44;
18LL | |     let mut p = &x;
19LL | |
20...  |
21LL | |     deref(p);
22LL | | }
23   | |_^
24   |
25   = note: defining type: test
26
27error[E0597]: `y` does not live long enough
28  --> $DIR/escape-argument.rs:27:25
29   |
30LL |         closure(&mut p, &y);
31   |                         ^^ borrowed value does not live long enough
32LL |
33LL |     }
34   |     - `y` dropped here while still borrowed
35LL | 
36LL |     deref(p);
37   |           - borrow later used here
38
39error: aborting due to previous error
40
41For more information about this error, try `rustc --explain E0597`.