]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unique-object-noncopyable.rs
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
[rust.git] / src / test / ui / unique-object-noncopyable.rs
1 #![feature(box_syntax)]
2
3 trait Foo {
4     fn f(&self);
5 }
6
7 struct Bar {
8     x: isize,
9 }
10
11 impl Drop for Bar {
12     fn drop(&mut self) {}
13 }
14
15 impl Foo for Bar {
16     fn f(&self) {
17         println!("hi");
18     }
19 }
20
21 fn main() {
22     let x = box Bar { x: 10 };
23     let y: Box<dyn Foo> = x as Box<dyn Foo>;
24     let _z = y.clone(); //~ ERROR no method named `clone` found
25 }