diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:12:43 +0000 |
commit | cf94bdc0742c13e2a0cac864c478b8626b266e1b (patch) | |
tree | 044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /src/tools/rust-analyzer/crates/base-db | |
parent | Adding debian version 1.65.0+dfsg1-2. (diff) | |
download | rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rust-analyzer/crates/base-db')
-rw-r--r-- | src/tools/rust-analyzer/crates/base-db/src/fixture.rs | 8 | ||||
-rw-r--r-- | src/tools/rust-analyzer/crates/base-db/src/input.rs | 22 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/tools/rust-analyzer/crates/base-db/src/fixture.rs b/src/tools/rust-analyzer/crates/base-db/src/fixture.rs index 8e6e6a11a..5b7828a26 100644 --- a/src/tools/rust-analyzer/crates/base-db/src/fixture.rs +++ b/src/tools/rust-analyzer/crates/base-db/src/fixture.rs @@ -196,7 +196,7 @@ impl ChangeFixture { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); } else { for (from, to, prelude) in crate_deps { @@ -270,7 +270,7 @@ impl ChangeFixture { Env::default(), Ok(proc_macro), true, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); for krate in all_crates { @@ -398,7 +398,7 @@ fn parse_crate(crate_str: String) -> (String, CrateOrigin, Option<String>) { let (version, origin) = match b.split_once(':') { Some(("CratesIo", data)) => match data.split_once(',') { Some((version, url)) => { - (version, CrateOrigin::CratesIo { repo: Some(url.to_owned()) }) + (version, CrateOrigin::CratesIo { repo: Some(url.to_owned()), name: None }) } _ => panic!("Bad crates.io parameter: {}", data), }, @@ -409,7 +409,7 @@ fn parse_crate(crate_str: String) -> (String, CrateOrigin, Option<String>) { let crate_origin = match &*crate_str { "std" => CrateOrigin::Lang(LangCrateOrigin::Std), "core" => CrateOrigin::Lang(LangCrateOrigin::Core), - _ => CrateOrigin::CratesIo { repo: None }, + _ => CrateOrigin::CratesIo { repo: None, name: None }, }; (crate_str, crate_origin, None) } diff --git a/src/tools/rust-analyzer/crates/base-db/src/input.rs b/src/tools/rust-analyzer/crates/base-db/src/input.rs index b388e47de..e7f0c4ec2 100644 --- a/src/tools/rust-analyzer/crates/base-db/src/input.rs +++ b/src/tools/rust-analyzer/crates/base-db/src/input.rs @@ -136,7 +136,7 @@ impl ops::Deref for CrateName { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum CrateOrigin { /// Crates that are from crates.io official registry, - CratesIo { repo: Option<String> }, + CratesIo { repo: Option<String>, name: Option<String> }, /// Crates that are provided by the language, like std, core, proc-macro, ... Lang(LangCrateOrigin), } @@ -648,7 +648,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); let crate2 = graph.add_crate_root( FileId(2u32), @@ -660,7 +660,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); let crate3 = graph.add_crate_root( FileId(3u32), @@ -672,7 +672,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); assert!(graph .add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2)) @@ -698,7 +698,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); let crate2 = graph.add_crate_root( FileId(2u32), @@ -710,7 +710,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); assert!(graph .add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2)) @@ -733,7 +733,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); let crate2 = graph.add_crate_root( FileId(2u32), @@ -745,7 +745,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); let crate3 = graph.add_crate_root( FileId(3u32), @@ -757,7 +757,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); assert!(graph .add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2)) @@ -780,7 +780,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); let crate2 = graph.add_crate_root( FileId(2u32), @@ -792,7 +792,7 @@ mod tests { Env::default(), Ok(Vec::new()), false, - CrateOrigin::CratesIo { repo: None }, + CrateOrigin::CratesIo { repo: None, name: None }, ); assert!(graph .add_dep( |