]> git.lizzy.rs Git - rust.git/blob - src/test/ui/object-safety/object-safety-by-value-self-use.rs
move an `assert!` to the right place
[rust.git] / src / test / ui / object-safety / object-safety-by-value-self-use.rs
1 // Check that while a trait with by-value self is object-safe, we
2 // can't actually invoke it from an object (yet...?).
3
4 #![feature(rustc_attrs)]
5
6 trait Bar {
7     fn bar(self);
8 }
9
10 trait Baz {
11     fn baz(self: Self);
12 }
13
14 fn use_bar(t: Box<dyn Bar>) {
15     t.bar() //~ ERROR cannot move a value of type `dyn Bar`
16 }
17
18 fn main() { }