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)
14 type Bar: ~const std::ops::Add;
17 impl const Foo for NonConstAdd {
18 type Bar = NonConstAdd;
19 //~^ ERROR: cannot add `NonConstAdd` to `NonConstAdd` in const contexts
23 type Qux: std::ops::Add;
26 impl const Baz for NonConstAdd {
27 type Qux = NonConstAdd; // OK