]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / impl-header-lifetime-elision / dyn-trait.stderr
1 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2   --> $DIR/dyn-trait.rs:32:16
3    |
4 LL |     static_val(x); //~ ERROR cannot infer
5    |                ^
6    |
7 note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:26...
8   --> $DIR/dyn-trait.rs:31:26
9    |
10 LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
11    |                          ^^
12    = note: ...so that the expression is assignable:
13            expected std::boxed::Box<dyn std::fmt::Debug>
14               found std::boxed::Box<(dyn std::fmt::Debug + 'a)>
15    = note: but, the lifetime must be valid for the static lifetime...
16    = note: ...so that the types are compatible:
17            expected StaticTrait
18               found StaticTrait
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0495`.