Skip to content

add no-writable attribute and flag#154946

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

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

Conversation

@quiode
Copy link
Copy Markdown

@quiode quiode commented Apr 7, 2026

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
Copy link
Copy Markdown
Member

Kivooeo commented Apr 7, 2026

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
Copy link
Copy Markdown
Author

quiode commented Apr 7, 2026

r? @RalfJung

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 7, 2026

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
Copy link
Copy Markdown
Member

Kivooeo commented Apr 7, 2026

thanks for updating pr description for more context

@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
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