chore: Remove unused dependencies

This commit is contained in:
Lukas Wirth 2025-03-23 07:45:29 +01:00
parent 3bf18d4eba
commit d4122434dd
23 changed files with 45 additions and 96 deletions

35
Cargo.lock generated
View file

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "addr2line"
@ -32,12 +32,6 @@ version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]]
name = "always-assert"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1078fa1ce1e34b1872d8611ad921196d76bdd7027e949fbe31231abde201892"
[[package]]
name = "anyhow"
version = "1.0.97"
@ -85,13 +79,11 @@ dependencies = [
"dashmap 5.5.3",
"intern",
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lz4_flex",
"query-group-macro",
"rustc-hash 2.1.1",
"salsa",
"semver",
"span",
"stdx",
"syntax",
"tracing",
"triomphe",
@ -638,12 +630,10 @@ dependencies = [
"bitflags 2.9.0",
"cfg",
"cov-mark",
"dashmap 5.5.3",
"drop_bomb",
"either",
"expect-test",
"fst",
"hashbrown 0.14.5",
"hir-expand",
"indexmap",
"intern",
@ -652,7 +642,6 @@ dependencies = [
"mbe",
"query-group-macro",
"ra-ap-rustc_abi",
"ra-ap-rustc_hashes",
"ra-ap-rustc_parse_format",
"rustc-hash 2.1.1",
"rustc_apfloat",
@ -679,10 +668,8 @@ dependencies = [
"cov-mark",
"either",
"expect-test",
"hashbrown 0.14.5",
"intern",
"itertools",
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mbe",
"parser",
"query-group-macro",
@ -710,7 +697,6 @@ dependencies = [
"chalk-recursive",
"chalk-solve",
"cov-mark",
"dashmap 5.5.3",
"either",
"ena",
"expect-test",
@ -720,7 +706,6 @@ dependencies = [
"intern",
"itertools",
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"nohash-hasher",
"oorandom",
"project-model",
"query-group-macro",
@ -951,7 +936,6 @@ dependencies = [
"bitflags 2.9.0",
"cov-mark",
"crossbeam-channel",
"dashmap 5.5.3",
"either",
"expect-test",
"fst",
@ -1006,9 +990,7 @@ dependencies = [
"hir",
"ide-db",
"itertools",
"nohash-hasher",
"parser",
"stdx",
"syntax",
"test-fixture",
"test-utils",
@ -1206,7 +1188,6 @@ dependencies = [
"ide-db",
"intern",
"itertools",
"paths",
"proc-macro-api",
"project-model",
"span",
@ -1284,12 +1265,6 @@ dependencies = [
"url",
]
[[package]]
name = "lz4_flex"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5"
[[package]]
name = "matchers"
version = "0.1.0"
@ -1316,7 +1291,6 @@ dependencies = [
"syntax",
"syntax-bridge",
"test-utils",
"tracing",
"tt",
]
@ -1644,7 +1618,6 @@ dependencies = [
"proc-macro-test",
"ra-ap-rustc_lexer",
"span",
"stdx",
"syntax-bridge",
"tt",
]
@ -1767,7 +1740,6 @@ name = "query-group-macro"
version = "0.0.0"
dependencies = [
"expect-test",
"heck",
"proc-macro2",
"quote",
"salsa",
@ -1960,7 +1932,6 @@ dependencies = [
name = "rust-analyzer"
version = "0.0.0"
dependencies = [
"always-assert",
"anyhow",
"base64",
"cargo_metadata",
@ -2292,10 +2263,8 @@ dependencies = [
name = "syntax"
version = "0.0.0"
dependencies = [
"cov-mark",
"either",
"expect-test",
"indexmap",
"itertools",
"parser",
"ra-ap-rustc_lexer",
@ -2321,7 +2290,6 @@ dependencies = [
"stdx",
"syntax",
"test-utils",
"tracing",
"tt",
]
@ -2357,7 +2325,6 @@ dependencies = [
"rustc-hash 2.1.1",
"stdx",
"text-size",
"tracing",
]
[[package]]

View file

@ -12,8 +12,6 @@ rust-version.workspace = true
[lib]
[dependencies]
lz4_flex = { version = "0.11", default-features = false }
la-arena.workspace = true
dashmap.workspace = true
salsa.workspace = true
@ -25,7 +23,6 @@ tracing.workspace = true
# local deps
cfg.workspace = true
stdx.workspace = true
syntax.workspace = true
vfs.workspace = true
span.workspace = true

View file

@ -15,7 +15,6 @@ rust-version.workspace = true
arrayvec.workspace = true
bitflags.workspace = true
cov-mark = "2.0.0-pre.1"
dashmap.workspace = true
drop_bomb = "0.1.5"
either.workspace = true
fst = { version = "0.4.7", default-features = false }
@ -25,14 +24,12 @@ la-arena.workspace = true
rustc-hash.workspace = true
tracing.workspace = true
smallvec.workspace = true
hashbrown.workspace = true
triomphe.workspace = true
rustc_apfloat = "0.2.0"
text-size.workspace = true
salsa.workspace = true
query-group.workspace = true
ra-ap-rustc_hashes.workspace = true
ra-ap-rustc_parse_format.workspace = true
ra-ap-rustc_abi.workspace = true

View file

@ -16,9 +16,7 @@ cov-mark = "2.0.0-pre.1"
tracing.workspace = true
either.workspace = true
rustc-hash.workspace = true
la-arena.workspace = true
itertools.workspace = true
hashbrown.workspace = true
smallvec.workspace = true
triomphe.workspace = true
query-group.workspace = true

View file

@ -29,9 +29,7 @@ chalk-recursive.workspace = true
chalk-derive.workspace = true
la-arena.workspace = true
triomphe.workspace = true
nohash-hasher.workspace = true
typed-arena = "2.0.1"
dashmap.workspace = true
indexmap.workspace = true
rustc_apfloat = "0.2.0"
query-group.workspace = true

View file

@ -15,7 +15,6 @@ rust-version.workspace = true
cov-mark = "2.0.0-pre.1"
crossbeam-channel.workspace = true
tracing.workspace = true
dashmap.workspace = true
rayon.workspace = true
fst = { version = "0.4.7", default-features = false }
rustc-hash.workspace = true

View file

@ -14,18 +14,16 @@ rust-version.workspace = true
[dependencies]
cov-mark = "2.0.0-pre.1"
itertools.workspace = true
triomphe.workspace = true
nohash-hasher.workspace = true
# local deps
hir.workspace = true
ide-db.workspace = true
parser.workspace = true
stdx.workspace = true
syntax.workspace = true
[dev-dependencies]
expect-test = "1.4.0"
triomphe.workspace = true
# local deps
test-utils.workspace = true

View file

@ -21,7 +21,6 @@ tracing.workspace = true
hir-expand.workspace = true
ide-db.workspace = true
paths.workspace = true
proc-macro-api.workspace = true
project-model.workspace = true
span.workspace = true

View file

@ -15,12 +15,10 @@ rust-version.workspace = true
cov-mark = "2.0.0-pre.1"
rustc-hash.workspace = true
smallvec.workspace = true
tracing.workspace = true
arrayvec.workspace = true
ra-ap-rustc_lexer.workspace = true
# local deps
syntax.workspace = true
parser.workspace = true
tt.workspace = true
stdx.workspace = true
@ -31,9 +29,10 @@ syntax-bridge.workspace = true
[dev-dependencies]
test-utils.workspace = true
expect-test.workspace = true
syntax.workspace = true
[features]
in-rust-tree = ["parser/in-rust-tree", "tt/in-rust-tree", "syntax/in-rust-tree"]
in-rust-tree = ["parser/in-rust-tree", "tt/in-rust-tree"]
[lints]
workspace = true

View file

@ -1,6 +1,7 @@
//! A standalone binary for `proc-macro-srv`.
//! Driver for proc macro server
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#![cfg_attr(not(feature = "sysroot-abi"), allow(unused_crate_dependencies))]
#![allow(clippy::print_stderr)]
#[cfg(feature = "in-rust-tree")]

View file

@ -13,11 +13,9 @@ rust-version.workspace = true
[dependencies]
object.workspace = true
libc.workspace = true
libloading.workspace = true
memmap2.workspace = true
stdx.workspace = true
tt.workspace = true
syntax-bridge.workspace = true
paths.workspace = true
@ -27,6 +25,9 @@ intern.workspace = true
ra-ap-rustc_lexer.workspace = true
[target.'cfg(unix)'.dependencies]
libc.workspace = true
[dev-dependencies]
expect-test.workspace = true

View file

@ -11,6 +11,7 @@
//! rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)…
#![cfg(any(feature = "sysroot-abi", rust_analyzer))]
#![cfg_attr(not(feature = "sysroot-abi"), allow(unused_crate_dependencies))]
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#![feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span)]
#![allow(unreachable_pub, internal_features, clippy::disallowed_types, clippy::print_stderr)]

View file

@ -13,12 +13,14 @@ rust-version.workspace = true
[dependencies]
cfg-if = "1.0.0"
libc.workspace = true
jemalloc-ctl = { version = "0.5.0", package = "tikv-jemalloc-ctl", optional = true }
[target.'cfg(all(target_os = "linux", not(target_env = "ohos")))'.dependencies]
perf-event = "=0.4.7"
[target.'cfg(all(target_os = "linux", target_env = "gnu"))'.dependencies]
libc.workspace = true
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = [
"Win32_System_Threading",

View file

@ -13,11 +13,10 @@ rust-version.workspace = true
proc-macro = true
[dependencies]
heck = "0.5.0"
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full", "extra-traits"] }
salsa.workspace = true
[dev-dependencies]
expect-test = "1.5.0"
salsa.workspace = true

View file

@ -47,7 +47,6 @@ tracing-tree.workspace = true
triomphe.workspace = true
toml = "0.8.8"
nohash-hasher.workspace = true
always-assert = "0.2.0"
walkdir = "2.3.2"
semver.workspace = true
memchr = "2.7.1"
@ -95,9 +94,7 @@ syntax-bridge.workspace = true
[features]
jemalloc = ["jemallocator", "profile/jemalloc"]
force-always-assert = ["stdx/force-always-assert"]
sysroot-abi = []
in-rust-tree = [
"sysroot-abi",
"syntax/in-rust-tree",
"parser/in-rust-tree",
"hir/in-rust-tree",

View file

@ -7,7 +7,6 @@ use cargo_metadata::PackageId;
use ide::FileId;
use ide_db::FxHashMap;
use itertools::Itertools;
use nohash_hasher::{IntMap, IntSet};
use rustc_hash::FxHashSet;
use stdx::iter_eq_by;
use triomphe::Arc;
@ -15,7 +14,7 @@ use triomphe::Arc;
use crate::{global_state::GlobalStateSnapshot, lsp, lsp_ext, main_loop::DiagnosticsTaskKind};
pub(crate) type CheckFixes =
Arc<IntMap<usize, FxHashMap<Option<Arc<PackageId>>, IntMap<FileId, Vec<Fix>>>>>;
Arc<Vec<FxHashMap<Option<Arc<PackageId>>, FxHashMap<FileId, Vec<Fix>>>>>;
#[derive(Debug, Default, Clone)]
pub struct DiagnosticsMapConfig {
@ -29,16 +28,16 @@ pub(crate) type DiagnosticsGeneration = usize;
#[derive(Debug, Default, Clone)]
pub(crate) struct DiagnosticCollection {
// FIXME: should be IntMap<FileId, Vec<ra_id::Diagnostic>>
pub(crate) native_syntax: IntMap<FileId, (DiagnosticsGeneration, Vec<lsp_types::Diagnostic>)>,
pub(crate) native_semantic: IntMap<FileId, (DiagnosticsGeneration, Vec<lsp_types::Diagnostic>)>,
// FIXME: should be FxHashMap<FileId, Vec<ra_id::Diagnostic>>
pub(crate) native_syntax:
FxHashMap<FileId, (DiagnosticsGeneration, Vec<lsp_types::Diagnostic>)>,
pub(crate) native_semantic:
FxHashMap<FileId, (DiagnosticsGeneration, Vec<lsp_types::Diagnostic>)>,
// FIXME: should be Vec<flycheck::Diagnostic>
pub(crate) check: IntMap<
usize,
FxHashMap<Option<Arc<PackageId>>, IntMap<FileId, Vec<lsp_types::Diagnostic>>>,
>,
pub(crate) check:
Vec<FxHashMap<Option<Arc<PackageId>>, FxHashMap<FileId, Vec<lsp_types::Diagnostic>>>>,
pub(crate) check_fixes: CheckFixes,
changes: IntSet<FileId>,
changes: FxHashSet<FileId>,
/// Counter for supplying a new generation number for diagnostics.
/// This is used to keep track of when to clear the diagnostics for a given file as we compute
/// diagnostics on multiple worker threads simultaneously which may result in multiple diagnostics
@ -55,11 +54,11 @@ pub(crate) struct Fix {
impl DiagnosticCollection {
pub(crate) fn clear_check(&mut self, flycheck_id: usize) {
let Some(check) = self.check.get_mut(&flycheck_id) else {
let Some(check) = self.check.get_mut(flycheck_id) else {
return;
};
self.changes.extend(check.drain().flat_map(|(_, v)| v.into_keys()));
if let Some(fixes) = Arc::make_mut(&mut self.check_fixes).get_mut(&flycheck_id) {
if let Some(fixes) = Arc::make_mut(&mut self.check_fixes).get_mut(flycheck_id) {
fixes.clear();
}
}
@ -67,7 +66,7 @@ impl DiagnosticCollection {
pub(crate) fn clear_check_all(&mut self) {
Arc::make_mut(&mut self.check_fixes).clear();
self.changes.extend(
self.check.values_mut().flat_map(|it| it.drain().flat_map(|(_, v)| v.into_keys())),
self.check.iter_mut().flat_map(|it| it.drain().flat_map(|(_, v)| v.into_keys())),
)
}
@ -76,14 +75,14 @@ impl DiagnosticCollection {
flycheck_id: usize,
package_id: Arc<PackageId>,
) {
let Some(check) = self.check.get_mut(&flycheck_id) else {
let Some(check) = self.check.get_mut(flycheck_id) else {
return;
};
let package_id = Some(package_id);
if let Some(checks) = check.remove(&package_id) {
self.changes.extend(checks.into_keys());
}
if let Some(fixes) = Arc::make_mut(&mut self.check_fixes).get_mut(&flycheck_id) {
if let Some(fixes) = Arc::make_mut(&mut self.check_fixes).get_mut(flycheck_id) {
fixes.remove(&package_id);
}
}
@ -102,10 +101,10 @@ impl DiagnosticCollection {
diagnostic: lsp_types::Diagnostic,
fix: Option<Box<Fix>>,
) {
let diagnostics = self
.check
.entry(flycheck_id)
.or_default()
if self.check.len() <= flycheck_id {
self.check.resize_with(flycheck_id + 1, Default::default);
}
let diagnostics = self.check[flycheck_id]
.entry(package_id.clone())
.or_default()
.entry(file_id)
@ -118,9 +117,10 @@ impl DiagnosticCollection {
if let Some(fix) = fix {
let check_fixes = Arc::make_mut(&mut self.check_fixes);
check_fixes
.entry(flycheck_id)
.or_default()
if check_fixes.len() <= flycheck_id {
check_fixes.resize_with(flycheck_id + 1, Default::default);
}
check_fixes[flycheck_id]
.entry(package_id.clone())
.or_default()
.entry(file_id)
@ -176,14 +176,14 @@ impl DiagnosticCollection {
let native_semantic = self.native_semantic.get(&file_id).into_iter().flat_map(|(_, d)| d);
let check = self
.check
.values()
.iter()
.flat_map(|it| it.values())
.filter_map(move |it| it.get(&file_id))
.flatten();
native_syntax.chain(native_semantic).chain(check)
}
pub(crate) fn take_changes(&mut self) -> Option<IntSet<FileId>> {
pub(crate) fn take_changes(&mut self) -> Option<FxHashSet<FileId>> {
if self.changes.is_empty() {
return None;
}

View file

@ -12,7 +12,6 @@ use ide_db::base_db::{Crate, ProcMacroPaths, SourceDatabase};
use itertools::Itertools;
use load_cargo::SourceRootConfig;
use lsp_types::{SemanticTokens, Url};
use nohash_hasher::IntMap;
use parking_lot::{
MappedRwLockReadGuard, Mutex, RwLock, RwLockReadGuard, RwLockUpgradableReadGuard,
RwLockWriteGuard,
@ -117,7 +116,7 @@ pub(crate) struct GlobalState {
// VFS
pub(crate) loader: Handle<Box<dyn vfs::loader::Handle>, Receiver<vfs::loader::Message>>,
pub(crate) vfs: Arc<RwLock<(vfs::Vfs, IntMap<FileId, LineEndings>)>>,
pub(crate) vfs: Arc<RwLock<(vfs::Vfs, FxHashMap<FileId, LineEndings>)>>,
pub(crate) vfs_config_version: u32,
pub(crate) vfs_progress_config_version: u32,
pub(crate) vfs_done: bool,
@ -181,7 +180,7 @@ pub(crate) struct GlobalStateSnapshot {
pub(crate) check_fixes: CheckFixes,
mem_docs: MemDocs,
pub(crate) semantic_tokens_cache: Arc<Mutex<FxHashMap<Url, SemanticTokens>>>,
vfs: Arc<RwLock<(vfs::Vfs, IntMap<FileId, LineEndings>)>>,
vfs: Arc<RwLock<(vfs::Vfs, FxHashMap<FileId, LineEndings>)>>,
pub(crate) workspaces: Arc<Vec<ProjectWorkspace>>,
// used to signal semantic highlighting to fall back to syntax based highlighting until
// proc-macros have been loaded
@ -265,7 +264,7 @@ impl GlobalState {
discover_sender,
discover_receiver,
vfs: Arc::new(RwLock::new((vfs::Vfs::default(), IntMap::default()))),
vfs: Arc::new(RwLock::new((vfs::Vfs::default(), Default::default()))),
vfs_config_version: 0,
vfs_progress_config_version: 0,
vfs_span: None,

View file

@ -1465,7 +1465,7 @@ pub(crate) fn handle_code_action(
// Fixes from `cargo check`.
for fix in snap
.check_fixes
.values()
.iter()
.flat_map(|it| it.values())
.filter_map(|it| it.get(&frange.file_id))
.flatten()

View file

@ -8,7 +8,6 @@ use std::{
time::{Duration, Instant},
};
use always_assert::always;
use crossbeam_channel::{Receiver, select};
use ide_db::base_db::{SourceDatabase, VfsPath, salsa::Database as _};
use lsp_server::{Connection, Notification, Request};
@ -845,7 +844,7 @@ impl GlobalState {
}
vfs::loader::Message::Progress { n_total, n_done, dir, config_version } => {
let _p = span!(Level::INFO, "GlobalState::handle_vfs_msg/progress").entered();
always!(config_version <= self.vfs_config_version);
stdx::always!(config_version <= self.vfs_config_version);
let (n_done, state) = match n_done {
LoadingProgress::Started => {

View file

@ -14,12 +14,14 @@ rust-version.workspace = true
[dependencies]
backtrace = { version = "0.3.67", optional = true }
jod-thread = "0.1.2"
libc.workspace = true
crossbeam-channel.workspace = true
itertools.workspace = true
tracing.workspace = true
# Think twice before adding anything here
[target.'cfg(unix)'.dependencies]
libc.workspace = true
[target.'cfg(windows)'.dependencies]
miow = "0.6.0"
windows-sys = { version = "0.59", features = ["Win32_Foundation"] }

View file

@ -13,7 +13,6 @@ rust-version.workspace = true
[dependencies]
rustc-hash.workspace = true
tracing.workspace = true
# local deps
syntax.workspace = true

View file

@ -12,12 +12,10 @@ rust-version.workspace = true
[lib]
[dependencies]
cov-mark = "2.0.0-pre.1"
either.workspace = true
itertools.workspace = true
rowan = "=0.15.15"
rustc-hash.workspace = true
indexmap.workspace = true
smol_str.workspace = true
triomphe.workspace = true
tracing.workspace = true

View file

@ -15,7 +15,6 @@ rust-version.workspace = true
# Avoid adding deps here, this crate is widely used in tests it should compile fast!
dissimilar = "1.0.7"
text-size.workspace = true
tracing.workspace = true
rustc-hash.workspace = true
paths.workspace = true