From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/copy-a-resource.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/ui/copy-a-resource.rs (limited to 'tests/ui/copy-a-resource.rs') diff --git a/tests/ui/copy-a-resource.rs b/tests/ui/copy-a-resource.rs new file mode 100644 index 000000000..55f2dd4ee --- /dev/null +++ b/tests/ui/copy-a-resource.rs @@ -0,0 +1,21 @@ +#[derive(Debug)] +struct Foo { + i: isize, +} + +impl Drop for Foo { + fn drop(&mut self) {} +} + +fn foo(i:isize) -> Foo { + Foo { + i: i + } +} + +fn main() { + let x = foo(10); + let _y = x.clone(); + //~^ ERROR no method named `clone` found + println!("{:?}", x); +} -- cgit v1.2.3