Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ fn parse_sanitize_attr(
}

fn disabled_sanitizers_for(tcx: TyCtxt<'_>, did: LocalDefId) -> SanitizerSet {
// No need to evaluate the sanitizer attribute if no sanitizer is enabled.
if tcx.sess.opts.unstable_opts.sanitizer.is_empty() {
return SanitizerSet::empty();
}

// Backtrack to the crate root.
let disabled = match tcx.opt_local_parent(did) {
// Check the parent (recursively).
Expand Down
Loading