summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
blob: 2c4a0597554a3d8573c7b16459998f392335d7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
note: external requirements
  --> $DIR/ty-param-closure-approximate-lower-bound.rs:24:24
   |
LL |     twice(cell, value, |a, b| invoke(a, b));
   |                        ^^^^^^
   |
   = note: defining type: generic::<T>::{closure#0} with closure substs [
               i16,
               for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
               (),
           ]
   = note: number of external vids: 2
   = note: where T: '_#1r

note: no external requirements
  --> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1
   |
LL | fn generic<T>(value: T) {
   | ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: defining type: generic::<T>

note: external requirements
  --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
   |
LL |     twice(cell, value, |a, b| invoke(a, b));
   |                        ^^^^^^
   |
   = note: defining type: generic_fail::<T>::{closure#0} with closure substs [
               i16,
               for<Region(BrAnon(None)), Region(BrAnon(None))> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(None) }) T)),
               (),
           ]
   = note: late-bound region is '_#2r
   = note: number of external vids: 3
   = note: where T: '_#1r

note: no external requirements
  --> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1
   |
LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: defining type: generic_fail::<T>

error[E0309]: the parameter type `T` may not live long enough
  --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:31
   |
LL |     twice(cell, value, |a, b| invoke(a, b));
   |                               ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound...
   |
LL | fn generic_fail<'a, T: 'a>(cell: Cell<&'a ()>, value: T) {
   |                      ++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0309`.