]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/defaults-specialization.stderr
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / associated-types / defaults-specialization.stderr
1 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
2   --> $DIR/defaults-specialization.rs:3:38
3    |
4 LL | #![feature(associated_type_defaults, specialization)]
5    |                                      ^^^^^^^^^^^^^^
6    |
7    = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
8    = help: consider using `min_specialization` instead, which is more stable and complete
9    = note: `#[warn(incomplete_features)]` on by default
10
11 error[E0053]: method `make` has an incompatible type for trait
12   --> $DIR/defaults-specialization.rs:19:18
13    |
14 LL |     fn make() -> u8 { 0 }
15    |                  ^^
16    |                  |
17    |                  expected associated type, found `u8`
18    |                  help: change the output type to match the trait: `<A<T> as Tr>::Ty`
19    |
20 note: type in trait
21   --> $DIR/defaults-specialization.rs:9:18
22    |
23 LL |     fn make() -> Self::Ty {
24    |                  ^^^^^^^^
25    = note: expected signature `fn() -> <A<T> as Tr>::Ty`
26               found signature `fn() -> u8`
27
28 error[E0053]: method `make` has an incompatible type for trait
29   --> $DIR/defaults-specialization.rs:35:18
30    |
31 LL |     default type Ty = bool;
32    |     ----------------------- expected this associated type
33 LL |
34 LL |     fn make() -> bool { true }
35    |                  ^^^^
36    |                  |
37    |                  expected associated type, found `bool`
38    |                  help: change the output type to match the trait: `<B<T> as Tr>::Ty`
39    |
40 note: type in trait
41   --> $DIR/defaults-specialization.rs:9:18
42    |
43 LL |     fn make() -> Self::Ty {
44    |                  ^^^^^^^^
45    = note: expected signature `fn() -> <B<T> as Tr>::Ty`
46               found signature `fn() -> bool`
47
48 error[E0308]: mismatched types
49   --> $DIR/defaults-specialization.rs:10:9
50    |
51 LL |     type Ty = u8;
52    |     ------------- associated type defaults can't be assumed inside the trait defining them
53 LL |
54 LL |     fn make() -> Self::Ty {
55    |                  -------- expected `<Self as Tr>::Ty` because of return type
56 LL |         0u8
57    |         ^^^ expected associated type, found `u8`
58    |
59    = note: expected associated type `<Self as Tr>::Ty`
60                          found type `u8`
61
62 error[E0308]: mismatched types
63   --> $DIR/defaults-specialization.rs:26:29
64    |
65 LL |     fn make() -> Self::Ty { 0u8 }
66    |                  --------   ^^^ expected associated type, found `u8`
67    |                  |
68    |                  expected `<A2<T> as Tr>::Ty` because of return type
69    |
70    = note: expected associated type `<A2<T> as Tr>::Ty`
71                          found type `u8`
72    = help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
73    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
74
75 error[E0308]: mismatched types
76   --> $DIR/defaults-specialization.rs:44:29
77    |
78 LL |     default type Ty = bool;
79    |     ----------------------- expected this associated type
80 LL |
81 LL |     fn make() -> Self::Ty { true }
82    |                  --------   ^^^^ expected associated type, found `bool`
83    |                  |
84    |                  expected `<B2<T> as Tr>::Ty` because of return type
85    |
86    = note: expected associated type `<B2<T> as Tr>::Ty`
87                          found type `bool`
88
89 error[E0308]: mismatched types
90   --> $DIR/defaults-specialization.rs:87:32
91    |
92 LL |     let _: <B<()> as Tr>::Ty = 0u8;
93    |            -----------------   ^^^ expected associated type, found `u8`
94    |            |
95    |            expected due to this
96    |
97    = note: expected associated type `<B<()> as Tr>::Ty`
98                          found type `u8`
99 help: a method is available that returns `<B<()> as Tr>::Ty`
100   --> $DIR/defaults-specialization.rs:9:5
101    |
102 LL |     fn make() -> Self::Ty {
103    |     ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
104
105 error[E0308]: mismatched types
106   --> $DIR/defaults-specialization.rs:88:32
107    |
108 LL |     let _: <B<()> as Tr>::Ty = true;
109    |            -----------------   ^^^^ expected associated type, found `bool`
110    |            |
111    |            expected due to this
112    |
113    = note: expected associated type `<B<()> as Tr>::Ty`
114                          found type `bool`
115 help: a method is available that returns `<B<()> as Tr>::Ty`
116   --> $DIR/defaults-specialization.rs:9:5
117    |
118 LL |     fn make() -> Self::Ty {
119    |     ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
120
121 error[E0308]: mismatched types
122   --> $DIR/defaults-specialization.rs:89:33
123    |
124 LL |     let _: <B2<()> as Tr>::Ty = 0u8;
125    |            ------------------   ^^^ expected associated type, found `u8`
126    |            |
127    |            expected due to this
128    |
129    = note: expected associated type `<B2<()> as Tr>::Ty`
130                          found type `u8`
131 help: a method is available that returns `<B2<()> as Tr>::Ty`
132   --> $DIR/defaults-specialization.rs:9:5
133    |
134 LL |     fn make() -> Self::Ty {
135    |     ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
136
137 error[E0308]: mismatched types
138   --> $DIR/defaults-specialization.rs:90:33
139    |
140 LL |     let _: <B2<()> as Tr>::Ty = true;
141    |            ------------------   ^^^^ expected associated type, found `bool`
142    |            |
143    |            expected due to this
144    |
145    = note: expected associated type `<B2<()> as Tr>::Ty`
146                          found type `bool`
147 help: a method is available that returns `<B2<()> as Tr>::Ty`
148   --> $DIR/defaults-specialization.rs:9:5
149    |
150 LL |     fn make() -> Self::Ty {
151    |     ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
152
153 error: aborting due to 9 previous errors; 1 warning emitted
154
155 Some errors have detailed explanations: E0053, E0308.
156 For more information about an error, try `rustc --explain E0053`.