summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/crashes/used_underscore_binding_macro.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/crashes/used_underscore_binding_macro.rs')
-rw-r--r--src/tools/clippy/tests/ui/crashes/used_underscore_binding_macro.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/crashes/used_underscore_binding_macro.rs b/src/tools/clippy/tests/ui/crashes/used_underscore_binding_macro.rs
new file mode 100644
index 000000000..901eb4e50
--- /dev/null
+++ b/src/tools/clippy/tests/ui/crashes/used_underscore_binding_macro.rs
@@ -0,0 +1,16 @@
+use serde::Deserialize;
+
+/// Tests that we do not lint for unused underscores in a `MacroAttribute`
+/// expansion
+#[deny(clippy::used_underscore_binding)]
+#[derive(Deserialize)]
+struct MacroAttributesTest {
+ _foo: u32,
+}
+
+#[test]
+fn macro_attributes_test() {
+ let _ = MacroAttributesTest { _foo: 0 };
+}
+
+fn main() {}