diff options
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/mod_resolution.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs index ec9d589a3..ba295fd9e 100644 --- a/crates/hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs | |||
@@ -771,3 +771,30 @@ struct X; | |||
771 | "#]], | 771 | "#]], |
772 | ); | 772 | ); |
773 | } | 773 | } |
774 | |||
775 | #[test] | ||
776 | fn circular_mods() { | ||
777 | mark::check!(circular_mods); | ||
778 | compute_crate_def_map( | ||
779 | r#" | ||
780 | //- /lib.rs | ||
781 | mod foo; | ||
782 | //- /foo.rs | ||
783 | #[path = "./foo.rs"] | ||
784 | mod foo; | ||
785 | "#, | ||
786 | ); | ||
787 | |||
788 | compute_crate_def_map( | ||
789 | r#" | ||
790 | //- /lib.rs | ||
791 | mod foo; | ||
792 | //- /foo.rs | ||
793 | #[path = "./bar.rs"] | ||
794 | mod bar; | ||
795 | //- /bar.rs | ||
796 | #[path = "./foo.rs"] | ||
797 | mod foo; | ||
798 | "#, | ||
799 | ); | ||
800 | } | ||