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