os-rust/tests/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr

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

30 lines
1.1 KiB
Text
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:16
2018-08-08 14:28:26 +02:00
|
2023-09-17 14:32:02 +00:00
LL | impl<'a, T> Trait<'a, T> for usize {
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
2019-03-09 15:03:44 +03:00
LL | type Out = &'a fn(T);
| ^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at
2022-03-14 15:56:37 +01:00
|
2023-10-08 10:06:17 +00:00
help: consider adding an explicit lifetime bound
2022-03-14 15:56:37 +01:00
|
LL | impl<'a, T: 'a> Trait<'a, T> for usize {
| ++++
2018-08-08 14:28:26 +02:00
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:16
2018-08-08 14:28:26 +02:00
|
2023-09-17 14:32:02 +00:00
LL | impl<'a, T> Trait<'a, T> for u32 {
| -- the parameter type `T` must be valid for the lifetime `'a` as defined here...
2019-05-28 14:46:13 -04:00
LL | type Out = &'a dyn Baz<T>;
| ^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
2022-03-14 15:56:37 +01:00
|
2023-10-08 10:06:17 +00:00
help: consider adding an explicit lifetime bound
2022-03-14 15:56:37 +01:00
|
LL | impl<'a, T: 'a> Trait<'a, T> for u32 {
| ++++
2018-08-08 14:28:26 +02:00
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.