blob: 93160a1c5e51520624751ad74430bac4c2f10996 [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/lifetime-bound-will-change-warning.rs:34:13
|
LL | ref_obj(x)
| ^ lifetime mismatch
|
= note: expected reference `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>`
found reference `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>`
note: the lifetime `'a` as defined on the function body at 32:10...
--> $DIR/lifetime-bound-will-change-warning.rs:32:10
|
LL | fn test2<'a>(x: &'a Box<dyn Fn() + 'a>) {
| ^^
= note: ...does not necessarily outlive the static lifetime
error[E0308]: mismatched types
--> $DIR/lifetime-bound-will-change-warning.rs:39:18
|
LL | lib::ref_obj(x)
| ^ lifetime mismatch
|
= note: expected reference `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>`
found reference `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>`
note: the lifetime `'a` as defined on the function body at 37:12...
--> $DIR/lifetime-bound-will-change-warning.rs:37:12
|
LL | fn test2cc<'a>(x: &'a Box<dyn Fn() + 'a>) {
| ^^
= note: ...does not necessarily outlive the static lifetime
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.