]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/defaults-in-other-trait-items.stderr
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / associated-types / defaults-in-other-trait-items.stderr
1 error[E0308]: mismatched types
2   --> $DIR/defaults-in-other-trait-items.rs:9:13
3    |
4 LL |     type A = ();
5    |     ------------ associated type defaults can't be assumed inside the trait defining them
6 ...
7 LL |         let () = p;
8    |             ^^   - this expression has type `<Self as Tr>::A`
9    |             |
10    |             expected associated type, found `()`
11    |
12    = note: expected associated type `<Self as Tr>::A`
13                     found unit type `()`
14
15 error[E0308]: mismatched types
16   --> $DIR/defaults-in-other-trait-items.rs:36:25
17    |
18 LL |     type Ty = u8;
19    |     ------------- associated type defaults can't be assumed inside the trait defining them
20 ...
21 LL |     const C: Self::Ty = 0u8;
22    |                         ^^^ expected associated type, found `u8`
23    |
24    = note: expected associated type `<Self as AssocConst>::Ty`
25                          found type `u8`
26
27 error: aborting due to 2 previous errors
28
29 For more information about this error, try `rustc --explain E0308`.