1
Fork 0

Add ignored test for associated types in const impl

This commit is contained in:
Dylan MacKenzie 2020-02-07 11:06:44 -08:00
parent 4992eb2c6f
commit c8f0abb51c

View file

@ -0,0 +1,28 @@
// ignore-test
// FIXME: This test should fail since, within a const impl of `Foo`, the bound on `Foo::Bar` should
// require a const impl of `Add` for the associated type.
#![allow(incomplete_features)]
#![feature(const_trait_impl)]
#![feature(const_fn)]
struct NonConstAdd(i32);
impl std::ops::Add for NonConstAdd {
type Output = Self;
fn add(self, rhs: Self) -> Self {
NonConstAdd(self.0 + rhs.0)
}
}
trait Foo {
type Bar: std::ops::Add;
}
impl const Foo for NonConstAdd {
type Bar = NonConstAdd;
}
fn main() {}