summary refs log tree commit diff
path: root/src/test/ui/unique-object-noncopyable.rs
blob: dd38a7190aa0e9d83b71c686a619097e7ff68404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#![feature(box_syntax)]

trait Foo {
    fn f(&self);
}

struct Bar {
    x: isize,
}

impl Drop for Bar {
    fn drop(&mut self) {}
}

impl Foo for Bar {
    fn f(&self) {
        println!("hi");
    }
}

fn main() {
    let x = box Bar { x: 10 };
    let y: Box<dyn Foo> = x as Box<dyn Foo>;
    let _z = y.clone(); //~ ERROR no method named `clone` found
}