Skip to content

Commit 2ae3e4c

Browse files
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!
1 parent 432a3bc commit 2ae3e4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/hir-def/src/signatures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ bitflags! {
503503
/// it if needed.
504504
const HAS_TARGET_FEATURE = 1 << 8;
505505
const DEPRECATED_SAFE_2024 = 1 << 9;
506-
const RUSTC_ALLOW_INCOHERENT_IMPLS = 1 << 9;
506+
const RUSTC_ALLOW_INCOHERENT_IMPLS = 1 << 10;
507507
}
508508
}
509509

0 commit comments

Comments
 (0)