diff options
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/mod_resolution.rs | 19 |
1 files changed, 19 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 dfbbad1f9..16a2cd27a 100644 --- a/crates/hir_def/src/nameres/tests/mod_resolution.rs +++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs | |||
@@ -819,3 +819,22 @@ pub mod hash { pub trait Hash {} } | |||
819 | "#]], | 819 | "#]], |
820 | ); | 820 | ); |
821 | } | 821 | } |
822 | |||
823 | #[test] | ||
824 | fn cfg_in_module_file() { | ||
825 | // Inner `#![cfg]` in a module file makes the whole module disappear. | ||
826 | check( | ||
827 | r#" | ||
828 | //- /main.rs | ||
829 | mod module; | ||
830 | |||
831 | //- /module.rs | ||
832 | #![cfg(NEVER)] | ||
833 | |||
834 | struct AlsoShoulntAppear; | ||
835 | "#, | ||
836 | expect![[r#" | ||
837 | crate | ||
838 | "#]], | ||
839 | ) | ||
840 | } | ||