aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/tests
diff options
context:
space:
mode:
authoruHOOCCOOHu <[email protected]>2019-09-05 04:35:13 +0100
committeruHOOCCOOHu <[email protected]>2019-09-05 04:46:00 +0100
commit0d23286caf35a7cd8aed6e20fab3a2a3ed91ae8f (patch)
treedf01037e66b345a13ba00c197ab3d6dd24d8050e /crates/ra_hir/src/nameres/tests
parenta66214b34effe1ad7f4351a1b920cf3a8f98d3c0 (diff)
Let `macro_use` bypass module scope
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r--crates/ra_hir/src/nameres/tests/macros.rs29
1 files changed, 14 insertions, 15 deletions
diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs
index cfddf3029..ff762ee30 100644
--- a/crates/ra_hir/src/nameres/tests/macros.rs
+++ b/crates/ra_hir/src/nameres/tests/macros.rs
@@ -147,25 +147,31 @@ fn macro_rules_from_other_crates_are_visible_with_macro_use() {
147 #[macro_use] 147 #[macro_use]
148 extern crate foo; 148 extern crate foo;
149 149
150 structs!(Foo, Bar) 150 structs!(Foo);
151 structs_priv!(Bar);
152 structs_not_exported!(MacroNotResolved1);
153 crates::structs!(MacroNotResolved2);
151 154
152 mod bar; 155 mod bar;
153 156
154 //- /bar.rs 157 //- /bar.rs
155 use crate::*; 158 structs!(Baz);
159 crates::structs!(MacroNotResolved3);
156 160
157 //- /lib.rs 161 //- /lib.rs
158 #[macro_export] 162 #[macro_export]
159 macro_rules! structs { 163 macro_rules! structs {
160 ($($i:ident),*) => { 164 ($i:ident) => { struct $i; }
161 $(struct $i { field: u32 } )* 165 }
162 } 166
167 macro_rules! structs_not_exported {
168 ($i:ident) => { struct $i; }
163 } 169 }
164 170
165 mod priv_mod { 171 mod priv_mod {
166 #[macro_export] 172 #[macro_export]
167 macro_rules! baz { 173 macro_rules! structs_priv {
168 () => {}; 174 ($i:ident) => { struct $i; }
169 } 175 }
170 } 176 }
171 ", 177 ",
@@ -179,16 +185,9 @@ fn macro_rules_from_other_crates_are_visible_with_macro_use() {
179 ⋮Bar: t v 185 ⋮Bar: t v
180 ⋮Foo: t v 186 ⋮Foo: t v
181 ⋮bar: t 187 ⋮bar: t
182 ⋮baz: m
183 ⋮foo: t 188 ⋮foo: t
184 ⋮structs: m
185 189
186 ⋮crate::bar 190 ⋮crate::bar
187 ⋮Bar: t v 191 ⋮Baz: t v
188 ⋮Foo: t v
189 ⋮bar: t
190 ⋮baz: m
191 ⋮foo: t
192 ⋮structs: m
193 "###); 192 "###);
194} 193}