about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorRich Kadel <richkadel@google.com>2020-06-04 17:52:27 -0700
committerRich Kadel <richkadel@google.com>2020-06-15 16:50:10 -0700
commit2c5c2a6bc2f7023ee8ad252d2ee5a45fbfb2de22 (patch)
tree0c3b234d3358dd9209faeca31afd411397dd3892 /src/libcore
parent088037a04414dee0b3a792a6fad193e081ee8e37 (diff)
downloadrust-2c5c2a6bc2f7023ee8ad252d2ee5a45fbfb2de22.tar.gz
rust-2c5c2a6bc2f7023ee8ad252d2ee5a45fbfb2de22.zip
removed experiments for cleaner github PR
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 0e5af35229c..06a432a2696 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -1943,16 +1943,17 @@ extern "rust-intrinsic" {
     pub fn miri_start_panic(payload: *mut u8) -> !;
 }
 
-// Since `count_code_region` is lang_item, it must have a function body that the compiler can use
-// to register its DefId with the lang_item entry. This function body is never actually called
-// (and is therefore implemented as an aborting stub) because it is replaced with the
-// LLVM intrinsic `llvm.instrprof.increment` by
-// `rustc_codegen_llvm::intrinsic::IntrinsicCallMethods::codegen_intrinsic_call()`.
-#[doc(hidden)]
+/// Defines the `count_code_region` intrinsic as a `LangItem`. `LangItem`s require a function body
+/// to register its DefId with the LangItem entry. The function body is never actually called (and
+/// is therefore implemented as an aborting stub) because it is replaced with the LLVM intrinsic
+/// `llvm.instrprof.increment` by
+/// `rustc_codegen_llvm::intrinsic::IntrinsicCallMethods::codegen_intrinsic_call()`.
 #[cfg(not(bootstrap))]
 #[cfg_attr(not(bootstrap), lang = "count_code_region")]
-pub fn count_code_region(_index: u32) {
-    #[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
+fn count_code_region(_index: u32) {
+    // remove `unsafe` (and safety comment) on bootstrap bump
+    #[cfg_attr(not(bootstrap), allow(unused_unsafe))]
+    // SAFETY: the `abort` intrinsic has no requirements to be called.
     unsafe {
         abort()
     }