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