summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
blob: 3468c5ad37298bfb032e50f094eb9f01bcf4ddca (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
note: external requirements
  --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23
   |
LL |     with_signature(x, |y| y)
   |                       ^^^
   |
   = note: defining type: no_region::<'?1, T>::{closure#0} with closure args [
               i32,
               extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '?2)>,
               (),
           ]
   = note: number of external vids: 3
   = note: where T: '?2

note: no external requirements
  --> $DIR/ty-param-closure-outlives-from-return-type.rs:15:1
   |
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
LL | | where
LL | |     T: Debug,
   | |_____________^
   |
   = note: defining type: no_region::<'?1, T>

error[E0309]: the parameter type `T` may not live long enough
  --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:27
   |
LL | fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
   |              -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL |     with_signature(x, |y| y)
   |                           ^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL |     T: Debug + 'a,
   |              ++++

error[E0309]: the parameter type `T` may not live long enough
  --> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5
   |
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
   |                 -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL |     x
   |     ^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL |     T: 'b + Debug + 'a,
   |                   ++++

error: aborting due to 2 previous errors

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