about summary refs log tree commit diff
path: root/tests/ui/lint/missing-debug-implementations-lint.rs
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-06-28 22:57:01 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-06-28 23:12:32 +0500
commit3d81af8c55cd422910c4560f6cdc03722f4530c7 (patch)
tree9797ed5a4827f3b016111ad78675b02944893d37 /tests/ui/lint/missing-debug-implementations-lint.rs
parent7ba34c704529e7fcab80130c3fe40efe415d61b5 (diff)
downloadrust-3d81af8c55cd422910c4560f6cdc03722f4530c7.tar.gz
rust-3d81af8c55cd422910c4560f6cdc03722f4530c7.zip
moved tests
Diffstat (limited to 'tests/ui/lint/missing-debug-implementations-lint.rs')
-rw-r--r--tests/ui/lint/missing-debug-implementations-lint.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/lint/missing-debug-implementations-lint.rs b/tests/ui/lint/missing-debug-implementations-lint.rs
new file mode 100644
index 00000000000..3abc0706887
--- /dev/null
+++ b/tests/ui/lint/missing-debug-implementations-lint.rs
@@ -0,0 +1,38 @@
+//@ compile-flags: --crate-type lib
+#![deny(missing_debug_implementations)]
+#![allow(unused)]
+
+use std::fmt;
+
+pub enum A {} //~ ERROR type does not implement `Debug`
+
+#[derive(Debug)]
+pub enum B {}
+
+pub enum C {}
+
+impl fmt::Debug for C {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        Ok(())
+    }
+}
+
+pub struct Foo; //~ ERROR type does not implement `Debug`
+
+#[derive(Debug)]
+pub struct Bar;
+
+pub struct Baz;
+
+impl fmt::Debug for Baz {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        Ok(())
+    }
+}
+
+struct PrivateStruct;
+
+enum PrivateEnum {}
+
+#[derive(Debug)]
+pub struct GenericType<T>(T);