Skip to content

Commit 088037a

Browse files
committed
explained lang_item function body (count_code_region)
1 parent 5068ae1 commit 088037a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcore/intrinsics.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,12 @@ extern "rust-intrinsic" {
19431943
pub fn miri_start_panic(payload: *mut u8) -> !;
19441944
}
19451945

1946+
// Since `count_code_region` is lang_item, it must have a function body that the compiler can use
1947+
// to register its DefId with the lang_item entry. This function body is never actually called
1948+
// (and is therefore implemented as an aborting stub) because it is replaced with the
1949+
// LLVM intrinsic `llvm.instrprof.increment` by
1950+
// `rustc_codegen_llvm::intrinsic::IntrinsicCallMethods::codegen_intrinsic_call()`.
1951+
#[doc(hidden)]
19461952
#[cfg(not(bootstrap))]
19471953
#[cfg_attr(not(bootstrap), lang = "count_code_region")]
19481954
pub fn count_code_region(_index: u32) {

0 commit comments

Comments
 (0)