Skip to content

Deny unsafe operations in unsafe functions - #771

Open
akashchamp wants to merge 1 commit into
rust-lang:mainfrom
akashchamp:deny-unsafe-op-in-unsafe-fn
Open

akashchamp wants to merge 1 commit into
rust-lang:mainfrom
akashchamp:deny-unsafe-op-in-unsafe-fn

Conversation

@akashchamp

@akashchamp akashchamp commented Sep 11, 2026 •

Copy link
Copy Markdown

Fixes #643

Enable unsafe_op_in_unsafe_fn at the crate root so unsafe operations inside unsafe functions remain explicitly marked. This is explicitly done despite it being implied by edition so it does not vary based on whether it is a separate crate or included in another crate via #[path] hacks.

Signed-off-by: Akash Kumar <116457960+akashchamp@users.noreply.github.com>
@akashchamp

Copy link
Copy Markdown
Author

The two red i686-msvc jobs die in the rustup install step on the new windows-2025 runner image ("toolchain 'stable-i686-msvc' may not be able to run on this system") before any code is built, and #755 fails the same way, so it looks like a CI image regression rather than something from this change. I checked i686-pc-windows-msvc, x86_64-pc-windows-msvc, i686-pc-windows-gnu and aarch64-pc-windows-msvc locally with RUSTFLAGS=-Dwarnings and they all compile clean with the lint denied.

@akashchamp
akashchamp force-pushed the deny-unsafe-op-in-unsafe-fn branch from 83fef93 to f7bc909 Compare October 7, 2026 15:21
@workingjubilee

Copy link
Copy Markdown
Member

I am surprised this just works!

@workingjubilee

workingjubilee commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

...using, afaict, an LLM to generate even a trivial PR (come on, Tests: with 10 random compiler commands, all specifying a version that is neither the current stable nor does it match the MSRV of the crate???), and then adding every single repo you've committed even once to, to a list on your profile page, feels very gauche, to a degree that makes me feel uncomfortable hitting merge on this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deny(unsafe_op_in_unsafe_fn) in backtrace-rs

2 participants