1
1
error[E0310]: the parameter type `T` may not live long enough
2
- --> $DIR/impl_bounds.rs:15 :5
2
+ --> $DIR/impl_bounds.rs:16 :5
3
3
|
4
4
LL | type A<'a> where Self: 'static = (&'a ());
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -8,53 +8,80 @@ LL | type A<'a> where Self: 'static = (&'a ());
8
8
= note: ...so that the type `Fooy<T>` will meet its required lifetime bounds
9
9
10
10
error[E0478]: lifetime bound not satisfied
11
- --> $DIR/impl_bounds.rs:17 :5
11
+ --> $DIR/impl_bounds.rs:18 :5
12
12
|
13
13
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15
15
|
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
18
18
|
19
19
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
20
20
| ^^
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
23
23
|
24
24
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
25
25
| ^^
26
26
27
27
error[E0478]: lifetime bound not satisfied
28
- --> $DIR/impl_bounds.rs:17 :5
28
+ --> $DIR/impl_bounds.rs:18 :5
29
29
|
30
30
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
31
31
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
32
|
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
35
35
|
36
36
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
37
37
| ^^
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
40
40
|
41
41
LL | type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
42
42
| ^^
43
43
44
44
error[E0277]: the trait bound `T: Copy` is not satisfied
45
- --> $DIR/impl_bounds.rs:20 :5
45
+ --> $DIR/impl_bounds.rs:21 :5
46
46
|
47
47
LL | type C where Self: Copy = String;
48
48
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
49
49
|
50
50
= 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`
52
79
help: consider restricting type parameter `T`
53
80
|
54
81
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
55
82
| ^^^^^^^^^^^^^^^^^^^
56
83
57
- error: aborting due to 4 previous errors
84
+ error: aborting due to 5 previous errors
58
85
59
86
Some errors have detailed explanations: E0277, E0310, E0478.
60
87
For more information about an error, try `rustc --explain E0277`.
0 commit comments