mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-02 17:44:28 +00:00
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.
19 lines
535 B
Rust
19 lines
535 B
Rust
//! Basic structs that end up being used in attributes for one reason or another,
|
|
//! but are not used exclusively in or around attributes.
|
|
#![deny(unstable_features, reason = "ends up in dependencies of rust-analyzer")]
|
|
|
|
mod collapse_macro_debug_info;
|
|
mod crate_type;
|
|
mod limit;
|
|
mod native_lib_kind;
|
|
mod sanitizer_set;
|
|
|
|
pub use collapse_macro_debug_info::CollapseMacroDebuginfo;
|
|
pub use crate_type::CrateType;
|
|
pub use limit::Limit;
|
|
pub use native_lib_kind::NativeLibKind;
|
|
pub use sanitizer_set::SanitizerSet;
|
|
|
|
#[cfg(test)]
|
|
mod tests;
|