rust/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr

32 lines
1.3 KiB
Plaintext
Raw Normal View History

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