diff options
| author | ivan-shrimp <70307174+ivan-shrimp@users.noreply.github.com> | 2024-07-19 19:16:33 +0800 |
|---|---|---|
| committer | ivan-shrimp <70307174+ivan-shrimp@users.noreply.github.com> | 2024-07-19 19:16:33 +0800 |
| commit | 90bba8beb5cba6cbd0ff0fc92ed0a8b8ef537f8c (patch) | |
| tree | 2d56530d12c9dec77601dad44421f6317a77f2df | |
| parent | eaaed00ff53bc121dacdc3fc229b793f83d72e78 (diff) | |
| download | rust-90bba8beb5cba6cbd0ff0fc92ed0a8b8ef537f8c.tar.gz rust-90bba8beb5cba6cbd0ff0fc92ed0a8b8ef537f8c.zip | |
improve safety comment
| -rw-r--r-- | library/core/src/num/nonzero.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 2a5821c708f..d80d3241b1e 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) } } }; |
