mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 22:53:28 +00:00
Rollup merge of #86367 - m-ou-se:fix-abs-comment, r=scottmcm
Fix comment about rustc_inherit_overflow_checks in abs().
This commit is contained in:
commit
8389cd3a1a
@ -1772,9 +1772,9 @@ macro_rules! int_impl {
|
|||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_inherit_overflow_checks]
|
#[rustc_inherit_overflow_checks]
|
||||||
pub const fn abs(self) -> Self {
|
pub const fn abs(self) -> Self {
|
||||||
// Note that the #[inline] above means that the overflow
|
// Note that the #[rustc_inherit_overflow_checks] and #[inline]
|
||||||
// semantics of the subtraction depend on the crate we're being
|
// above mean that the overflow semantics of the subtraction
|
||||||
// inlined into.
|
// depend on the crate we're being called from.
|
||||||
if self.is_negative() {
|
if self.is_negative() {
|
||||||
-self
|
-self
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user