about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-06-26 13:00:51 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2024-07-06 15:36:30 +0300
commit83cf471361ed8e5d07111312a80b29b6ecb3290b (patch)
tree19c5435f5c007cc8d661de2f65509ee86befd84d /tests/ui
parent28cc0b643d6c07e2e0ba24a85f397963961b4c0d (diff)
downloadrust-83cf471361ed8e5d07111312a80b29b6ecb3290b.tar.gz
rust-83cf471361ed8e5d07111312a80b29b6ecb3290b.zip
out_of_scope_macro_calls: Detect calls inside attributes more precisely
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/macros/out-of-scope-calls-false-positives.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/macros/out-of-scope-calls-false-positives.rs b/tests/ui/macros/out-of-scope-calls-false-positives.rs
new file mode 100644
index 00000000000..8d696c177e4
--- /dev/null
+++ b/tests/ui/macros/out-of-scope-calls-false-positives.rs
@@ -0,0 +1,10 @@
+//@ check-pass
+//@ needs-asm-support
+
+macro_rules! mac { () => { "" } }
+macro_rules! mac2 { () => { "auxiliary/issue-40469.rs" } }
+
+std::arch::global_asm!(mac!()); // OK
+include!(mac2!()); // OK
+
+fn main() {}