Skip to content

Commit 80adde2

Browse files
committed
Add CodegenFnAttrFlags::NO_SANITIZE_ANY
1 parent 1caa875 commit 80adde2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/librustc/middle/codegen_fn_attrs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ bitflags! {
7878
const NO_SANITIZE_MEMORY = 1 << 13;
7979
/// `#[no_sanitize(thread)]`: disables thread sanitizer instrumentation
8080
const NO_SANITIZE_THREAD = 1 << 14;
81+
/// All `#[no_sanitize(...)]` attributes.
82+
const NO_SANITIZE_ANY = Self::NO_SANITIZE_ADDRESS.bits | Self::NO_SANITIZE_MEMORY.bits | Self::NO_SANITIZE_THREAD.bits;
8183
}
8284
}
8385

src/librustc_typeck/collect.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! "Collection" is the process of determining the type and other external
24
//! details of each item in Rust. Collection is specifically concerned
35
//! with *inter-procedural* things -- for example, for a function
@@ -2942,10 +2944,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
29422944
}
29432945
}
29442946

2945-
let no_sanitize_flags = CodegenFnAttrFlags::NO_SANITIZE_ADDRESS
2946-
| CodegenFnAttrFlags::NO_SANITIZE_MEMORY
2947-
| CodegenFnAttrFlags::NO_SANITIZE_THREAD;
2948-
if codegen_fn_attrs.flags.intersects(no_sanitize_flags) {
2947+
if codegen_fn_attrs.flags.intersects(CodegenFnAttrFlags::NO_SANITIZE_ANY) {
29492948
if codegen_fn_attrs.inline == InlineAttr::Always {
29502949
if let (Some(no_sanitize_span), Some(inline_span)) = (no_sanitize_span, inline_span) {
29512950
let hir_id = tcx.hir().as_local_hir_id(id).unwrap();

0 commit comments

Comments
 (0)