Skip to content

Cherry-picking beta-nominated in to beta #24708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 23, 2015
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f702218
Check for shadowing between lifetimes and loop labels in function bod…
pnkfelix Apr 3, 2015
b2ac06f
Tests for shadowing between lifetimes and loop labels within function…
pnkfelix Apr 8, 2015
f1585ab
add notes clarifying introduction of warnings for a pair of run-pass …
pnkfelix Apr 21, 2015
dd90a5b
typeck: Do high-level structural/signature checks before function bod…
pnkfelix Apr 14, 2015
727b72c
Regression tests for issues that led me to revise typeck.
pnkfelix Apr 14, 2015
399b4cc
Fallout from this change.
pnkfelix Apr 14, 2015
dca9882
factor out useful helper.
pnkfelix Apr 15, 2015
c343896
Add conditional overflow-checking to signed negate operator.
pnkfelix Apr 15, 2015
378fbcd
side-step potentially panic'ing negate in `fn abs`.
pnkfelix Apr 15, 2015
e99cc02
Workaround deliberate overflowing negation in serialize::json.
pnkfelix Apr 16, 2015
be49cb6
unit test for checked overflow during signed negation.
pnkfelix Apr 17, 2015
6d4647b
std: Add Default/IntoIterator/ToOwned to the prelude
alexcrichton Apr 17, 2015
c0d2553
unstabilize Words struct
kwantam Apr 21, 2015
53dd775
std: Remove deprecated AsOsStr/Str/AsSlice traits
alexcrichton Apr 17, 2015
fd685ce
std: Remove deprecated AsPath trait
alexcrichton Apr 17, 2015
0372484
std: Remove deprecated/unstable num functionality
alexcrichton Apr 17, 2015
d8b6335
test: Fix fallout in tests
alexcrichton Apr 18, 2015
1c9aa36
std: Bring back f32::from_str_radix as an unstable API
alexcrichton Apr 18, 2015
95d02a2
Make stability attributes an error. #22830
brson Apr 21, 2015
fc74ba2
Test fixes and rebase conflicts, round 1
alexcrichton Apr 21, 2015
8b5482e
Add `Sync` to the bounds in `io::Error`
lilyball Apr 6, 2015
c4dae05
Create a struct to represent early-bound regions
nikomatsakis Apr 15, 2015
a4d37bc
Augment the constrainted parameter check to ensure that all regions
nikomatsakis Apr 15, 2015
96d927a
Rewrite constrained type params code to operate generically over
nikomatsakis Apr 15, 2015
9b1573c
Fix some missing cases
nikomatsakis Apr 17, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
side-step potentially panic'ing negate in fn abs.
pnkfelix authored and alexcrichton committed Apr 23, 2015
commit 378fbcd21f8d53e63918ada40befe1b5f62b50c3
6 changes: 5 additions & 1 deletion src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
@@ -1261,7 +1261,11 @@ macro_rules! int_impl {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn abs(self) -> $T {
if self.is_negative() { -self } else { self }
if self.is_negative() {
self.wrapping_neg()
} else {
self
}
}

/// Returns a number representing sign of `self`.