]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/crashes/inherent_impl.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / crashes / inherent_impl.rs
diff --git a/src/tools/clippy/tests/ui/crashes/inherent_impl.rs b/src/tools/clippy/tests/ui/crashes/inherent_impl.rs
new file mode 100644 (file)
index 0000000..aeb27b5
--- /dev/null
@@ -0,0 +1,26 @@
+#![deny(clippy::multiple_inherent_impl)]
+
+/// Test for https://github.com/rust-lang/rust-clippy/issues/4578
+
+macro_rules! impl_foo {
+    ($struct:ident) => {
+        impl $struct {
+            fn foo() {}
+        }
+    };
+}
+
+macro_rules! impl_bar {
+    ($struct:ident) => {
+        impl $struct {
+            fn bar() {}
+        }
+    };
+}
+
+struct MyStruct;
+
+impl_foo!(MyStruct);
+impl_bar!(MyStruct);
+
+fn main() {}