From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/unique-object-noncopyable.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/ui/unique-object-noncopyable.rs (limited to 'tests/ui/unique-object-noncopyable.rs') diff --git a/tests/ui/unique-object-noncopyable.rs b/tests/ui/unique-object-noncopyable.rs new file mode 100644 index 000000000..2c40dfc7a --- /dev/null +++ b/tests/ui/unique-object-noncopyable.rs @@ -0,0 +1,25 @@ +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::new(Bar { x: 10 }); + let y: Box = x as Box; + let _z = y.clone(); //~ ERROR the method +} -- cgit v1.2.3