Skip to content

fix: Fix a small bug with catastrophic effects #19558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

ChayimFriedman2
Copy link
Contributor

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!

Fixes #19557.

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!
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 10, 2025
@ChayimFriedman2 ChayimFriedman2 changed the title Fix a small bug with catastrophic effects fix: Fix a small bug with catastrophic effects Apr 10, 2025
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 10, 2025
Merged via the queue into master with commit 7b21fd6 Apr 10, 2025
14 checks passed
@ChayimFriedman2 ChayimFriedman2 deleted the small-bug-catastrophic-effect branch April 10, 2025 07:00
@Veykril
Copy link
Member

Veykril commented Apr 10, 2025

Whoops, might be good to double check all those flags (and their naming), as i had a couple collisions from your tool attribute PR there

@Veykril
Copy link
Member

Veykril commented Apr 10, 2025

I kicked off another nightly given just how annoying this bug is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

call to unsafe function is unsafe and requires an unsafe function or block
3 participants