summaryrefslogtreecommitdiff
path: root/src/tools/clippy/tests/ui/items_after_test_module/block_module.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/items_after_test_module/block_module.rs')
-rw-r--r--src/tools/clippy/tests/ui/items_after_test_module/block_module.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/items_after_test_module/block_module.rs b/src/tools/clippy/tests/ui/items_after_test_module/block_module.rs
new file mode 100644
index 00000000000..5136b2557ec
--- /dev/null
+++ b/src/tools/clippy/tests/ui/items_after_test_module/block_module.rs
@@ -0,0 +1,23 @@
+//@compile-flags: --test
+#![allow(unused)]
+#![warn(clippy::items_after_test_module)]
+
+fn main() {}
+
+fn should_not_lint() {}
+
+#[allow(dead_code)]
+#[allow(unused)] // Some attributes to check that span replacement is good enough
+#[allow(clippy::allow_attributes)]
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn hi() {}
+}
+
+fn should_lint() {}
+
+const SHOULD_ALSO_LINT: usize = 1;
+macro_rules! should_not_lint {
+ () => {};
+}