]>
Commit | Line | Data |
---|---|---|
74b04a01 XL |
1 | // ignore-test |
2 | ||
3 | // FIXME: This test should fail since, within a const impl of `Foo`, the bound on `Foo::Bar` should | |
4 | // require a const impl of `Add` for the associated type. | |
5 | ||
74b04a01 | 6 | #![feature(const_trait_impl)] |
74b04a01 XL |
7 | |
8 | struct NonConstAdd(i32); | |
9 | ||
10 | impl std::ops::Add for NonConstAdd { | |
11 | type Output = Self; | |
12 | ||
13 | fn add(self, rhs: Self) -> Self { | |
14 | NonConstAdd(self.0 + rhs.0) | |
15 | } | |
16 | } | |
17 | ||
18 | trait Foo { | |
19 | type Bar: std::ops::Add; | |
20 | } | |
21 | ||
22 | impl const Foo for NonConstAdd { | |
23 | type Bar = NonConstAdd; | |
24 | } | |
25 | ||
26 | fn main() {} |