]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/type-alias-free-regions.stderr
Rollup merge of #67055 - lqd:const_qualif, r=oli-obk
[rust.git] / src / test / ui / nll / type-alias-free-regions.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2   --> $DIR/type-alias-free-regions.rs:17:9
3    |
4 LL |         C { f: b }
5    |         ^
6    |
7 note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5...
8   --> $DIR/type-alias-free-regions.rs:16:5
9    |
10 LL | /     fn from_box(b: Box<B>) -> Self {
11 LL | |         C { f: b }
12 LL | |     }
13    | |_____^
14 note: ...so that the expression is assignable
15   --> $DIR/type-alias-free-regions.rs:17:16
16    |
17 LL |         C { f: b }
18    |                ^
19    = note: expected  `std::boxed::Box<std::boxed::Box<&isize>>`
20               found  `std::boxed::Box<std::boxed::Box<&isize>>`
21 note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6...
22   --> $DIR/type-alias-free-regions.rs:15:6
23    |
24 LL | impl<'a> FromBox<'a> for C<'a> {
25    |      ^^
26 note: ...so that the expression is assignable
27   --> $DIR/type-alias-free-regions.rs:17:9
28    |
29 LL |         C { f: b }
30    |         ^^^^^^^^^^
31    = note: expected  `C<'a>`
32               found  `C<'_>`
33
34 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
35   --> $DIR/type-alias-free-regions.rs:27:16
36    |
37 LL |         C { f: Box::new(b.0) }
38    |                ^^^^^^^^^^^^^
39    |
40 note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 26:5...
41   --> $DIR/type-alias-free-regions.rs:26:5
42    |
43 LL | /     fn from_tuple(b: (B,)) -> Self {
44 LL | |         C { f: Box::new(b.0) }
45 LL | |     }
46    | |_____^
47 note: ...so that the expression is assignable
48   --> $DIR/type-alias-free-regions.rs:27:25
49    |
50 LL |         C { f: Box::new(b.0) }
51    |                         ^^^
52    = note: expected  `std::boxed::Box<&isize>`
53               found  `std::boxed::Box<&isize>`
54 note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6...
55   --> $DIR/type-alias-free-regions.rs:25:6
56    |
57 LL | impl<'a> FromTuple<'a> for C<'a> {
58    |      ^^
59 note: ...so that the expression is assignable
60   --> $DIR/type-alias-free-regions.rs:27:9
61    |
62 LL |         C { f: Box::new(b.0) }
63    |         ^^^^^^^^^^^^^^^^^^^^^^
64    = note: expected  `C<'a>`
65               found  `C<'_>`
66
67 error: aborting due to 2 previous errors
68
69 For more information about this error, try `rustc --explain E0495`.