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