mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Salsify the crate graph
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
This commit is contained in:
parent
44f18c3d05
commit
c94e9efbef
108 changed files with 3630 additions and 2512 deletions
|
|
@ -104,6 +104,12 @@ impl CfgOptions {
|
|||
_ => None,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn to_hashable(&self) -> HashableCfgOptions {
|
||||
let mut enabled = self.enabled.iter().cloned().collect::<Box<[_]>>();
|
||||
enabled.sort_unstable();
|
||||
HashableCfgOptions { _enabled: enabled }
|
||||
}
|
||||
}
|
||||
|
||||
impl Extend<CfgAtom> for CfgOptions {
|
||||
|
|
@ -256,3 +262,9 @@ impl fmt::Display for InactiveReason {
|
|||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A `CfgOptions` that implements `Hash`, for the sake of hashing only.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct HashableCfgOptions {
|
||||
_enabled: Box<[CfgAtom]>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue