fork/rust

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

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

1.44.0
2.1 KiB62 linesraw
1note: external requirements
2  --> $DIR/ty-param-closure-approximate-lower-bound.rs:24:24
3   |
4LL |     twice(cell, value, |a, b| invoke(a, b));
5   |                        ^^^^^^^^^^^^^^^^^^^
6   |
7   = note: defining type: generic::<T>::{{closure}}#0 with closure substs [
8               i16,
9               for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed('s)) T)),
10               (),
11           ]
12   = note: number of external vids: 2
13   = note: where T: '_#1r
14
15note: no external requirements
16  --> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1
17   |
18LL | / fn generic<T>(value: T) {
19LL | |     let cell = Cell::new(&());
20LL | |     twice(cell, value, |a, b| invoke(a, b));
21LL | | }
22   | |_^
23   |
24   = note: defining type: generic::<T>
25
26note: external requirements
27  --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
28   |
29LL |     twice(cell, value, |a, b| invoke(a, b));
30   |                        ^^^^^^^^^^^^^^^^^^^
31   |
32   = note: defining type: generic_fail::<T>::{{closure}}#0 with closure substs [
33               i16,
34               for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed('r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed('s)) T)),
35               (),
36           ]
37   = note: late-bound region is '_#2r
38   = note: number of external vids: 3
39   = note: where T: '_#1r
40
41note: no external requirements
42  --> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1
43   |
44LL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
45LL | |     twice(cell, value, |a, b| invoke(a, b));
46LL | |
47LL | | }
48   | |_^
49   |
50   = note: defining type: generic_fail::<T>
51
52error[E0309]: the parameter type `T` may not live long enough
53  --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
54   |
55LL |     twice(cell, value, |a, b| invoke(a, b));
56   |                        ^^^^^^^^^^^^^^^^^^^
57   |
58   = help: consider adding an explicit lifetime bound `T: 'a`...
59
60error: aborting due to previous error
61
62For more information about this error, try `rustc --explain E0309`.