]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/impl_bounds.stderr
Rollup merge of #102954 - GuillaumeGomez:cfg-hide-attr-checks, r=Manishearth
[rust.git] / src / test / ui / generic-associated-types / impl_bounds.stderr
1 error[E0276]: impl has stricter requirements than trait
2   --> $DIR/impl_bounds.rs:14:39
3    |
4 LL |     type A<'a> where Self: 'a;
5    |     ---------- definition of `A` from trait
6 ...
7 LL |     type A<'a> = (&'a ()) where Self: 'static;
8    |                                       ^^^^^^^ impl has extra requirement `T: 'static`
9
10 error[E0276]: impl has stricter requirements than trait
11   --> $DIR/impl_bounds.rs:16:48
12    |
13 LL |     type B<'a, 'b> where 'a: 'b;
14    |     -------------- definition of `B` from trait
15 ...
16 LL |     type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
17    |                                                ^^ impl has extra requirement `'b: 'a`
18
19 error[E0478]: lifetime bound not satisfied
20   --> $DIR/impl_bounds.rs:16:22
21    |
22 LL |     type B<'a, 'b> where 'a: 'b;
23    |     -------------- definition of `B` from trait
24 ...
25 LL |     type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
26    |                      ^^^^^^^^^^^^^^^             - help: try copying this clause from the trait: `, 'a: 'b`
27    |
28 note: lifetime parameter instantiated with the lifetime `'a` as defined here
29   --> $DIR/impl_bounds.rs:16:12
30    |
31 LL |     type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
32    |            ^^
33 note: but lifetime parameter must outlive the lifetime `'b` as defined here
34   --> $DIR/impl_bounds.rs:16:16
35    |
36 LL |     type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
37    |                ^^
38
39 error[E0277]: the trait bound `T: Copy` is not satisfied
40   --> $DIR/impl_bounds.rs:19:33
41    |
42 LL |     type C = String where Self: Copy;
43    |                                 ^^^^ the trait `Copy` is not implemented for `T`
44    |
45 note: required for `Fooy<T>` to implement `Copy`
46   --> $DIR/impl_bounds.rs:10:10
47    |
48 LL | #[derive(Copy, Clone)]
49    |          ^^^^
50 note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type
51   --> $DIR/impl_bounds.rs:6:10
52    |
53 LL | trait Foo {
54    |       --- in this trait
55 ...
56 LL |     type C where Self: Clone;
57    |          ^ this trait's associated type doesn't have the requirement `Fooy<T>: Copy`
58    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
59 help: consider restricting type parameter `T`
60    |
61 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
62    |       +++++++++++++++++++
63
64 error[E0277]: the trait bound `T: Copy` is not satisfied
65   --> $DIR/impl_bounds.rs:21:24
66    |
67 LL |     fn d() where Self: Copy {}
68    |                        ^^^^ the trait `Copy` is not implemented for `T`
69    |
70 note: required for `Fooy<T>` to implement `Copy`
71   --> $DIR/impl_bounds.rs:10:10
72    |
73 LL | #[derive(Copy, Clone)]
74    |          ^^^^
75 note: the requirement `Fooy<T>: Copy` appears on the `impl`'s method `d` but not on the corresponding trait's method
76   --> $DIR/impl_bounds.rs:7:8
77    |
78 LL | trait Foo {
79    |       --- in this trait
80 ...
81 LL |     fn d() where Self: Clone;
82    |        ^ this trait's method doesn't have the requirement `Fooy<T>: Copy`
83    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
84 help: consider restricting type parameter `T`
85    |
86 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
87    |       +++++++++++++++++++
88
89 error: aborting due to 5 previous errors
90
91 Some errors have detailed explanations: E0276, E0277, E0478.
92 For more information about an error, try `rustc --explain E0276`.