Skip to content

add no-writable attribute and flag#154946

Closed
quiode wants to merge 2 commits into
rust-lang:mainfrom
quiode:no-writable
Closed

add no-writable attribute and flag#154946
quiode wants to merge 2 commits into
rust-lang:mainfrom
quiode:no-writable

Conversation

@quiode

@quiode quiode commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

This PR tries to address rust-lang/unsafe-code-guidelines#584 (comment). It is part of a bachelor thesis supervised by @JoJoDeveloping and @RalfJung, for more information, see: Project_Description.pdf.
This PR adds the #[rustc_no_writable] attribute and the -Zno-writable flag. They currently have no effect, but are used in #154948 and #154949. The flag should have the same effect as the attribute, just applied globally instead of a per function basis. They should turn off the checking in miri and the addition of the llvm attribute in, better explained in the respective PR's.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 7, 2026
@Kivooeo

Kivooeo commented Apr 7, 2026

Copy link
Copy Markdown
Member

hi, thanks for you contribution and sorry for the following quesitons, but

why is this needed? is there proposal for adding this or maybe issue explaining the problem that this pr is trying to address?

@quiode

quiode commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

r? @RalfJung

@rustbot

rustbot commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

RalfJung is not on the review rotation at the moment.
They may take a while to respond.

@rust-log-analyzer

This comment has been minimized.

@Kivooeo

Kivooeo commented Apr 7, 2026

Copy link
Copy Markdown
Member

thanks for updating pr description for more context

Comment thread src/doc/unstable-book/src/compiler-flags/no-writable.md Outdated
@rust-bors

This comment has been minimized.

Co-authored-by: Redddy <midzy0228@gmail.com>
@quiode quiode closed this Apr 8, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 8, 2026
@quiode quiode deleted the no-writable branch April 29, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants