From af49c4df0a666f3ed0cefaae63851667dde9647d Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Sat, 9 Mar 2024 12:26:48 -0500 Subject: [PATCH] NonZero::from_mut_unchecked is library UB --- library/core/src/num/nonzero.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 012f224a4a26..6cbcac20ea1b 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -368,7 +368,7 @@ where // SAFETY: The caller guarantees that `n` references a value that is non-zero, so this is unreachable. unsafe { intrinsics::assert_unsafe_precondition!( - check_language_ub, + check_library_ub, "NonZero::from_mut_unchecked requires the argument to dereference as non-zero", () => false, );