]> git.lizzy.rs Git - rust.git/blob - src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / object-lifetime / object-lifetime-default-mybox.stderr
1 error[E0623]: lifetime mismatch
2   --> $DIR/object-lifetime-default-mybox.rs:27:5
3    |
4 LL | fn load1<'a,'b>(a: &'a MyBox<dyn SomeTrait>,
5    |                    ------------------------ this parameter and the return type are declared with different lifetimes...
6 LL |                 b: &'b MyBox<dyn SomeTrait>)
7 LL |                 -> &'b MyBox<dyn SomeTrait>
8    |                    ------------------------
9 LL | {
10 LL |     a
11    |     ^ ...but data from `a` is returned here
12
13 error[E0308]: mismatched types
14   --> $DIR/object-lifetime-default-mybox.rs:31:11
15    |
16 LL |     load0(ss)
17    |           ^^ lifetime mismatch
18    |
19    = note: expected reference `&MyBox<(dyn SomeTrait + 'static)>`
20               found reference `&MyBox<(dyn SomeTrait + 'a)>`
21 note: the lifetime `'a` as defined on the function body at 30:10...
22   --> $DIR/object-lifetime-default-mybox.rs:30:10
23    |
24 LL | fn load2<'a>(ss: &MyBox<dyn SomeTrait + 'a>) -> MyBox<dyn SomeTrait + 'a> {
25    |          ^^
26    = note: ...does not necessarily outlive the static lifetime
27
28 error: aborting due to 2 previous errors
29
30 Some errors have detailed explanations: E0308, E0623.
31 For more information about an error, try `rustc --explain E0308`.