1 #![feature(const_trait_impl)]
3 struct NonConstAdd(i32);
5 impl std::ops::Add for NonConstAdd {
8 fn add(self, rhs: Self) -> Self {
9 NonConstAdd(self.0 + rhs.0)
15 type Bar: ~const std::ops::Add;
18 impl const Foo for NonConstAdd {
19 type Bar = NonConstAdd;
20 //~^ ERROR: cannot add `NonConstAdd` to `NonConstAdd` in const contexts
25 type Qux: std::ops::Add;
28 impl const Baz for NonConstAdd {
29 type Qux = NonConstAdd; // OK