]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/impl_bounds.stderr
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / generic-associated-types / impl_bounds.stderr
1 error[E0310]: the parameter type `T` may not live long enough
2   --> $DIR/impl_bounds.rs:15:5
3    |
4 LL |     type A<'a> where Self: 'static = (&'a ());
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = help: consider adding an explicit lifetime bound `T: 'static`...
8    = note: ...so that the type `Fooy<T>` will meet its required lifetime bounds
9
10 error[E0478]: lifetime bound not satisfied
11   --> $DIR/impl_bounds.rs:17:5
12    |
13 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
14    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
18    |
19 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
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
23    |
24 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
25    |            ^^
26
27 error[E0478]: lifetime bound not satisfied
28   --> $DIR/impl_bounds.rs:17:5
29    |
30 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
35    |
36 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
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
40    |
41 LL |     type B<'a, 'b> where 'b: 'a = (&'a(), &'b ());
42    |                ^^
43
44 error[E0277]: the trait bound `T: Copy` is not satisfied
45   --> $DIR/impl_bounds.rs:20:5
46    |
47 LL |     type C where Self: Copy = String;
48    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
49    |
50 note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
51   --> $DIR/impl_bounds.rs:11:10
52    |
53 LL | #[derive(Copy, Clone)]
54    |          ^^^^
55 note: the requirement `Fooy<T>: Copy` appears on the associated impl type `C` but not on the corresponding associated trait type
56   --> $DIR/impl_bounds.rs:7:5
57    |
58 LL | trait Foo {
59    |       --- in this trait
60 ...
61 LL |     type C where Self: Clone;
62    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ this trait associated type doesn't have the requirement `Fooy<T>: Copy`
63    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
64 help: consider restricting type parameter `T`
65    |
66 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
67    |       ^^^^^^^^^^^^^^^^^^^
68
69 error[E0277]: the trait bound `T: Copy` is not satisfied
70   --> $DIR/impl_bounds.rs:22:5
71    |
72 LL |     fn d() where Self: Copy {}
73    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
74    |
75 note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
76   --> $DIR/impl_bounds.rs:11:10
77    |
78 LL | #[derive(Copy, Clone)]
79    |          ^^^^
80 note: the requirement `Fooy<T>: Copy` appears on the impl method `d` but not on the corresponding trait method
81   --> $DIR/impl_bounds.rs:8:8
82    |
83 LL | trait Foo {
84    |       --- in this trait
85 ...
86 LL |     fn d() where Self: Clone;
87    |        ^ this trait method doesn't have the requirement `Fooy<T>: Copy`
88    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
89 help: consider restricting type parameter `T`
90    |
91 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
92    |       ^^^^^^^^^^^^^^^^^^^
93
94 error: aborting due to 5 previous errors
95
96 Some errors have detailed explanations: E0277, E0310, E0478.
97 For more information about an error, try `rustc --explain E0277`.