diff options
Diffstat (limited to 'crates/base_db/src')
-rw-r--r-- | crates/base_db/src/fixture.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs index 66e6443cb..3c6c516b2 100644 --- a/crates/base_db/src/fixture.rs +++ b/crates/base_db/src/fixture.rs | |||
@@ -150,6 +150,8 @@ impl ChangeFixture { | |||
150 | entry.text.clone() | 150 | entry.text.clone() |
151 | }; | 151 | }; |
152 | 152 | ||
153 | let explicit_root = entry.explicit_root; | ||
154 | |||
153 | let meta = FileMeta::from(entry); | 155 | let meta = FileMeta::from(entry); |
154 | assert!(meta.path.starts_with(&source_root_prefix)); | 156 | assert!(meta.path.starts_with(&source_root_prefix)); |
155 | 157 | ||
@@ -169,7 +171,7 @@ impl ChangeFixture { | |||
169 | let dep = CrateName::normalize_dashes(&dep); | 171 | let dep = CrateName::normalize_dashes(&dep); |
170 | crate_deps.push((crate_name.clone(), dep)) | 172 | crate_deps.push((crate_name.clone(), dep)) |
171 | } | 173 | } |
172 | } else if meta.path == "/main.rs" || meta.path == "/lib.rs" { | 174 | } else if meta.path == "/main.rs" || meta.path == "/lib.rs" || explicit_root { |
173 | assert!(default_crate_root.is_none()); | 175 | assert!(default_crate_root.is_none()); |
174 | default_crate_root = Some(file_id); | 176 | default_crate_root = Some(file_id); |
175 | default_cfg = meta.cfg; | 177 | default_cfg = meta.cfg; |