]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unique-object-noncopyable.rs
Rollup merge of #69620 - thekuom:doc/61137-add-long-error-code-e0719, r=davidtwco
[rust.git] / src / test / ui / unique-object-noncopyable.rs
1 // FIXME: missing sysroot spans (#53081)
2 // ignore-i586-unknown-linux-gnu
3 // ignore-i586-unknown-linux-musl
4 // ignore-i686-unknown-linux-musl
5 #![feature(box_syntax)]
6
7 trait Foo {
8     fn f(&self);
9 }
10
11 struct Bar {
12     x: isize,
13 }
14
15 impl Drop for Bar {
16     fn drop(&mut self) {}
17 }
18
19 impl Foo for Bar {
20     fn f(&self) {
21         println!("hi");
22     }
23 }
24
25 fn main() {
26     let x = box Bar { x: 10 };
27     let y: Box<dyn Foo> = x as Box<dyn Foo>;
28     let _z = y.clone(); //~ ERROR no method named `clone` found
29 }