about summary refs log tree commit diff
path: root/tests/ui/dyn-compatibility/by-value-self-use.rs
blob: 3c04ec0cd888c584fd3da8ffdce8f4e77e8f8d10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Check that while a trait with by-value self is dyn-compatible, 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() { }