]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-26681.rs
Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup
[rust.git] / src / test / ui / associated-types / issue-26681.rs
1 #![feature(associated_type_defaults)]
2
3 // This is a partial regression test for #26681, which used to fail to resolve
4 // `Self` in the assoc. constant, and now fails with a type mismatch because
5 // `Self::Fv` cannot be assumed to equal `u8` inside the trait.
6
7 trait Foo {
8     type Bar;
9 }
10
11 impl Foo for u8 {
12     type Bar = ();
13 }
14
15 trait Baz {
16     type Fv: Foo = u8;
17     const C: <Self::Fv as Foo>::Bar = 6665;  //~ error: mismatched types
18 }
19
20 fn main() {}