summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs
new file mode 100644
index 000000000..f2fb62d76
--- /dev/null
+++ b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs
@@ -0,0 +1,7 @@
+// Test ensuring that `dbg!(expr)` requires the passed type to implement `Debug`.
+
+struct NotDebug;
+
+fn main() {
+ let _: NotDebug = dbg!(NotDebug); //~ ERROR `NotDebug` doesn't implement `Debug`
+}