rust/src/test/ui/traits/trait-object-safety.rs

18 lines
222 B
Rust
Raw Normal View History

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