Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/base-db/src/input.rs')
-rw-r--r--crates/base-db/src/input.rs21
1 files changed, 17 insertions, 4 deletions
diff --git a/crates/base-db/src/input.rs b/crates/base-db/src/input.rs
index e7f0c4ec29..5fa4a80249 100644
--- a/crates/base-db/src/input.rs
+++ b/crates/base-db/src/input.rs
@@ -128,7 +128,7 @@ impl fmt::Display for CrateName {
impl ops::Deref for CrateName {
type Target = str;
fn deref(&self) -> &str {
- &*self.0
+ &self.0
}
}
@@ -211,7 +211,7 @@ impl fmt::Display for CrateDisplayName {
impl ops::Deref for CrateDisplayName {
type Target = str;
fn deref(&self) -> &str {
- &*self.crate_name
+ &self.crate_name
}
}
@@ -270,6 +270,7 @@ pub struct CrateData {
pub display_name: Option<CrateDisplayName>,
pub cfg_options: CfgOptions,
pub potential_cfg_options: CfgOptions,
+ pub target_layout: Option<Arc<str>>,
pub env: Env,
pub dependencies: Vec<Dependency>,
pub proc_macro: ProcMacroLoadResult,
@@ -328,6 +329,7 @@ impl CrateGraph {
proc_macro: ProcMacroLoadResult,
is_proc_macro: bool,
origin: CrateOrigin,
+ target_layout: Option<Arc<str>>,
) -> CrateId {
let data = CrateData {
root_file_id,
@@ -340,6 +342,7 @@ impl CrateGraph {
proc_macro,
dependencies: Vec::new(),
origin,
+ target_layout,
is_proc_macro,
};
let crate_id = CrateId(self.arena.len() as u32);
@@ -615,8 +618,8 @@ impl CyclicDependenciesError {
impl fmt::Display for CyclicDependenciesError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let render = |(id, name): &(CrateId, Option<CrateDisplayName>)| match name {
- Some(it) => format!("{}({:?})", it, id),
- None => format!("{:?}", id),
+ Some(it) => format!("{it}({id:?})"),
+ None => format!("{id:?}"),
};
let path = self.path.iter().rev().map(render).collect::<Vec<String>>().join(" -> ");
write!(
@@ -649,6 +652,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
let crate2 = graph.add_crate_root(
FileId(2u32),
@@ -661,6 +665,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
let crate3 = graph.add_crate_root(
FileId(3u32),
@@ -673,6 +678,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
assert!(graph
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
@@ -699,6 +705,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
let crate2 = graph.add_crate_root(
FileId(2u32),
@@ -711,6 +718,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
assert!(graph
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
@@ -734,6 +742,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
let crate2 = graph.add_crate_root(
FileId(2u32),
@@ -746,6 +755,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
let crate3 = graph.add_crate_root(
FileId(3u32),
@@ -758,6 +768,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
assert!(graph
.add_dep(crate1, Dependency::new(CrateName::new("crate2").unwrap(), crate2))
@@ -781,6 +792,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
let crate2 = graph.add_crate_root(
FileId(2u32),
@@ -793,6 +805,7 @@ mod tests {
Ok(Vec::new()),
false,
CrateOrigin::CratesIo { repo: None, name: None },
+ None,
);
assert!(graph
.add_dep(