From 197c7b3a06597f236db56a76d6b5543694d2bc74 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Tue, 27 Aug 2024 15:55:10 -0400 Subject: [PATCH] Moar --- library/core/src/slice/raw.rs | 1 + library/core/src/ub_checks.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/library/core/src/slice/raw.rs b/library/core/src/slice/raw.rs index 85507eb8a7381..9b4e3efc4704c 100644 --- a/library/core/src/slice/raw.rs +++ b/library/core/src/slice/raw.rs @@ -120,6 +120,7 @@ use crate::{array, ptr, ub_checks}; #[rustc_const_stable(feature = "const_slice_from_raw_parts", since = "1.64.0")] #[must_use] #[rustc_diagnostic_item = "slice_from_raw_parts"] +#[track_caller] pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] { // SAFETY: the caller must uphold the safety contract for `from_raw_parts`. unsafe { diff --git a/library/core/src/ub_checks.rs b/library/core/src/ub_checks.rs index c1a8c34539e6c..c07069725f6e6 100644 --- a/library/core/src/ub_checks.rs +++ b/library/core/src/ub_checks.rs @@ -65,6 +65,7 @@ macro_rules! assert_unsafe_precondition { #[inline] #[rustc_nounwind] #[rustc_const_unstable(feature = "const_ub_checks", issue = "none")] + #[track_caller] const fn precondition_check($($name:$ty),*) { if !$e { ::core::panicking::panic_nounwind(