about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-03 17:37:44 +0100
committerGitHub <noreply@github.com>2022-12-03 17:37:44 +0100
commited9a21eb0c1b18b1b108351f3154dfff432a4e3b (patch)
tree882d68ceb43fc414858cf4e03ee8baba5ec90cbb /compiler/rustc_hir_analysis/src
parenta739fc81539e22591bc43b189c5d6e8c0b1d1a03 (diff)
parentb740cdcf43f6d686f52d3f85100a0ff5ff0c043d (diff)
downloadrust-ed9a21eb0c1b18b1b108351f3154dfff432a4e3b.tar.gz
rust-ed9a21eb0c1b18b1b108351f3154dfff432a4e3b.zip
Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiser
Disable coverage instrumentation for naked functions

Fixes #105170.
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
-rw-r--r--compiler/rustc_hir_analysis/src/collect.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs
index d623e726139..b7084303aaf 100644
--- a/compiler/rustc_hir_analysis/src/collect.rs
+++ b/compiler/rustc_hir_analysis/src/collect.rs
@@ -2073,6 +2073,11 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
         }
     }
 
+    if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NAKED) {
+        codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_COVERAGE;
+        codegen_fn_attrs.inline = InlineAttr::Never;
+    }
+
     // Weak lang items have the same semantics as "std internal" symbols in the
     // sense that they're preserved through all our LTO passes and only
     // strippable by the linker.