mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +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
|
|
}
|