aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/base_db/src/fixture.rs4
-rw-r--r--crates/hir_def/src/nameres/tests/mod_resolution.rs2
-rw-r--r--crates/test_utils/src/fixture.rs4
3 files changed, 2 insertions, 8 deletions
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 3c6c516b2..66e6443cb 100644
--- a/crates/base_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
@@ -150,8 +150,6 @@ impl ChangeFixture {
150 entry.text.clone() 150 entry.text.clone()
151 }; 151 };
152 152
153 let explicit_root = entry.explicit_root;
154
155 let meta = FileMeta::from(entry); 153 let meta = FileMeta::from(entry);
156 assert!(meta.path.starts_with(&source_root_prefix)); 154 assert!(meta.path.starts_with(&source_root_prefix));
157 155
@@ -171,7 +169,7 @@ impl ChangeFixture {
171 let dep = CrateName::normalize_dashes(&dep); 169 let dep = CrateName::normalize_dashes(&dep);
172 crate_deps.push((crate_name.clone(), dep)) 170 crate_deps.push((crate_name.clone(), dep))
173 } 171 }
174 } else if meta.path == "/main.rs" || meta.path == "/lib.rs" || explicit_root { 172 } else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
175 assert!(default_crate_root.is_none()); 173 assert!(default_crate_root.is_none());
176 default_crate_root = Some(file_id); 174 default_crate_root = Some(file_id);
177 default_cfg = meta.cfg; 175 default_cfg = meta.cfg;
diff --git a/crates/hir_def/src/nameres/tests/mod_resolution.rs b/crates/hir_def/src/nameres/tests/mod_resolution.rs
index 0b2b4429d..ec9d589a3 100644
--- a/crates/hir_def/src/nameres/tests/mod_resolution.rs
+++ b/crates/hir_def/src/nameres/tests/mod_resolution.rs
@@ -323,7 +323,7 @@ pub struct Baz;
323fn module_resolution_relative_path_outside_root() { 323fn module_resolution_relative_path_outside_root() {
324 check( 324 check(
325 r#" 325 r#"
326//- /a/b/c/d/e/main.rs root: 326//- /a/b/c/d/e/main.rs crate:main
327#[path="../../../../../outside.rs"] 327#[path="../../../../../outside.rs"]
328mod foo; 328mod foo;
329 329
diff --git a/crates/test_utils/src/fixture.rs b/crates/test_utils/src/fixture.rs
index 806ab06c1..e40b61a94 100644
--- a/crates/test_utils/src/fixture.rs
+++ b/crates/test_utils/src/fixture.rs
@@ -8,7 +8,6 @@ use stdx::{lines_with_ends, split_once, trim_indent};
8pub struct Fixture { 8pub struct Fixture {
9 pub path: String, 9 pub path: String,
10 pub text: String, 10 pub text: String,
11 pub explicit_root: bool,
12 pub krate: Option<String>, 11 pub krate: Option<String>,
13 pub deps: Vec<String>, 12 pub deps: Vec<String>,
14 pub cfg_atoms: Vec<String>, 13 pub cfg_atoms: Vec<String>,
@@ -65,7 +64,6 @@ impl Fixture {
65 let path = components[0].to_string(); 64 let path = components[0].to_string();
66 assert!(path.starts_with('/')); 65 assert!(path.starts_with('/'));
67 66
68 let mut explicit_root = false;
69 let mut krate = None; 67 let mut krate = None;
70 let mut deps = Vec::new(); 68 let mut deps = Vec::new();
71 let mut edition = None; 69 let mut edition = None;
@@ -75,7 +73,6 @@ impl Fixture {
75 for component in components[1..].iter() { 73 for component in components[1..].iter() {
76 let (key, value) = split_once(component, ':').unwrap(); 74 let (key, value) = split_once(component, ':').unwrap();
77 match key { 75 match key {
78 "root" => explicit_root = true,
79 "crate" => krate = Some(value.to_string()), 76 "crate" => krate = Some(value.to_string()),
80 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(), 77 "deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
81 "edition" => edition = Some(value.to_string()), 78 "edition" => edition = Some(value.to_string()),
@@ -101,7 +98,6 @@ impl Fixture {
101 Fixture { 98 Fixture {
102 path, 99 path,
103 text: String::new(), 100 text: String::new(),
104 explicit_root: explicit_root,
105 krate: krate, 101 krate: krate,
106 deps, 102 deps,
107 cfg_atoms, 103 cfg_atoms,