2018-08-28 04:46:08 +00:00
|
|
|
error[E0309]: the parameter type `T` may not live long enough
|
2021-08-06 15:46:20 +00:00
|
|
|
--> $DIR/regions-struct-not-wf.rs:13:16
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | type Out = &'a T;
|
2021-08-06 15:46:20 +00:00
|
|
|
| ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
|
2022-03-14 14:56:37 +00:00
|
|
|
|
|
|
|
|
help: consider adding an explicit lifetime bound...
|
|
|
|
|
|
|
|
|
LL | impl<'a, T: 'a> Trait<'a, T> for usize {
|
|
|
|
| ++++
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
|
|
error[E0309]: the parameter type `T` may not live long enough
|
2021-08-06 15:46:20 +00:00
|
|
|
--> $DIR/regions-struct-not-wf.rs:21:16
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | type Out = RefOk<'a, T>;
|
2021-08-06 15:46:20 +00:00
|
|
|
| ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
|
2021-07-30 15:12:10 +00:00
|
|
|
|
|
|
|
|
note: ...that is required by this bound
|
|
|
|
--> $DIR/regions-struct-not-wf.rs:16:20
|
|
|
|
|
|
|
|
|
LL | struct RefOk<'a, T:'a> {
|
|
|
|
| ^^
|
2022-03-14 14:56:37 +00:00
|
|
|
help: consider adding an explicit lifetime bound...
|
|
|
|
|
|
|
|
|
LL | impl<'a, T: 'a> Trait<'a, T> for u32 {
|
|
|
|
| ++++
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
|
|
error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
|
2021-08-06 15:46:20 +00:00
|
|
|
--> $DIR/regions-struct-not-wf.rs:25:16
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | type Out = &'a &'b T;
|
2021-08-06 15:46:20 +00:00
|
|
|
| ^^^^^^^^^
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
2021-10-05 12:11:51 +00:00
|
|
|
note: the pointer is valid for the lifetime `'a` as defined here
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/regions-struct-not-wf.rs:24:6
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
|
|
|
LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
|
|
|
|
| ^^
|
2021-10-05 12:11:51 +00:00
|
|
|
note: but the referenced data is only valid for the lifetime `'b` as defined here
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/regions-struct-not-wf.rs:24:10
|
2018-08-28 04:46:08 +00:00
|
|
|
|
|
|
|
|
LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0309, E0491.
|
2018-08-28 04:46:08 +00:00
|
|
|
For more information about an error, try `rustc --explain E0309`.
|