core/profiling.rs
1//! Profiling markers for compiler instrumentation.
2
3/// Profiling marker for move operations.
4///
5/// This function is never called at runtime. When `-Z annotate-moves` is enabled,
6/// the compiler creates synthetic debug info that makes move operations appear as
7/// calls to this function in profilers.
8///
9/// The `SIZE` parameter encodes the size of the type being copied. It's the same as
10/// `size_of::<T>()`, and is only present for convenience.
11#[unstable(feature = "profiling_marker_api", issue = "148197")]
12#[lang = "compiler_move"]
13#[ferrocene::annotation(
14 "This function cannot be covered as it is never called at runtime, see documentation"
15)]
16pub fn compiler_move<T, const SIZE: usize>(_src: *const T, _dst: *mut T) {
17 unreachable!(
18 "compiler_move marks where the compiler-generated a memcpy for moves. It is never actually called."
19 )
20}
21
22/// Profiling marker for copy operations.
23///
24/// This function is never called at runtime. When `-Z annotate-moves` is enabled,
25/// the compiler creates synthetic debug info that makes copy operations appear as
26/// calls to this function in profilers.
27///
28/// The `SIZE` parameter encodes the size of the type being copied. It's the same as
29/// `size_of::<T>()`, and is only present for convenience.
30#[unstable(feature = "profiling_marker_api", issue = "148197")]
31#[lang = "compiler_copy"]
32#[ferrocene::annotation(
33 "This function cannot be covered as it is never called at runtime, see documentation"
34)]
35pub fn compiler_copy<T, const SIZE: usize>(_src: *const T, _dst: *mut T) {
36 unreachable!(
37 "compiler_copy marks where the compiler-generated a memcpy for Copies. It is never actually called."
38 )
39}