|
| 1 | +warning: not reporting region error due to -Znll |
| 2 | + --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:5 |
| 3 | + | |
| 4 | +31 | foo(cell, |cell_a, cell_x| { |
| 5 | + | ^^^ |
| 6 | + |
| 7 | +error: free region `'_#2r` does not outlive free region `'_#1r` |
| 8 | + --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9 |
| 9 | + | |
| 10 | +33 | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure |
| 11 | + | ^^^^^^ |
| 12 | + |
| 13 | +note: External requirements |
| 14 | + --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15 |
| 15 | + | |
| 16 | +31 | foo(cell, |cell_a, cell_x| { |
| 17 | + | _______________^ |
| 18 | +32 | | //~^ WARNING not reporting region error due to -Znll |
| 19 | +33 | | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure |
| 20 | +34 | | //~^ ERROR free region `'_#2r` does not outlive free region `'_#1r` |
| 21 | +35 | | }) |
| 22 | + | |_____^ |
| 23 | + | |
| 24 | + = note: defining type: DefId(0/1:12 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]::{{closure}}[0]) with closure substs [ |
| 25 | + i32, |
| 26 | + for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>)) |
| 27 | + ] |
| 28 | + = note: number of external vids: 2 |
| 29 | + |
| 30 | +note: No external requirements |
| 31 | + --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1 |
| 32 | + | |
| 33 | +28 | / fn case1() { |
| 34 | +29 | | let a = 0; |
| 35 | +30 | | let cell = Cell::new(&a); |
| 36 | +31 | | foo(cell, |cell_a, cell_x| { |
| 37 | +... | |
| 38 | +35 | | }) |
| 39 | +36 | | } |
| 40 | + | |_^ |
| 41 | + | |
| 42 | + = note: defining type: DefId(0/0:5 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case1[0]) with substs [] |
| 43 | + |
| 44 | +note: External requirements |
| 45 | + --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:48:15 |
| 46 | + | |
| 47 | +48 | foo(cell, |cell_a, cell_x| { |
| 48 | + | _______________^ |
| 49 | +49 | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error |
| 50 | +50 | | }) |
| 51 | + | |_____^ |
| 52 | + | |
| 53 | + = note: defining type: DefId(0/1:13 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]::{{closure}}[0]) with closure substs [ |
| 54 | + i32, |
| 55 | + for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex { depth: 1 }, BrNamed(crate0:DefIndex(0:0), 'r)) u32>)) |
| 56 | + ] |
| 57 | + = note: number of external vids: 2 |
| 58 | + = note: where '_#1r: '_#0r |
| 59 | + |
| 60 | +note: No external requirements |
| 61 | + --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:39:1 |
| 62 | + | |
| 63 | +39 | / fn case2() { |
| 64 | +40 | | let a = 0; |
| 65 | +41 | | let cell = Cell::new(&a); |
| 66 | +42 | | |
| 67 | +... | |
| 68 | +50 | | }) |
| 69 | +51 | | } |
| 70 | + | |_^ |
| 71 | + | |
| 72 | + = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_comparing_against_free[317d]::case2[0]) with substs [] |
| 73 | + |
| 74 | +error: aborting due to previous error |
| 75 | + |
0 commit comments