aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-19 17:25:09 +0000
committerGitHub <[email protected]>2021-03-19 17:25:09 +0000
commit2813afd0592957b327695e77fe75dd956700fd40 (patch)
tree2d69a62693790a12c98bfd414ecfcd6bbac1b1eb /crates/hir_def/src/nameres/tests
parentdc8e2fea98aecbba0c587e5999b9e09533e0091c (diff)
parentcf494a515ff70675a4531585aa24a792f5b5e896 (diff)
Merge #8108
8108: Fix handling of `#![cfg]` in outline module file r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r--crates/hir_def/src/nameres/tests/mod_resolution.rs19
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]
824fn cfg_in_module_file() {
825 // Inner `#![cfg]` in a module file makes the whole module disappear.
826 check(
827 r#"
828//- /main.rs
829mod module;
830
831//- /module.rs
832#![cfg(NEVER)]
833
834struct AlsoShoulntAppear;
835 "#,
836 expect![[r#"
837 crate
838 "#]],
839 )
840}