Skip to content

Commit 197c7b3

Browse files
committed
Moar
1 parent 18e2a95 commit 197c7b3

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/core/src/slice/raw.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ use crate::{array, ptr, ub_checks};
120120
#[rustc_const_stable(feature = "const_slice_from_raw_parts", since = "1.64.0")]
121121
#[must_use]
122122
#[rustc_diagnostic_item = "slice_from_raw_parts"]
123+
#[track_caller]
123124
pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] {
124125
// SAFETY: the caller must uphold the safety contract for `from_raw_parts`.
125126
unsafe {

library/core/src/ub_checks.rs

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ macro_rules! assert_unsafe_precondition {
6565
#[inline]
6666
#[rustc_nounwind]
6767
#[rustc_const_unstable(feature = "const_ub_checks", issue = "none")]
68+
#[track_caller]
6869
const fn precondition_check($($name:$ty),*) {
6970
if !$e {
7071
::core::panicking::panic_nounwind(

0 commit comments

Comments
 (0)