Files
rust/tests/ui/traits/object/safety.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
219 B
Rust
Raw Normal View History

// Check that static methods render the trait dyn-incompatible.
2014-12-30 19:03:51 +13:00
trait Tr {
fn foo();
fn bar(&self) { }
2014-12-30 19:03:51 +13:00
}
struct St;
impl Tr for St {
fn foo() {}
}
fn main() {
2019-05-28 14:46:13 -04:00
let _: &dyn Tr = &St; //~ ERROR E0038
2014-12-30 19:03:51 +13:00
}