]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/impl_bounds.stderr
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / 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 help: copy the `where` clause predicates from the trait
20    |
21 LL |     type B<'a, 'b> = (&'a(), &'b ()) where 'a: 'b;
22    |                                      ~~~~~~~~~~~~
23
24 error[E0277]: the trait bound `T: Copy` is not satisfied
25   --> $DIR/impl_bounds.rs:18:33
26    |
27 LL |     type C = String where Self: Copy;
28    |                                 ^^^^ the trait `Copy` is not implemented for `T`
29    |
30 note: required for `Fooy<T>` to implement `Copy`
31   --> $DIR/impl_bounds.rs:10:10
32    |
33 LL | #[derive(Copy, Clone)]
34    |          ^^^^ unsatisfied trait bound introduced in this `derive` macro
35 note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type
36   --> $DIR/impl_bounds.rs:6:10
37    |
38 LL | trait Foo {
39    |       --- in this trait
40 ...
41 LL |     type C where Self: Clone;
42    |          ^ this trait's associated type doesn't have the requirement `Fooy<T>: Copy`
43    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
44 help: consider restricting type parameter `T`
45    |
46 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
47    |       +++++++++++++++++++
48
49 error[E0277]: the trait bound `T: Copy` is not satisfied
50   --> $DIR/impl_bounds.rs:20:24
51    |
52 LL |     fn d() where Self: Copy {}
53    |                        ^^^^ the trait `Copy` is not implemented for `T`
54    |
55 note: required for `Fooy<T>` to implement `Copy`
56   --> $DIR/impl_bounds.rs:10:10
57    |
58 LL | #[derive(Copy, Clone)]
59    |          ^^^^ unsatisfied trait bound introduced in this `derive` macro
60 note: the requirement `Fooy<T>: Copy` appears on the `impl`'s method `d` but not on the corresponding trait's method
61   --> $DIR/impl_bounds.rs:7:8
62    |
63 LL | trait Foo {
64    |       --- in this trait
65 ...
66 LL |     fn d() where Self: Clone;
67    |        ^ this trait's method doesn't have the requirement `Fooy<T>: Copy`
68    = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
69 help: consider restricting type parameter `T`
70    |
71 LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
72    |       +++++++++++++++++++
73
74 error: aborting due to 4 previous errors
75
76 Some errors have detailed explanations: E0276, E0277.
77 For more information about an error, try `rustc --explain E0276`.