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