aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-07 19:43:41 +0100
committerAleksey Kladov <[email protected]>2019-09-07 19:47:59 +0100
commitbcc9a28734e731d9823bf0d6516176a71f3d4627 (patch)
treed4e1fc3861ffcbe815e650377600dd926362498b /crates/ra_hir/src/nameres/tests
parent4a89a7c9026dc3df4466f7b10c666186830d38f6 (diff)
don't cycle when processing macros from prelude in prelude
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r--crates/ra_hir/src/nameres/tests/macros.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs
index aece1515b..c62152d26 100644
--- a/crates/ra_hir/src/nameres/tests/macros.rs
+++ b/crates/ra_hir/src/nameres/tests/macros.rs
@@ -248,3 +248,32 @@ fn prelude_is_macro_use() {
248 ⋮Baz: t v 248 ⋮Baz: t v
249 "###); 249 "###);
250} 250}
251
252#[test]
253fn prelude_cycle() {
254 let map = def_map(
255 "
256 //- /lib.rs
257 #[prelude_import]
258 use self::prelude::*;
259
260 declare_mod!();
261
262 mod prelude {
263 macro_rules! declare_mod {
264 () => (mod foo {})
265 }
266 }
267 ",
268 );
269 assert_snapshot!(map, @r###"
270 ⋮crate
271 ⋮foo: t
272 ⋮prelude: t
273
274 ⋮crate::prelude
275 ⋮declare_mod: m
276
277 ⋮crate::foo
278 "###);
279}