fdd8a0dde5
Fixes #73159 This is similar to #69350 - if the user didn't initially write out a 'static lifetime, adding 'static in response to a lifetime error is usually the wrong thing to do.
11 lines
383 B
Plaintext
11 lines
383 B
Plaintext
error: lifetime may not live long enough
|
|
--> $DIR/regions-infer-invariance-due-to-mutability-4.rs:10:5
|
|
|
|
|
LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> {
|
|
| -- lifetime `'r` defined here
|
|
LL | b_isize
|
|
| ^^^^^^^ returning this value requires that `'r` must outlive `'static`
|
|
|
|
error: aborting due to previous error
|
|
|