diff options
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r-- | crates/ra_hir/src/nameres/tests/macros.rs | 29 |
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] | ||
253 | fn 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 | } | ||