Skip to content

Commit

Permalink
Moar
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Aug 27, 2024
1 parent 18e2a95 commit 197c7b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/slice/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions library/core/src/ub_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 197c7b3

Please sign in to comment.