rust/tests/ui/traits/object/safety.rs
2023-01-11 09:32:08 +00:00

18 lines
226 B
Rust

// Check that static methods are not object-safe.
trait Tr {
fn foo();
fn bar(&self) { }
}
struct St;
impl Tr for St {
fn foo() {}
}
fn main() {
let _: &dyn Tr = &St; //~ ERROR E0038
//~^ ERROR E0038
}