2015-02-23 14:27:55 -06:00
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
fn use_bar(t: Box<dyn Bar>) {
|
2022-06-22 23:43:01 -05:00
|
|
|
t.bar() //~ ERROR cannot move a value of type `dyn Bar`
|
2015-02-23 14:27:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|