diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-07-24 19:07:20 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-08-09 16:27:20 +0500 |
| commit | 16765639b30741dde85da0dbcb44c343eb82b1a2 (patch) | |
| tree | ef7f40e32fab78c39546bc588542774d276e5dc8 /tests/ui/macros/for-loop-macro-rules-hygiene.rs | |
| parent | 90bb5cacb5c1a5fe20ba821d28e7eb7a21e35d09 (diff) | |
| download | rust-16765639b30741dde85da0dbcb44c343eb82b1a2.tar.gz rust-16765639b30741dde85da0dbcb44c343eb82b1a2.zip | |
comments
Diffstat (limited to 'tests/ui/macros/for-loop-macro-rules-hygiene.rs')
| -rw-r--r-- | tests/ui/macros/for-loop-macro-rules-hygiene.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/macros/for-loop-macro-rules-hygiene.rs b/tests/ui/macros/for-loop-macro-rules-hygiene.rs new file mode 100644 index 00000000000..fcebda1b9da --- /dev/null +++ b/tests/ui/macros/for-loop-macro-rules-hygiene.rs @@ -0,0 +1,12 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/15189 + +//@ run-pass +macro_rules! third { + ($e:expr) => ({let x = 2; $e[x]}) +} + +fn main() { + let x = vec![10_usize,11_usize,12_usize,13_usize]; + let t = third!(x); + assert_eq!(t,12_usize); +} |
