]> git.lizzy.rs Git - rust.git/blob - src/test/ui/object-lifetime/object-lifetime-default-elision.stderr
Auto merge of #54349 - GuillaumeGomez:no-example-lint, r=QuietMisdreavus
[rust.git] / src / test / ui / object-lifetime / object-lifetime-default-elision.stderr
1 error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
2   --> $DIR/object-lifetime-default-elision.rs:81:5
3    |
4 LL |     ss
5    |     ^^
6    |
7 note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 64:10...
8   --> $DIR/object-lifetime-default-elision.rs:64:10
9    |
10 LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait {
11    |          ^^
12 note: ...so that reference does not outlive borrowed content
13   --> $DIR/object-lifetime-default-elision.rs:81:5
14    |
15 LL |     ss
16    |     ^^
17 note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 64:13...
18   --> $DIR/object-lifetime-default-elision.rs:64:13
19    |
20 LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait {
21    |             ^^
22    = note: ...so that the expression is assignable:
23            expected &'b (dyn SomeTrait + 'b)
24               found &dyn SomeTrait
25
26 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
27   --> $DIR/object-lifetime-default-elision.rs:81:5
28    |
29 LL |     ss
30    |     ^^
31    |
32 note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 64:10...
33   --> $DIR/object-lifetime-default-elision.rs:64:10
34    |
35 LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait {
36    |          ^^
37 note: ...so that the declared lifetime parameter bounds are satisfied
38   --> $DIR/object-lifetime-default-elision.rs:81:5
39    |
40 LL |     ss
41    |     ^^
42 note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 64:13...
43   --> $DIR/object-lifetime-default-elision.rs:64:13
44    |
45 LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait {
46    |             ^^
47    = note: ...so that the expression is assignable:
48            expected &'b (dyn SomeTrait + 'b)
49               found &dyn SomeTrait
50
51 error: aborting due to 2 previous errors
52
53 For more information about this error, try `rustc --explain E0495`.