11error[E0310]: the parameter type `T` may not live long enough
2- --> $DIR/impl_bounds.rs:15 :5
2+ --> $DIR/impl_bounds.rs:16 :5
33 |
44LL | type A<'a> where Self: 'static = (&'a ());
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,53 +8,80 @@ LL | type A<'a> where Self: 'static = (&'a ());
88 = note: ...so that the type `Fooy<T>` will meet its required lifetime bounds
99
1010error[E0478]: lifetime bound not satisfied
11- --> $DIR/impl_bounds.rs:17 :5
11+ --> $DIR/impl_bounds.rs:18 :5
1212 |
1313LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515 |
16- note: lifetime parameter instantiated with the lifetime `'b` as defined on the associated item at 17 :16
17- --> $DIR/impl_bounds.rs:17 :16
16+ note: lifetime parameter instantiated with the lifetime `'b` as defined on the associated item at 18 :16
17+ --> $DIR/impl_bounds.rs:18 :16
1818 |
1919LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
2020 | ^^
21- note: but lifetime parameter must outlive the lifetime `'a` as defined on the associated item at 17 :12
22- --> $DIR/impl_bounds.rs:17 :12
21+ note: but lifetime parameter must outlive the lifetime `'a` as defined on the associated item at 18 :12
22+ --> $DIR/impl_bounds.rs:18 :12
2323 |
2424LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
2525 | ^^
2626
2727error[E0478]: lifetime bound not satisfied
28- --> $DIR/impl_bounds.rs:17 :5
28+ --> $DIR/impl_bounds.rs:18 :5
2929 |
3030LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
3131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232 |
33- note: lifetime parameter instantiated with the lifetime `'a` as defined on the associated item at 17 :12
34- --> $DIR/impl_bounds.rs:17 :12
33+ note: lifetime parameter instantiated with the lifetime `'a` as defined on the associated item at 18 :12
34+ --> $DIR/impl_bounds.rs:18 :12
3535 |
3636LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
3737 | ^^
38- note: but lifetime parameter must outlive the lifetime `'b` as defined on the associated item at 17 :16
39- --> $DIR/impl_bounds.rs:17 :16
38+ note: but lifetime parameter must outlive the lifetime `'b` as defined on the associated item at 18 :16
39+ --> $DIR/impl_bounds.rs:18 :16
4040 |
4141LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
4242 | ^^
4343
4444error[E0277]: the trait bound `T: Copy` is not satisfied
45- --> $DIR/impl_bounds.rs:20 :5
45+ --> $DIR/impl_bounds.rs:21 :5
4646 |
4747LL | type C where Self: Copy = String;
4848 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
4949 |
5050 = note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
51- = note: the requirement `Fooy<T>: Copy` appears on the associated impl type but not on the corresponding associated trait type
51+ note: the requirement `Fooy<T>: Copy` appears on the associated impl type `C` but not on the corresponding associated trait type
52+ --> $DIR/impl_bounds.rs:8:5
53+ |
54+ LL | trait Foo {
55+ | --- in this trait
56+ ...
57+ LL | type C where Self: Clone;
58+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ this trait associated type doesn't have the requirement `Fooy<T>: Copy`
59+ help: consider restricting type parameter `T`
60+ |
61+ LL | impl<T: Copy> Foo for Fooy<T> {
62+ | ^^^^^^
63+
64+ error[E0277]: the trait bound `T: Copy` is not satisfied
65+ --> $DIR/impl_bounds.rs:23:5
66+ |
67+ LL | fn d() where Self: Copy {}
68+ | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
69+ |
70+ = note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
71+ note: the requirement `Fooy<T>: Copy` appears on the impl method `d` but not on the corresponding trait method
72+ --> $DIR/impl_bounds.rs:9:8
73+ |
74+ LL | trait Foo {
75+ | --- in this trait
76+ ...
77+ LL | fn d() where Self: Clone;
78+ | ^ this trait method doesn't have the requirement `Fooy<T>: Copy`
5279help: consider restricting type parameter `T`
5380 |
5481LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
5582 | ^^^^^^^^^^^^^^^^^^^
5683
57- error: aborting due to 4 previous errors
84+ error: aborting due to 5 previous errors
5885
5986Some errors have detailed explanations: E0277, E0310, E0478.
6087For more information about an error, try `rustc --explain E0277`.
0 commit comments