fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
1022 B30 linesraw
1error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2  --> $DIR/dyn-trait.rs:20:16
3   |
4LL |     static_val(x);
5   |                ^
6   |
7note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 19:26...
8  --> $DIR/dyn-trait.rs:19:26
9   |
10LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
11   |                          ^^
12note: ...so that the expression is assignable
13  --> $DIR/dyn-trait.rs:20:16
14   |
15LL |     static_val(x);
16   |                ^
17   = note: expected  `std::boxed::Box<dyn std::fmt::Debug>`
18              found  `std::boxed::Box<(dyn std::fmt::Debug + 'a)>`
19   = note: but, the lifetime must be valid for the static lifetime...
20note: ...so that the types are compatible
21  --> $DIR/dyn-trait.rs:20:5
22   |
23LL |     static_val(x);
24   |     ^^^^^^^^^^
25   = note: expected  `StaticTrait`
26              found  `StaticTrait`
27
28error: aborting due to previous error
29
30For more information about this error, try `rustc --explain E0495`.