]> git.proxmox.com Git - rustc.git/blame - src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
New upstream version 1.27.1+dfsg1
[rustc.git] / src / test / ui / in-band-lifetimes / impl / dyn-trait.stderr
CommitLineData
0531ce1d 1error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
83c7162d 2 --> $DIR/dyn-trait.rs:32:16
0531ce1d
XL
3 |
4LL | static_val(x); //~ ERROR cannot infer
5 | ^
6 |
83c7162d
XL
7note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:1...
8 --> $DIR/dyn-trait.rs:31:1
0531ce1d
XL
9 |
10LL | 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<std::fmt::Debug>
14 found std::boxed::Box<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
20error: aborting due to previous error
21
22For more information about this error, try `rustc --explain E0495`.