mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
19 lines
326 B
Rust
19 lines
326 B
Rust
// Check that while a trait with by-value self is object-safe, we
|
|
// can't actually invoke it from an object (yet...?).
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
trait Bar {
|
|
fn bar(self);
|
|
}
|
|
|
|
trait Baz {
|
|
fn baz(self: Self);
|
|
}
|
|
|
|
fn use_bar(t: Box<dyn Bar>) {
|
|
t.bar() //~ ERROR cannot move a value of type `dyn Bar`
|
|
}
|
|
|
|
fn main() { }
|