#![allow(incomplete_features)] #![feature(non_lifetime_binders)] trait Foo: for Bar {} trait Bar { fn method(&self) {} } struct Type2; fn needs_bar(_: *mut Type2) {} fn main() { let x: &dyn Foo = &(); //~^ ERROR the trait `Foo` is not dyn compatible needs_bar(x); }