summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/inherent_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/crashes/inherent_impl.rs')
-rw-r--r--src/tools/clippy/tests/ui/crashes/inherent_impl.rs26
1 files changed, 26 insertions, 0 deletions
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
index 000000000..aeb27b5ba
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/inherent_impl.rs
@@ -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() {}