From 8e51a0a75c1a551f2e2d460f1ed4727377f0ceed Mon Sep 17 00:00:00 2001 From: Kornel Date: Sat, 30 Nov 2024 20:32:00 +0000 Subject: [PATCH 1/3] Use c"lit" for CStrings without unwrap --- crates/profile/src/memory_usage.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/profile/src/memory_usage.rs b/crates/profile/src/memory_usage.rs index 660afff3dc..006748ddb0 100644 --- a/crates/profile/src/memory_usage.rs +++ b/crates/profile/src/memory_usage.rs @@ -62,15 +62,13 @@ fn memusage_linux() -> MemoryUsage { // mallinfo2 is very recent, so its presence needs to be detected at runtime. // Both are abysmally slow. - use std::ffi::CStr; use std::sync::atomic::{AtomicUsize, Ordering}; static MALLINFO2: AtomicUsize = AtomicUsize::new(1); let mut mallinfo2 = MALLINFO2.load(Ordering::Relaxed); if mallinfo2 == 1 { - let cstr = CStr::from_bytes_with_nul(b"mallinfo2\0").unwrap(); - mallinfo2 = unsafe { libc::dlsym(libc::RTLD_DEFAULT, cstr.as_ptr()) } as usize; + mallinfo2 = unsafe { libc::dlsym(libc::RTLD_DEFAULT, c"mallinfo2".as_ptr()) } as usize; // NB: races don't matter here, since they'll always store the same value MALLINFO2.store(mallinfo2, Ordering::Relaxed); } From a035c6c3fb6d16ad5a40b17e0bac17ba259f5ed5 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 4 Dec 2024 16:01:31 +0000 Subject: [PATCH 2/3] Rename `core_pattern_type` and `core_pattern_types` lib feature gates to `pattern_type_macro` That's what the gates are actually gating, and the single char difference in naming was not helpful either --- crates/ide-db/src/generated/lints.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/ide-db/src/generated/lints.rs b/crates/ide-db/src/generated/lints.rs index 266109765a..b97dfb3b8e 100644 --- a/crates/ide-db/src/generated/lints.rs +++ b/crates/ide-db/src/generated/lints.rs @@ -3936,17 +3936,8 @@ The tracking issue for this feature is: [#117693] "##, }, Lint { - label: "core_pattern_type", - description: r##"# `core_pattern_type` - -This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use. - ------------------------- -"##, - }, - Lint { - label: "core_pattern_types", - description: r##"# `core_pattern_types` + label: "pattern_type_macro", + description: r##"# `pattern_type_macro` This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use. From 0843b6f308f9b6625c1296d54d150f800d236849 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Wed, 4 Dec 2024 21:03:12 -0500 Subject: [PATCH 3/3] Remove polymorphization --- crates/hir-expand/src/inert_attr_macro.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/hir-expand/src/inert_attr_macro.rs b/crates/hir-expand/src/inert_attr_macro.rs index 95dfe56ff5..9a7a1a01a0 100644 --- a/crates/hir-expand/src/inert_attr_macro.rs +++ b/crates/hir-expand/src/inert_attr_macro.rs @@ -695,7 +695,6 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[ template!(List: r#"cfg = "...", module = "...", kind = "...""#), DuplicatesOk, ), rustc_attr!(TEST, rustc_symbol_name, Normal, template!(Word), WarnFollowing), - rustc_attr!(TEST, rustc_polymorphize_error, Normal, template!(Word), WarnFollowing), rustc_attr!(TEST, rustc_def_path, Normal, template!(Word), WarnFollowing), rustc_attr!(TEST, rustc_mir, Normal, template!(List: "arg1, arg2, ..."), DuplicatesOk), gated!(