summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs')
-rw-r--r--tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs
new file mode 100644
index 000000000..9f3c567b6
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs
@@ -0,0 +1,10 @@
+// Test ensuring that `dbg!(expr)` will take ownership of the argument.
+
+#[derive(Debug)]
+struct NoCopy(usize);
+
+fn main() {
+ let a = NoCopy(0);
+ let _ = dbg!(a);
+ let _ = dbg!(a); //~ ERROR use of moved value
+}