Feedback.

This commit is contained in:
James Leitch 2020-11-02 10:57:31 -07:00
parent d2d7a4403c
commit ff87726074
3 changed files with 2 additions and 8 deletions

View file

@ -150,8 +150,6 @@ impl ChangeFixture {
entry.text.clone()
};
let explicit_root = entry.explicit_root;
let meta = FileMeta::from(entry);
assert!(meta.path.starts_with(&source_root_prefix));
@ -171,7 +169,7 @@ impl ChangeFixture {
let dep = CrateName::normalize_dashes(&dep);
crate_deps.push((crate_name.clone(), dep))
}
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" || explicit_root {
} else if meta.path == "/main.rs" || meta.path == "/lib.rs" {
assert!(default_crate_root.is_none());
default_crate_root = Some(file_id);
default_cfg = meta.cfg;

View file

@ -323,7 +323,7 @@ pub struct Baz;
fn module_resolution_relative_path_outside_root() {
check(
r#"
//- /a/b/c/d/e/main.rs root:
//- /a/b/c/d/e/main.rs crate:main
#[path="../../../../../outside.rs"]
mod foo;

View file

@ -8,7 +8,6 @@ use stdx::{lines_with_ends, split_once, trim_indent};
pub struct Fixture {
pub path: String,
pub text: String,
pub explicit_root: bool,
pub krate: Option<String>,
pub deps: Vec<String>,
pub cfg_atoms: Vec<String>,
@ -65,7 +64,6 @@ impl Fixture {
let path = components[0].to_string();
assert!(path.starts_with('/'));
let mut explicit_root = false;
let mut krate = None;
let mut deps = Vec::new();
let mut edition = None;
@ -75,7 +73,6 @@ impl Fixture {
for component in components[1..].iter() {
let (key, value) = split_once(component, ':').unwrap();
match key {
"root" => explicit_root = true,
"crate" => krate = Some(value.to_string()),
"deps" => deps = value.split(',').map(|it| it.to_string()).collect(),
"edition" => edition = Some(value.to_string()),
@ -101,7 +98,6 @@ impl Fixture {
Fixture {
path,
text: String::new(),
explicit_root: explicit_root,
krate: krate,
deps,
cfg_atoms,