unstable book: in a sanitizer example, check the code by folkertdev · Pull Request #139113 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

folkertdev

Use some # directives to make sure the code checks on x86_64, and does not produce errors on other platforms. This example still used an older version of #[naked], and because the snippet was ignored that was missed before.

I'm not sure when this gets built on CI exactly, so it might be worthwhile to try and build it for a non-x86_64 architecture to make sure that works. I'm not sure how to verify locally that e.g. on aarch64 this code works without errors/warnings.

try-job: aarch64-apple

@rustbot

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot

Some changes occurred in src/doc/unstable-book/src/compiler-flags/sanitizer.md

cc @rust-lang/project-exploit-mitigations, @rcvalle

GuillaumeGomez

@GuillaumeGomez

Nice trick, thanks!

@bors r+ rollup

@bors

📌 Commit b00b6a8 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Mar 30, 2025

jhpratt added a commit to jhpratt/rust that referenced this pull request

Mar 30, 2025

@jhpratt

…-check-block, r=GuillaumeGomez

unstable book: in a sanitizer example, check the code

Use some # directives to make sure the code checks on x86_64, and does not produce errors on other platforms. This example still used an older version of #[naked], and because the snippet was ignored that was missed before.

I'm not sure when this gets built on CI exactly, so it might be worthwhile to try and build it for a non-x86_64 architecture to make sure that works. I'm not sure how to verify locally that e.g. on aarch64 this code works without errors/warnings.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 30, 2025

@bors

Rollup of 6 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

@jhpratt

@bors bors added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Mar 30, 2025

@folkertdev

platforms are hard...

This now runs the example just on x86_64: it already used x86_64 inline assembly, so the code was kind of meaningless on any other platform. The goal of the unstable book is not really to test the behavior, but more that the example compiles and is up-to-date, so this seemed like the best option to me.

@rustbot ready

I also added a try build to make sure this actually works on non-x86_64.

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Apr 1, 2025

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@folkertdev

this uses some # directives to make sure the code works on x86_64, and does not produce errors on other platforms

@bors