mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
18 lines
226 B
Rust
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
|
|
}
|