Skip to content

Rollup of 14 pull requests #53056

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 30 commits into from
Aug 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0da7da8
Align 6-week cycle check with beta promotion instead of stable release.
kennytm Aug 1, 2018
6e63b0d
`Applicability`-ify librustc_lint
zackmdavis Aug 2, 2018
66a4718
rustbuild: fix local_rebuild
Keruspe Aug 2, 2018
3a93e91
Remove unnecessary local in await! macro
cramertj Aug 2, 2018
dda85ab
Stabilize --color and --error-format options in rustdoc
GuillaumeGomez Aug 2, 2018
23bdc82
RELEASES.md: fix the `hash_map::Entry::or_default` link
cuviper Aug 2, 2018
6a3dfa4
privacy: Fix an ICE in `path_is_private_type`
petrochenkov Aug 2, 2018
a04b2cd
Provide `{to,from}_{ne,le,be}_bytes` functions on integers
tbu- Jun 29, 2018
71460d4
volatile operations docs: clarify that this does not help wrt. concur…
RalfJung Aug 3, 2018
94de821
Specify reentrancy gurantees of `Once::call_once`
matklad Aug 3, 2018
a2f9aaf
Fix trailnig WS
matklad Aug 3, 2018
e2cda7d
Fix invalid code css rule
GuillaumeGomez Aug 3, 2018
11ffeed
Make entire row of doc search results clickable
carols10cents Aug 3, 2018
d5dd37b
Make left column of rustdoc search results narrower
carols10cents Aug 4, 2018
96179cd
Rollup merge of #52940 - kennytm:move-checktool-protection-week, r=al…
kennytm Aug 4, 2018
e82dab7
Rollup merge of #52968 - zackmdavis:app-lint-cability, r=estebank
kennytm Aug 4, 2018
a365382
Rollup merge of #52969 - Keruspe:local_rebuild, r=alexcrichton
kennytm Aug 4, 2018
59bfa8a
Rollup merge of #52995 - cramertj:smaller-await, r=withoutboats
kennytm Aug 4, 2018
035db4b
Rollup merge of #52996 - cuviper:1.28-or_default, r=Mark-Simulacrum
kennytm Aug 4, 2018
d028b3e
Rollup merge of #53001 - petrochenkov:master, r=estebank
kennytm Aug 4, 2018
7a23b5d
Rollup merge of #53003 - GuillaumeGomez:stabilize-rustdoc-options, r=…
kennytm Aug 4, 2018
aeb2028
Rollup merge of #53022 - RalfJung:volatile, r=alexcrichton
kennytm Aug 4, 2018
4341098
Rollup merge of #53024 - matklad:patch-1, r=alexcrichton
kennytm Aug 4, 2018
e8060a4
Rollup merge of #53041 - GuillaumeGomez:fix-code-css-rule, r=QuietMis…
kennytm Aug 4, 2018
aefa307
Rollup merge of #53047 - integer32llc:rustdoc-clicky-clicky, r=QuietM…
kennytm Aug 4, 2018
0ddfae5
Change tracking issue from #49792 to #51919
tbu- Aug 4, 2018
52db0ed
Rollup merge of #51919 - tbu-:pr_num_to_from_bytes2, r=SimonSapin
kennytm Aug 4, 2018
b643351
Rollup merge of #53050 - carols10cents:rustdoc-moar-room, r=Guillaume…
kennytm Aug 4, 2018
d46dca6
Remove redundant field names in structs
ljedrz Aug 4, 2018
396dda0
Rollup merge of #53062 - ljedrz:redundant_field_names, r=Mark-Simulacrum
kennytm Aug 4, 2018
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
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Compatibility Notes
[`alloc::handle_alloc_error`]: https://doc.rust-lang.org/std/alloc/fn.handle_alloc_error.html
[`btree_map::Entry::or_default`]: https://doc.rust-lang.org/std/collections/btree_map/enum.Entry.html#method.or_default
[`fmt::Alignment`]: https://doc.rust-lang.org/std/fmt/enum.Alignment.html
[`hash_map::Entry::or_default`]: https://doc.rust-lang.org/std/collections/btree_map/enum.Entry.html#method.or_default
[`hash_map::Entry::or_default`]: https://doc.rust-lang.org/std/collections/hash_map/enum.Entry.html#method.or_default
[`iter::repeat_with`]: https://doc.rust-lang.org/std/iter/fn.repeat_with.html
[`num::NonZeroUsize`]: https://doc.rust-lang.org/std/num/struct.NonZeroUsize.html
[`num::NonZeroU128`]: https://doc.rust-lang.org/std/num/struct.NonZeroU128.html
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ impl<'a> Builder<'a> {
// compiler, but for tools we just use the precompiled libraries that
// we've downloaded
let use_snapshot = mode == Mode::ToolBootstrap;
assert!(!use_snapshot || stage == 0);
assert!(!use_snapshot || stage == 0 || self.local_rebuild);

let maybe_sysroot = self.sysroot(compiler);
let sysroot = if use_snapshot {
Expand Down
10 changes: 6 additions & 4 deletions src/ci/docker/x86_64-gnu-tools/checktools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ TOOLSTATE_FILE="$(realpath $2)"
OS="$3"
COMMIT="$(git rev-parse HEAD)"
CHANGED_FILES="$(git diff --name-status HEAD HEAD^)"
SIX_WEEK_CYCLE="$(( ($(date +%s) / 604800 - 3) % 6 ))"
# ^ 1970 Jan 1st is a Thursday, and our release dates are also on Thursdays,
# thus we could divide by 604800 (7 days in seconds) directly.
SIX_WEEK_CYCLE="$(( ($(date +%s) / 86400 - 20) % 42 ))"
# ^ Number of days after the last promotion of beta.
# Its value is 41 on the Tuesday where "Promote master to beta (T-2)" happens.
# The Wednesday after this has value 0.
# We track this value to prevent regressing tools in the last week of the 6-week cycle.

touch "$TOOLSTATE_FILE"

Expand Down Expand Up @@ -98,7 +100,7 @@ change_toolstate() {
if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then
echo 'Toolstate is not changed. Not updating.'
else
if [ $SIX_WEEK_CYCLE -eq 5 ]; then
if [ $SIX_WEEK_CYCLE -ge 35 ]; then
python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed
fi
sed -i "1 a\\
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
let RefMut { value, borrow } = orig;
RefMut {
value: f(value),
borrow: borrow,
borrow,
}
}

Expand Down Expand Up @@ -1324,7 +1324,7 @@ impl<'b> BorrowRefMut<'b> {
match borrow.get() {
UNUSED => {
borrow.set(UNUSED - 1);
Some(BorrowRefMut { borrow: borrow })
Some(BorrowRefMut { borrow })
},
_ => None,
}
Expand Down Expand Up @@ -1467,7 +1467,7 @@ impl<T> UnsafeCell<T> {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub const fn new(value: T) -> UnsafeCell<T> {
UnsafeCell { value: value }
UnsafeCell { value }
}

/// Unwraps the value.
Expand Down
18 changes: 9 additions & 9 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ pub trait Iterator {
fn map<B, F>(self, f: F) -> Map<Self, F> where
Self: Sized, F: FnMut(Self::Item) -> B,
{
Map{iter: self, f: f}
Map { iter: self, f }
}

/// Calls a closure on each element of an iterator.
Expand Down Expand Up @@ -618,7 +618,7 @@ pub trait Iterator {
fn filter<P>(self, predicate: P) -> Filter<Self, P> where
Self: Sized, P: FnMut(&Self::Item) -> bool,
{
Filter{iter: self, predicate: predicate}
Filter {iter: self, predicate }
}

/// Creates an iterator that both filters and maps.
Expand Down Expand Up @@ -675,7 +675,7 @@ pub trait Iterator {
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> where
Self: Sized, F: FnMut(Self::Item) -> Option<B>,
{
FilterMap { iter: self, f: f }
FilterMap { iter: self, f }
}

/// Creates an iterator which gives the current iteration count as well as
Expand Down Expand Up @@ -828,7 +828,7 @@ pub trait Iterator {
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
Self: Sized, P: FnMut(&Self::Item) -> bool,
{
SkipWhile{iter: self, flag: false, predicate: predicate}
SkipWhile { iter: self, flag: false, predicate }
}

/// Creates an iterator that yields elements based on a predicate.
Expand Down Expand Up @@ -908,7 +908,7 @@ pub trait Iterator {
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
Self: Sized, P: FnMut(&Self::Item) -> bool,
{
TakeWhile{iter: self, flag: false, predicate: predicate}
TakeWhile { iter: self, flag: false, predicate }
}

/// Creates an iterator that skips the first `n` elements.
Expand All @@ -930,7 +930,7 @@ pub trait Iterator {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn skip(self, n: usize) -> Skip<Self> where Self: Sized {
Skip{iter: self, n: n}
Skip { iter: self, n }
}

/// Creates an iterator that yields its first `n` elements.
Expand Down Expand Up @@ -962,7 +962,7 @@ pub trait Iterator {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn take(self, n: usize) -> Take<Self> where Self: Sized, {
Take{iter: self, n: n}
Take { iter: self, n }
}

/// An iterator adaptor similar to [`fold`] that holds internal state and
Expand Down Expand Up @@ -1007,7 +1007,7 @@ pub trait Iterator {
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where Self: Sized, F: FnMut(&mut St, Self::Item) -> Option<B>,
{
Scan{iter: self, f: f, state: initial_state}
Scan { iter: self, f, state: initial_state }
}

/// Creates an iterator that works like map, but flattens nested structure.
Expand Down Expand Up @@ -1256,7 +1256,7 @@ pub trait Iterator {
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
Self: Sized, F: FnMut(&Self::Item),
{
Inspect{iter: self, f: f}
Inspect { iter: self, f }
}

/// Borrows an iterator, rather than consuming it.
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/dec2flt/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct Decimal<'a> {

impl<'a> Decimal<'a> {
pub fn new(integral: &'a [u8], fractional: &'a [u8], exp: i64) -> Decimal<'a> {
Decimal { integral: integral, fractional: fractional, exp: exp }
Decimal { integral, fractional, exp }
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/libcore/num/dec2flt/rawfp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub struct Unpacked {

impl Unpacked {
pub fn new(sig: u64, k: i16) -> Self {
Unpacked { sig: sig, k: k }
Unpacked { sig, k }
}
}

Expand Down Expand Up @@ -317,13 +317,13 @@ pub fn big_to_fp(f: &Big) -> Fp {
// We cut off all bits prior to the index `start`, i.e., we effectively right-shift by
// an amount of `start`, so this is also the exponent we need.
let e = start as i16;
let rounded_down = Fp { f: leading, e: e }.normalize();
let rounded_down = Fp { f: leading, e }.normalize();
// Round (half-to-even) depending on the truncated bits.
match num::compare_with_half_ulp(f, start) {
Less => rounded_down,
Equal if leading % 2 == 0 => rounded_down,
Equal | Greater => match leading.checked_add(1) {
Some(f) => Fp { f: f, e: e }.normalize(),
Some(f) => Fp { f, e }.normalize(),
None => Fp { f: 1 << 63, e: e + 1 },
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/num/diy_float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Fp {
let tmp = (bd >> 32) + (ad & MASK) + (bc & MASK) + (1 << 31) /* round */;
let f = ac + (ad >> 32) + (bc >> 32) + (tmp >> 32);
let e = self.e + other.e + 64;
Fp { f: f, e: e }
Fp { f, e }
}

/// Normalizes itself so that the resulting mantissa is at least `2^63`.
Expand Down Expand Up @@ -74,7 +74,7 @@ impl Fp {
e -= 1;
}
debug_assert!(f >= (1 >> 63));
Fp { f: f, e: e }
Fp { f, e }
}

/// Normalizes itself to have the shared exponent.
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/num/flt2dec/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ pub fn decode<T: DecodableFloat>(v: T) -> (/*negative?*/ bool, FullDecoded) {
// neighbors: (mant - 2, exp) -- (mant, exp) -- (mant + 2, exp)
// Float::integer_decode always preserves the exponent,
// so the mantissa is scaled for subnormals.
FullDecoded::Finite(Decoded { mant: mant, minus: 1, plus: 1,
exp: exp, inclusive: even })
FullDecoded::Finite(Decoded { mant, minus: 1, plus: 1,
exp, inclusive: even })
}
FpCategory::Normal => {
let minnorm = <T as DecodableFloat>::min_pos_norm_value().integer_decode();
Expand Down
36 changes: 18 additions & 18 deletions src/libcore/num/flt2dec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,20 @@ pub fn to_shortest_str<'a, T, F>(mut format_shortest: F, v: T,
match full_decoded {
FullDecoded::Nan => {
parts[0] = Part::Copy(b"NaN");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Infinite => {
parts[0] = Part::Copy(b"inf");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Zero => {
if frac_digits > 0 { // [0.][0000]
parts[0] = Part::Copy(b"0.");
parts[1] = Part::Zero(frac_digits);
Formatted { sign: sign, parts: &parts[..2] }
Formatted { sign, parts: &parts[..2] }
} else {
parts[0] = Part::Copy(b"0");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
}
FullDecoded::Finite(ref decoded) => {
Expand Down Expand Up @@ -480,19 +480,19 @@ pub fn to_shortest_exp_str<'a, T, F>(mut format_shortest: F, v: T,
match full_decoded {
FullDecoded::Nan => {
parts[0] = Part::Copy(b"NaN");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Infinite => {
parts[0] = Part::Copy(b"inf");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Zero => {
parts[0] = if dec_bounds.0 <= 0 && 0 < dec_bounds.1 {
Part::Copy(b"0")
} else {
Part::Copy(if upper { b"0E0" } else { b"0e0" })
};
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Finite(ref decoded) => {
let (len, exp) = format_shortest(decoded, buf);
Expand All @@ -502,7 +502,7 @@ pub fn to_shortest_exp_str<'a, T, F>(mut format_shortest: F, v: T,
} else {
digits_to_exp_str(&buf[..len], exp, 0, upper, parts)
};
Formatted { sign: sign, parts: parts }
Formatted { sign, parts }
}
}
}
Expand Down Expand Up @@ -558,21 +558,21 @@ pub fn to_exact_exp_str<'a, T, F>(mut format_exact: F, v: T,
match full_decoded {
FullDecoded::Nan => {
parts[0] = Part::Copy(b"NaN");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Infinite => {
parts[0] = Part::Copy(b"inf");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Zero => {
if ndigits > 1 { // [0.][0000][e0]
parts[0] = Part::Copy(b"0.");
parts[1] = Part::Zero(ndigits - 1);
parts[2] = Part::Copy(if upper { b"E0" } else { b"e0" });
Formatted { sign: sign, parts: &parts[..3] }
Formatted { sign, parts: &parts[..3] }
} else {
parts[0] = Part::Copy(if upper { b"0E0" } else { b"0e0" });
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
}
FullDecoded::Finite(ref decoded) => {
Expand Down Expand Up @@ -613,20 +613,20 @@ pub fn to_exact_fixed_str<'a, T, F>(mut format_exact: F, v: T,
match full_decoded {
FullDecoded::Nan => {
parts[0] = Part::Copy(b"NaN");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Infinite => {
parts[0] = Part::Copy(b"inf");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
FullDecoded::Zero => {
if frac_digits > 0 { // [0.][0000]
parts[0] = Part::Copy(b"0.");
parts[1] = Part::Zero(frac_digits);
Formatted { sign: sign, parts: &parts[..2] }
Formatted { sign, parts: &parts[..2] }
} else {
parts[0] = Part::Copy(b"0");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
}
FullDecoded::Finite(ref decoded) => {
Expand All @@ -646,10 +646,10 @@ pub fn to_exact_fixed_str<'a, T, F>(mut format_exact: F, v: T,
if frac_digits > 0 { // [0.][0000]
parts[0] = Part::Copy(b"0.");
parts[1] = Part::Zero(frac_digits);
Formatted { sign: sign, parts: &parts[..2] }
Formatted { sign, parts: &parts[..2] }
} else {
parts[0] = Part::Copy(b"0");
Formatted { sign: sign, parts: &parts[..1] }
Formatted { sign, parts: &parts[..1] }
}
} else {
Formatted { sign,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/flt2dec/strategy/grisu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub fn cached_power(alpha: i16, gamma: i16) -> (i16, Fp) {
let idx = ((gamma as i32) - offset) * range / domain;
let (f, e, k) = CACHED_POW10[idx as usize];
debug_assert!(alpha <= e && e <= gamma);
(k, Fp { f: f, e: e })
(k, Fp { f, e })
}

/// Given `x > 0`, returns `(k, 10^k)` such that `10^k <= x < 10^(k+1)`.
Expand Down
Loading