mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Feedback.
This commit is contained in:
parent
d2d7a4403c
commit
ff87726074
3 changed files with 2 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue