Commit Graph

9 Commits

Author SHA1 Message Date
Leonard Chan
868bc2a074 sanitizers: Implicitly disable mutually exclusive sanitizers
This attempts to match clang's behavior of implicitly disabling
sanitizers that are incompatible. Specifically, if a set of default
sanitizers would be incompatible with ones provided by -Zsanitize=...,
then clang (and now rust) will opt for keeping the ones specified via
flags over the ones used as platform defaults. This helps maintain build
consistency where we can just enable sanitizers via flags for both rust and
c++ code without needing to manually disable others.

The driving reason for this is asan and safestack where we'd like to
enable safestack by default for x86_64 fuchsia but disable it if
-Zsanitize=address is passed (matching clang's behavior).

This commit also refactors all uses of `self.opts.unstable_opts.sanitizer`
to go through the updated `sanitizer()` method.

AI: Gemini was used to help review the code and write some tests, but it
did not generate the whole patch. I edited and reviewed this PR to the
best of my ability before pushing for review.
2026-08-28 22:47:24 +00:00
mejrs
587412a264 Add crate docs 2026-08-21 10:35:11 +02:00
mejrs
7bec351981 move CollapseMacroDebuginfo 2026-08-21 10:35:10 +02:00
mejrs
8d970ffe69 Move NativeLibKind 2026-08-21 10:35:04 +02:00
mejrs
38af4a23c2 move CrateType 2026-08-21 10:35:02 +02:00
mejrs
f713bb2185 invert dependency on rustc_error_messages 2026-08-21 10:33:59 +02:00
mejrs
29dba3e326 make nightly feature 2026-08-21 10:33:58 +02:00
mejrs
2a20dfa922 move SanitizerSet 2026-08-21 10:33:58 +02:00
mejrs
589bb91122 Move Limit 2026-08-21 10:33:56 +02:00