From 2ae3e4c8798d0aba7f20c7f042700e2f19e4a270 Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Thu, 10 Apr 2025 09:37:37 +0300 Subject: [PATCH] Fix a small bug with catastrophic effects The tiny bug was that `FnFlags::DEPRECTAED_SAFE_2024` and `FnFlags::RUSTC_ALLOW_INCOHERENT_IMPLS` were assigned the same value. The catastrophic effect was that every function marked as `#[rustc_allow_incoherent_impl]` was considered safe-deprecated for edition 2024, which caused it to be considered unsafe to call when called from edition 2024. And that includes `<[_]>::into_vec()`, which is called by the `vec![]` macro. So, catastrophic effect. This innocent-looking bug probably arose from the item tree rewrite. No review would've catch that! --- crates/hir-def/src/signatures.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/hir-def/src/signatures.rs b/crates/hir-def/src/signatures.rs index c0be1b7c68..86d6445e29 100644 --- a/crates/hir-def/src/signatures.rs +++ b/crates/hir-def/src/signatures.rs @@ -503,7 +503,7 @@ bitflags! { /// it if needed. const HAS_TARGET_FEATURE = 1 << 8; const DEPRECATED_SAFE_2024 = 1 << 9; - const RUSTC_ALLOW_INCOHERENT_IMPLS = 1 << 9; + const RUSTC_ALLOW_INCOHERENT_IMPLS = 1 << 10; } }