rust/tests/ui/regions/regions-close-param-into-object.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
2.0 KiB
Plaintext
Raw Normal View History

error[E0310]: the parameter type `T` may not live long enough
2022-04-01 17:13:25 +00:00
--> $DIR/regions-close-param-into-object.rs:6:5
|
LL | Box::new(v)
2023-09-17 14:32:02 +00:00
| ^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
2022-03-14 14:56:37 +00:00
|
help: consider adding an explicit lifetime bound...
|
LL | where T : X + 'static
| +++++++++
error[E0310]: the parameter type `T` may not live long enough
2022-04-01 17:13:25 +00:00
--> $DIR/regions-close-param-into-object.rs:12:5
|
LL | Box::new(v)
2023-09-17 14:32:02 +00:00
| ^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
2022-03-14 14:56:37 +00:00
|
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
2022-04-01 17:13:25 +00:00
--> $DIR/regions-close-param-into-object.rs:18:5
|
2023-09-17 14:32:02 +00:00
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)
2022-04-24 15:04:31 +00:00
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
2022-03-14 14:56:37 +00:00
|
help: consider adding an explicit lifetime bound...
|
LL | where T : X + 'a
| ++++
error[E0309]: the parameter type `T` may not live long enough
2022-04-01 17:13:25 +00:00
--> $DIR/regions-close-param-into-object.rs:24:5
|
2023-09-17 14:32:02 +00:00
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)
2022-04-24 15:04:31 +00:00
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
2022-03-14 14:56:37 +00:00
|
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`.