-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-sanitizersArea: Sanitizers for correctness and code qualityArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.Category: This is a bug.F-target_modifiers`#![feature(target_modifiers)]``#![feature(target_modifiers)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried these commands (following the sanitizer tutorial) on the code at https://github.com/gendx/paralight/tree/791d03a794b3c2089186979687065d107532fc93:
export RUSTFLAGS="-Zsanitizer=thread"
export RUSTDOCFLAGS="-Zsanitizer=thread"
cargo +nightly test --release -Zbuild-std --target=x86_64-unknown-linux-gnu
I expected to see this happen: tests should run with thread sanitizer enabled.
Instead, this happened: regular tests ran fine, but doc tests failed to compile with the following error. In particular, "help: set -Zsanitizer=thread
in this crate" is strange given that I've set RUSTDOCFLAGS="-Zsanitizer=thread".
error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `paralight`
--> src/lib.rs:9:1
|
9 | #![doc = include_str!("../README.md")]
| ^
|
= help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely
= note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=thread` in dependency `std`
= help: set `-Zsanitizer=thread` in this crate or unset `-Zsanitizer` in `std`
= help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error
I suspect this might be related to #138736 or more broadly the work tracked in #138453.
Meta
rustc +nightly --version --verbose
:
rustc 1.91.0-nightly (5eda692e7 2025-09-11)
binary: rustc
commit-hash: 5eda692e73f37dcbe2437ce878db7bb71f323e74
commit-date: 2025-09-11
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 21.1.1
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-sanitizersArea: Sanitizers for correctness and code qualityArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.Category: This is a bug.F-target_modifiers`#![feature(target_modifiers)]``#![feature(target_modifiers)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Status
No status