Closed
Description
Meta
rustc 1.15.0-nightly (71c06a56a 2016-12-18)
STR
trait Q<T:?Sized> {}
trait Foo where u32: Q<Self> {
fn foo(&self);
}
impl Q<()> for u32 {}
impl Foo for () {
fn foo(&self) {
println!("foo!");
}
}
fn main() {
let _f: Box<Foo> = Box::new(());
}
Expected Result
Box<Foo>
is not well-formed, because u32: Q<Foo>
does not hold.
Actual Result
Code compiles.
This does not seem to cause any trouble, but is a potential future-compatibility hazard if we start elaborating these bounds.