Skip to content

Commit ff87726

Browse files
committed
Feedback.
1 parent d2d7a44 commit ff87726

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

crates/base_db/src/fixture.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ impl ChangeFixture {
150150
entry.text.clone()
151151
};
152152

153-
let explicit_root = entry.explicit_root;
154-
155153
let meta = FileMeta::from(entry);
156154
assert!(meta.path.starts_with(&source_root_prefix));
157155

@@ -171,7 +169,7 @@ impl ChangeFixture {
171169
let dep = CrateName::normalize_dashes(&dep);
172170
crate_deps.push((crate_name.clone(), dep))
173171
}
174-
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" || explicit_root {
172+
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
175173
assert!(default_crate_root.is_none());
176174
default_crate_root = Some(file_id);
177175
default_cfg = meta.cfg;

crates/hir_def/src/nameres/tests/mod_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pub struct Baz;
323323
fn module_resolution_relative_path_outside_root() {
324324
check(
325325
r#"
326-
//- /a/b/c/d/e/main.rs root:
326+
//- /a/b/c/d/e/main.rs crate:main
327327
#[path="../../../../../outside.rs"]
328328
mod foo;
329329

crates/test_utils/src/fixture.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use stdx::{lines_with_ends, split_once, trim_indent};
88
pub struct Fixture {
99
pub path: String,
1010
pub text: String,
11-
pub explicit_root: bool,
1211
pub krate: Option<String>,
1312
pub deps: Vec<String>,
1413
pub cfg_atoms: Vec<String>,
@@ -65,7 +64,6 @@ impl Fixture {
6564
let path = components[0].to_string();
6665
assert!(path.starts_with('/'));
6766

68-
let mut explicit_root = false;
6967
let mut krate = None;
7068
let mut deps = Vec::new();
7169
let mut edition = None;
@@ -75,7 +73,6 @@ impl Fixture {
7573
for component in components[1..].iter() {
7674
let (key, value) = split_once(component, ':').unwrap();
7775
match key {
78-
"root" => explicit_root = true,
7976
"crate" => krate = Some(value.to_string()),
8077
"deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
8178
"edition" => edition = Some(value.to_string()),
@@ -101,7 +98,6 @@ impl Fixture {
10198
Fixture {
10299
path,
103100
text: String::new(),
104-
explicit_root: explicit_root,
105101
krate: krate,
106102
deps,
107103
cfg_atoms,

0 commit comments

Comments
 (0)