Skip to content

Fix 20.1 Miri unsafe code section#4401

Closed
abemassry wants to merge 1 commit into
rust-lang:mainfrom
abemassry:fix-20.1-miri-unsafe
Closed

Fix 20.1 Miri unsafe code section#4401
abemassry wants to merge 1 commit into
rust-lang:mainfrom
abemassry:fix-20.1-miri-unsafe

Conversation

@abemassry

Copy link
Copy Markdown

Fixes #4338 Wrong concept in subsection "Using Miri to check unsafe code" of section "20.1. Unsafe Rust"

This is a followup to PR #4062

This PR adds a working example of using Miri where the code will compile and run without warnings or errors, but with undefined behavior while it runs. After running it through Miri though it correctly identifies the data race.

Feedback welcome on matching the text to the books style. Or if anyone wants to collaborate on other examples of Miri output.

Fixes rust-lang#4338 Wrong concept in subsection "Using Miri to check unsafe code"
of section "20.1. Unsafe Rust"

This is a followup to PR rust-lang#4062

This PR adds a working example of using Miri where the code will compile
and run without warnings or errors, but with undefined behavior while it
runs. After running it through Miri though it correctly identifies the
data race.

Feedback welcome on matching the text to the books style. Or if anyone
wants to collaborate on other examples of Miri output.
@rcjsuen

rcjsuen commented Oct 3, 2025

Copy link
Copy Markdown

Thank you for creating this pull request. I just read this section and was confused by the cargo +nightly miri run output that did not show any warnings. 👍

@carols10cents

Copy link
Copy Markdown
Member

Thanks! However, we decided to fix this a different way in 6032617.

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.

Wrong concept in subsection "Using Miri to check unsafe code" of section "20.1. Unsafe Rust"

3 participants