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.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/crates/base-db/src/input.rs b/crates/base-db/src/input.rs
index 57522d6932..e86944eeb3 100644
--- a/crates/base-db/src/input.rs
+++ b/crates/base-db/src/input.rs
@@ -547,29 +547,6 @@ impl CrateGraph {
None
}
- // Work around for https://github.com/rust-lang/rust-analyzer/issues/6038.
- // As hacky as it gets.
- pub fn patch_cfg_if(&mut self) -> bool {
- // we stupidly max by version in an attempt to have all duplicated std's depend on the same cfg_if so that deduplication still works
- let cfg_if =
- self.hacky_find_crate("cfg_if").max_by_key(|&it| self.arena[it].version.clone());
- let std = self.hacky_find_crate("std").next();
- match (cfg_if, std) {
- (Some(cfg_if), Some(std)) => {
- self.arena[cfg_if].dependencies.clear();
- self.arena[std]
- .dependencies
- .push(Dependency::new(CrateName::new("cfg_if").unwrap(), cfg_if));
- true
- }
- _ => false,
- }
- }
-
- fn hacky_find_crate<'a>(&'a self, display_name: &'a str) -> impl Iterator<Item = CrateId> + 'a {
- self.iter().filter(move |it| self[*it].display_name.as_deref() == Some(display_name))
- }
-
/// Removes all crates from this crate graph except for the ones in `to_keep` and fixes up the dependencies.
/// Returns a mapping from old crate ids to new crate ids.
pub fn remove_crates_except(&mut self, to_keep: &[CrateId]) -> Vec<Option<CrateId>> {