diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-01-05 22:44:30 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-05 22:44:30 +0530 |
| commit | 59f8ba3a4e7f43be18e400e83c146bc87975cd4b (patch) | |
| tree | 5c59a38dac1bdcbf1ff84c60f02d2021ff61a0a2 /src/libcore | |
| parent | 3548d983d23ac8db42b725d1f680d1a1eddf19ad (diff) | |
| parent | 525cd2d7c117a925d6b9976ad142ff5e63208dc9 (diff) | |
| download | rust-59f8ba3a4e7f43be18e400e83c146bc87975cd4b.tar.gz rust-59f8ba3a4e7f43be18e400e83c146bc87975cd4b.zip | |
Rollup merge of #67845 - jumbatm:also-unconst-hack-abs, r=oli-obk
Also remove const-hack for abs Closes #67842. r? @oli-obk
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/num/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 605ab98219f..b6b4a46e0b8 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2001,6 +2001,9 @@ $EndFeature, " #[inline] #[rustc_inherit_overflow_checks] pub const fn abs(self) -> Self { + // Note that the #[inline] above means that the overflow + // semantics of the subtraction depend on the crate we're being + // inlined into. if self.is_negative() { -self } else { |
