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