]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
f316a551cffa69543a0d779222a8b56f23cae16d
[rust.git] / src / test / ui / nll / ty-outlives / ty-param-closure-approximate-lower-bound.stderr
1 note: external requirements
2   --> $DIR/ty-param-closure-approximate-lower-bound.rs:24:24
3    |
4 LL |     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<'a, 'b> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) T)),
10                (),
11            ]
12    = note: number of external vids: 2
13    = note: where T: '_#1r
14
15 note: no external requirements
16   --> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1
17    |
18 LL | fn generic<T>(value: T) {
19    | ^^^^^^^^^^^^^^^^^^^^^^^
20    |
21    = note: defining type: generic::<T>
22
23 note: external requirements
24   --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
25    |
26 LL |     twice(cell, value, |a, b| invoke(a, b));
27    |                        ^^^^^^
28    |
29    = note: defining type: generic_fail::<T>::{closure#0} with closure substs [
30                i16,
31                for<'a, 'b> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) T)),
32                (),
33            ]
34    = note: late-bound region is '_#2r
35    = note: number of external vids: 3
36    = note: where T: '_#1r
37
38 note: no external requirements
39   --> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1
40    |
41 LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
42    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43    |
44    = note: defining type: generic_fail::<T>
45
46 error[E0309]: the parameter type `T` may not live long enough
47   --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:31
48    |
49 LL |     twice(cell, value, |a, b| invoke(a, b));
50    |                               ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
51    |
52 help: consider adding an explicit lifetime bound...
53    |
54 LL | fn generic_fail<'a, T: 'a>(cell: Cell<&'a ()>, value: T) {
55    |                      ++++
56
57 error: aborting due to previous error
58
59 For more information about this error, try `rustc --explain E0309`.