]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / regions / regions-assoc-type-region-bound-in-trait-not-met.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10
3    |
4 LL | impl<'a> Foo<'static> for &'a i32 {
5    |          ^^^^^^^^^^^^
6    |
7 note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 14:6...
8   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:6
9    |
10 LL | impl<'a> Foo<'static> for &'a i32 {
11    |      ^^
12    = note: ...so that the types are compatible:
13            expected Foo<'static>
14               found Foo<'static>
15    = note: but, the lifetime must be valid for the static lifetime...
16 note: ...so that the type `&i32` will meet its required lifetime bounds
17   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10
18    |
19 LL | impl<'a> Foo<'static> for &'a i32 {
20    |          ^^^^^^^^^^^^
21
22 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
23   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:13
24    |
25 LL | impl<'a,'b> Foo<'b> for &'a i64 {
26    |             ^^^^^^^
27    |
28 note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 19:6...
29   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:6
30    |
31 LL | impl<'a,'b> Foo<'b> for &'a i64 {
32    |      ^^
33    = note: ...so that the types are compatible:
34            expected Foo<'b>
35               found Foo<'_>
36 note: but, the lifetime must be valid for the lifetime 'b as defined on the impl at 19:9...
37   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9
38    |
39 LL | impl<'a,'b> Foo<'b> for &'a i64 {
40    |         ^^
41 note: ...so that the type `&i32` will meet its required lifetime bounds
42   --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:13
43    |
44 LL | impl<'a,'b> Foo<'b> for &'a i64 {
45    |             ^^^^^^^
46
47 error: aborting due to 2 previous errors
48
49 For more information about this error, try `rustc --explain E0495`.