rust/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
2019-05-29 00:57:31 -04:00

32 lines
1.1 KiB
Plaintext

error[E0309]: the parameter type `T` may not live long enough
--> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
|
LL | impl<'a, T> Trait<'a, T> for usize {
| - help: consider adding an explicit lifetime bound `T: 'a`...
LL | type Out = &'a fn(T);
| ^^^^^^^^^^^^^^^^^^^^^
|
note: ...so that the reference type `&'a fn(T)` does not outlive the data it points at
--> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
|
LL | type Out = &'a fn(T);
| ^^^^^^^^^^^^^^^^^^^^^
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
|
LL | impl<'a, T> Trait<'a, T> for u32 {
| - help: consider adding an explicit lifetime bound `T: 'a`...
LL | type Out = &'a dyn Baz<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
--> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
|
LL | type Out = &'a dyn Baz<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0309`.