From a003cb7cd7d619a5553c5c99e4ee7ce185a1608c Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 8 Feb 2018 16:26:33 -0800 Subject: [PATCH] Add test. --- src/test/run-pass/hygiene/issue-47312.rs | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/run-pass/hygiene/issue-47312.rs diff --git a/src/test/run-pass/hygiene/issue-47312.rs b/src/test/run-pass/hygiene/issue-47312.rs new file mode 100644 index 0000000000000..5e83f3808d8cc --- /dev/null +++ b/src/test/run-pass/hygiene/issue-47312.rs @@ -0,0 +1,30 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-pretty pretty-printing is unhygienic + +#![feature(decl_macro)] +#![allow(unused)] + +mod foo { + pub macro m($s:tt, $i:tt) { + $s.$i + } +} + +mod bar { + struct S(i32); + fn f() { + let s = S(0); + ::foo::m!(s, 0); + } +} + +fn main() {}