blob: bbdfebe1577c7e65c7f2d7171b2fa6f26589b254 [file] [log] [blame]
trait Trait {
fn exists(self) -> ();
fn not_object_safe() -> Self;
}
impl Trait for () {
fn exists(self) -> () {
}
fn not_object_safe() -> Self {
()
}
}
fn main() {
// object-safe or not, this call is OK
Trait::exists(());
// no object safety error
Trait::nonexistent(());
//~^ ERROR no function or associated item named `nonexistent` found for type `dyn Trait`
}