about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2020-02-06 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2020-02-06 00:00:00 +0000
commit80adde2e337f4e0d784da401b2db37c5d4d3468b (patch)
treecb806f097109369ac551ab85d73f7c65be12b2e4 /src
parent1caa8755e523d2c4d3d8d4cfd7be86f86cac3810 (diff)
downloadrust-80adde2e337f4e0d784da401b2db37c5d4d3468b.tar.gz
rust-80adde2e337f4e0d784da401b2db37c5d4d3468b.zip
Add CodegenFnAttrFlags::NO_SANITIZE_ANY
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/codegen_fn_attrs.rs2
-rw-r--r--src/librustc_typeck/collect.rs7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc/middle/codegen_fn_attrs.rs b/src/librustc/middle/codegen_fn_attrs.rs
index 5eef3fb3c57..82adcfddc28 100644
--- a/src/librustc/middle/codegen_fn_attrs.rs
+++ b/src/librustc/middle/codegen_fn_attrs.rs
@@ -78,6 +78,8 @@ bitflags! {
         const NO_SANITIZE_MEMORY  = 1 << 13;
         /// `#[no_sanitize(thread)]`: disables thread sanitizer instrumentation
         const NO_SANITIZE_THREAD  = 1 << 14;
+        /// All `#[no_sanitize(...)]` attributes.
+        const NO_SANITIZE_ANY = Self::NO_SANITIZE_ADDRESS.bits | Self::NO_SANITIZE_MEMORY.bits | Self::NO_SANITIZE_THREAD.bits;
     }
 }
 
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index 79cd769569e..5e916fc5335 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -1,3 +1,5 @@
+// ignore-tidy-filelength
+
 //! "Collection" is the process of determining the type and other external
 //! details of each item in Rust. Collection is specifically concerned
 //! with *inter-procedural* things -- for example, for a function
@@ -2942,10 +2944,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
         }
     }
 
-    let no_sanitize_flags = CodegenFnAttrFlags::NO_SANITIZE_ADDRESS
-        | CodegenFnAttrFlags::NO_SANITIZE_MEMORY
-        | CodegenFnAttrFlags::NO_SANITIZE_THREAD;
-    if codegen_fn_attrs.flags.intersects(no_sanitize_flags) {
+    if codegen_fn_attrs.flags.intersects(CodegenFnAttrFlags::NO_SANITIZE_ANY) {
         if codegen_fn_attrs.inline == InlineAttr::Always {
             if let (Some(no_sanitize_span), Some(inline_span)) = (no_sanitize_span, inline_span) {
                 let hir_id = tcx.hir().as_local_hir_id(id).unwrap();