about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-07-07 08:24:10 +0200
committerLukas Wirth <lukastw97@gmail.com>2024-07-07 08:24:10 +0200
commit20dc1b615d39e26a4083967b27823680a5e2e12e (patch)
tree5bfc6a345a862509ba24356a77f0d5b08e25abce
parentfaa13cbe20809b3f5cf493bfc31c08aecd9cea0f (diff)
downloadrust-20dc1b615d39e26a4083967b27823680a5e2e12e.tar.gz
rust-20dc1b615d39e26a4083967b27823680a5e2e12e.zip
Drop unused profile things
-rw-r--r--src/tools/rust-analyzer/Cargo.lock10
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/Cargo.toml1
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs4
-rw-r--r--src/tools/rust-analyzer/crates/ide/src/status.rs3
-rw-r--r--src/tools/rust-analyzer/crates/profile/Cargo.toml4
-rw-r--r--src/tools/rust-analyzer/crates/profile/src/lib.rs7
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs4
7 files changed, 0 insertions, 33 deletions
diff --git a/src/tools/rust-analyzer/Cargo.lock b/src/tools/rust-analyzer/Cargo.lock
index f30f69eb6eb..c63d6595432 100644
--- a/src/tools/rust-analyzer/Cargo.lock
+++ b/src/tools/rust-analyzer/Cargo.lock
@@ -221,11 +221,6 @@ name = "countme"
 version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
-dependencies = [
- "dashmap",
- "once_cell",
- "rustc-hash",
-]
 
 [[package]]
 name = "cov-mark"
@@ -548,7 +543,6 @@ dependencies = [
  "limit",
  "mbe",
  "once_cell",
- "profile",
  "ra-ap-rustc_abi",
  "ra-ap-rustc_parse_format",
  "rustc-hash",
@@ -1400,13 +1394,9 @@ name = "profile"
 version = "0.0.0"
 dependencies = [
  "cfg-if",
- "countme",
- "la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc",
- "once_cell",
  "perf-event",
  "tikv-jemalloc-ctl",
- "tracing",
  "windows-sys 0.52.0",
 ]
 
diff --git a/src/tools/rust-analyzer/crates/hir-def/Cargo.toml b/src/tools/rust-analyzer/crates/hir-def/Cargo.toml
index 41c59ea0d93..660799d6108 100644
--- a/src/tools/rust-analyzer/crates/hir-def/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/hir-def/Cargo.toml
@@ -37,7 +37,6 @@ stdx.workspace = true
 intern.workspace = true
 base-db.workspace = true
 syntax.workspace = true
-profile.workspace = true
 hir-expand.workspace = true
 mbe.workspace = true
 cfg.workspace = true
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs b/src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs
index 9c7dfa05b0e..d86c0667a0b 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs
@@ -8,7 +8,6 @@ use hir_expand::{attrs::AttrId, db::ExpandDatabase, name::Name, AstId, MacroCall
 use itertools::Itertools;
 use la_arena::Idx;
 use once_cell::sync::Lazy;
-use profile::Count;
 use rustc_hash::{FxHashMap, FxHashSet};
 use smallvec::{smallvec, SmallVec};
 use stdx::format_to;
@@ -65,8 +64,6 @@ pub struct ImportId {
 
 #[derive(Debug, Default, PartialEq, Eq)]
 pub struct ItemScope {
-    _c: Count<Self>,
-
     /// Defs visible in this scope. This includes `declarations`, but also
     /// imports. The imports belong to this module and can be resolved by using them on
     /// the `use_imports_*` fields.
@@ -722,7 +719,6 @@ impl ItemScope {
     pub(crate) fn shrink_to_fit(&mut self) {
         // Exhaustive match to require handling new fields.
         let Self {
-            _c: _,
             types,
             values,
             macros,
diff --git a/src/tools/rust-analyzer/crates/ide/src/status.rs b/src/tools/rust-analyzer/crates/ide/src/status.rs
index 8e7767c8e5d..69526ddef91 100644
--- a/src/tools/rust-analyzer/crates/ide/src/status.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/status.rs
@@ -44,9 +44,6 @@ pub(crate) fn status(db: &RootDatabase, file_id: Option<FileId>) -> String {
     format_to!(buf, "{}\n", collect_query(LibrarySymbolsQuery.in_db(db)));
     format_to!(buf, "{}\n", collect_query(ModuleSymbolsQuery.in_db(db)));
     format_to!(buf, "{} in total\n", memory_usage());
-    if env::var("RA_COUNT").is_ok() {
-        format_to!(buf, "\nCounts:\n{}", profile::countme::get_all());
-    }
 
     format_to!(buf, "\nDebug info:\n");
     format_to!(buf, "{}\n", collect_query(AttrsQuery.in_db(db)));
diff --git a/src/tools/rust-analyzer/crates/profile/Cargo.toml b/src/tools/rust-analyzer/crates/profile/Cargo.toml
index 11a8e7af56a..5989dc6c962 100644
--- a/src/tools/rust-analyzer/crates/profile/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/profile/Cargo.toml
@@ -12,12 +12,8 @@ rust-version.workspace = true
 doctest = false
 
 [dependencies]
-once_cell = "1.17.0"
-tracing.workspace = true
 cfg-if = "1.0.0"
-la-arena.workspace = true
 libc.workspace = true
-countme = { version = "3.0.1", features = ["enable"] }
 jemalloc-ctl = { version = "0.5.0", package = "tikv-jemalloc-ctl", optional = true }
 
 [target.'cfg(target_os = "linux")'.dependencies]
diff --git a/src/tools/rust-analyzer/crates/profile/src/lib.rs b/src/tools/rust-analyzer/crates/profile/src/lib.rs
index c1ae0d43d07..205341f162d 100644
--- a/src/tools/rust-analyzer/crates/profile/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/profile/src/lib.rs
@@ -12,13 +12,6 @@ pub use crate::{
     stop_watch::{StopWatch, StopWatchSpan},
 };
 
-pub use countme;
-/// Include `_c: Count<Self>` field in important structs to count them.
-///
-/// To view the counts, run with `RA_COUNT=1`. The overhead of disabled count is
-/// almost zero.
-pub use countme::Count;
-
 thread_local!(static IN_SCOPE: RefCell<bool> = const { RefCell::new(false) });
 
 /// A wrapper around google_cpu_profiler.
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs
index a934e14ddb3..c9c19806bef 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -250,10 +250,6 @@ impl flags::AnalysisStats {
         }
         report_metric("total memory", total_span.memory.allocated.megabytes() as u64, "MB");
 
-        if env::var("RA_COUNT").is_ok() {
-            eprintln!("{}", profile::countme::get_all());
-        }
-
         if self.source_stats {
             let mut total_file_size = Bytes::default();
             for e in ide_db::base_db::ParseQuery.in_db(db).entries::<Vec<_>>() {