From cf2dff2b1e3fa55fa5415d524200070d0d7aacfe Mon Sep 17 00:00:00 2001 From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> Date: Thu, 5 Jan 2023 09:13:28 +0100 Subject: Move /src/test to /tests --- .../functional-struct-update-noncopyable.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/ui/functional-struct-update/functional-struct-update-noncopyable.rs (limited to 'tests/ui/functional-struct-update/functional-struct-update-noncopyable.rs') diff --git a/tests/ui/functional-struct-update/functional-struct-update-noncopyable.rs b/tests/ui/functional-struct-update/functional-struct-update-noncopyable.rs new file mode 100644 index 00000000000..a9d7d9c8aa9 --- /dev/null +++ b/tests/ui/functional-struct-update/functional-struct-update-noncopyable.rs @@ -0,0 +1,14 @@ +// issue 7327 + +use std::sync::Arc; + +struct A { y: Arc, x: Arc } + +impl Drop for A { + fn drop(&mut self) { println!("x={}", *self.x); } +} +fn main() { + let a = A { y: Arc::new(1), x: Arc::new(2) }; + let _b = A { y: Arc::new(3), ..a }; //~ ERROR cannot move out of type `A` + let _c = a; +} -- cgit 1.4.1-3-g733a5