From 90bba8beb5cba6cbd0ff0fc92ed0a8b8ef537f8c Mon Sep 17 00:00:00 2001 From: ivan-shrimp <70307174+ivan-shrimp@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:16:33 +0800 Subject: [PATCH] improve safety comment --- 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 2a5821c708f1..d80d3241b1ee 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -1270,7 +1270,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods { // Inform the optimizer about it. unsafe { hint::assert_unchecked(res < 1 << (Self::BITS / 2)) }; - // SAFETY: The result is positive. + // SAFETY: The square root of an integer >= 1 is always >= 1. unsafe { Self::new_unchecked(res) } } };