]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr
Rollup merge of #67055 - lqd:const_qualif, r=oli-obk
[rust.git] / src / test / ui / regions / regions-close-over-type-parameter-multiple.stderr
1 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
2   --> $DIR/regions-close-over-type-parameter-multiple.rs:20:5
3    |
4 LL |     box v as Box<dyn SomeTrait + 'a>
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 18:20...
8   --> $DIR/regions-close-over-type-parameter-multiple.rs:18:20
9    |
10 LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
11    |                    ^^
12 note: ...so that the declared lifetime parameter bounds are satisfied
13   --> $DIR/regions-close-over-type-parameter-multiple.rs:20:5
14    |
15 LL |     box v as Box<dyn SomeTrait + 'a>
16    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 note: but, the lifetime must be valid for the lifetime `'c` as defined on the function body at 18:26...
18   --> $DIR/regions-close-over-type-parameter-multiple.rs:18:26
19    |
20 LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait + 'c> {
21    |                          ^^
22 note: ...so that the expression is assignable
23   --> $DIR/regions-close-over-type-parameter-multiple.rs:20:5
24    |
25 LL |     box v as Box<dyn SomeTrait + 'a>
26    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27    = note: expected  `std::boxed::Box<(dyn SomeTrait + 'c)>`
28               found  `std::boxed::Box<dyn SomeTrait>`
29
30 error: aborting due to previous error
31
32 For more information about this error, try `rustc --explain E0495`.