summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-close-param-into-object.stderr
blob: 385441d32827709a66b76d559f7fc5243ddfb284 (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
60
error[E0310]: the parameter type `T` may not live long enough
  --> $DIR/regions-close-param-into-object.rs:6:5
   |
LL |     Box::new(v)
   |     ^^^^^^^^^^^
   |     |
   |     the parameter type `T` must be valid for the static lifetime...
   |     ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL |     where T : X + 'static
   |                 +++++++++

error[E0310]: the parameter type `T` may not live long enough
  --> $DIR/regions-close-param-into-object.rs:12:5
   |
LL |     Box::new(v)
   |     ^^^^^^^^^^^
   |     |
   |     the parameter type `T` must be valid for the static lifetime...
   |     ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn p2<T: 'static>(v: Box<T>) -> Box<dyn X + 'static>
   |        +++++++++

error[E0309]: the parameter type `T` may not live long enough
  --> $DIR/regions-close-param-into-object.rs:18:5
   |
LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
   |       -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL |     Box::new(v)
   |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL |     where T : X + 'a
   |                 ++++

error[E0309]: the parameter type `T` may not live long enough
  --> $DIR/regions-close-param-into-object.rs:24:5
   |
LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
   |       -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
...
LL |     Box::new(v)
   |     ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn p4<'a,T: 'a>(v: Box<T>) -> Box<dyn X + 'a>
   |           ++++

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0309, E0310.
For more information about an error, try `rustc --explain E0309`.