diff --git a/src/Cargo.lock b/src/Cargo.lock index d55dd919bdf28..ad1167a90cc69 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -178,7 +178,7 @@ dependencies = [ "serde_ignored 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -202,7 +202,7 @@ dependencies = [ "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -540,7 +540,7 @@ dependencies = [ "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "xz2 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1744,7 +1744,7 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2128,7 +2128,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" "checksum syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76a302e717e348aa372ff577791c3832395650073b8d8432f8b3cb170b34afde" "checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791" -"checksum tar 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ab0ef9ead2fe0aa9e18475a96a207bfd5143f4124779ef7429503a8665416ce8" +"checksum tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "281285b717926caa919ad905ef89c63d75805c7d89437fb873100925a53f2b1b" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" "checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" "checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a" diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 6cb1d1fc4bf05..0371a68e48fc3 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -183,7 +183,7 @@ pub fn llvm(build: &Build, target: &str) { configure_compilers(&mut cfg); if env::var_os("SCCACHE_ERROR_LOG").is_some() { - cfg.env("RUST_LOG", "sccache=info"); + cfg.env("RUST_LOG", "sccache=warn"); } // FIXME: we don't actually need to build all LLVM tools and all LLVM diff --git a/src/ci/run.sh b/src/ci/run.sh index c6510120b47ae..1fb086a7ed261 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -23,6 +23,10 @@ fi ci_dir=`cd $(dirname $0) && pwd` source "$ci_dir/shared.sh" +if [ "$TRAVIS_BRANCH" != "auto" ]; then + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-quiet-tests" +fi + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-manage-submodules" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-locked-deps" diff --git a/src/libcollections/tests/lib.rs b/src/libcollections/tests/lib.rs index cda8c6d59987e..6af5a942bc34f 100644 --- a/src/libcollections/tests/lib.rs +++ b/src/libcollections/tests/lib.rs @@ -16,11 +16,11 @@ #![feature(collections)] #![feature(const_fn)] #![feature(exact_size_is_empty)] +#![feature(iterator_step_by)] #![feature(pattern)] #![feature(placement_in_syntax)] #![feature(rand)] #![feature(splice)] -#![feature(step_by)] #![feature(str_escape)] #![feature(test)] #![feature(unboxed_closures)] diff --git a/src/libcollections/tests/vec_deque.rs b/src/libcollections/tests/vec_deque.rs index f2935c05d4f7a..a992351653d7b 100644 --- a/src/libcollections/tests/vec_deque.rs +++ b/src/libcollections/tests/vec_deque.rs @@ -510,7 +510,8 @@ fn test_from_iter() { let u: Vec<_> = deq.iter().cloned().collect(); assert_eq!(u, v); - let seq = (0..).step_by(2).take(256); + // FIXME #27741: Remove `.skip(0)` when Range::step_by is fully removed + let seq = (0..).skip(0).step_by(2).take(256); let deq: VecDeque<_> = seq.collect(); for (i, &x) in deq.iter().enumerate() { assert_eq!(2 * i, x); diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 07aed65f7a057..34563c88d0ad1 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -313,6 +313,9 @@ pub use self::iterator::Iterator; pub use self::range::Step; #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[rustc_deprecated(since = "1.19.0", + reason = "replaced by `iter::StepBy`")] +#[allow(deprecated)] pub use self::range::StepBy as DeprecatedStepBy; #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index c0313333ea9ee..9aea4477fb7fc 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -252,6 +252,9 @@ step_impl_no_between!(u128 i128); #[derive(Clone, Debug)] #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[rustc_deprecated(since = "1.19.0", + reason = "replaced by `iter::StepBy`")] +#[allow(deprecated)] pub struct StepBy { step_by: A, range: R, @@ -272,6 +275,9 @@ impl ops::RangeFrom { /// ``` #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] + #[rustc_deprecated(since = "1.19.0", + reason = "replaced by `Iterator::step_by`")] + #[allow(deprecated)] pub fn step_by(self, by: A) -> StepBy { StepBy { step_by: by, @@ -297,6 +303,9 @@ impl ops::Range { /// ``` #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] + #[rustc_deprecated(since = "1.19.0", + reason = "replaced by `Iterator::step_by`")] + #[allow(deprecated)] pub fn step_by(self, by: A) -> StepBy { StepBy { step_by: by, @@ -321,6 +330,9 @@ impl ops::RangeInclusive { /// ``` #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] + #[rustc_deprecated(since = "1.19.0", + reason = "replaced by `Iterator::step_by`")] + #[allow(deprecated)] pub fn step_by(self, by: A) -> StepBy { StepBy { step_by: by, @@ -331,6 +343,7 @@ impl ops::RangeInclusive { #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[allow(deprecated)] impl Iterator for StepBy> where A: Clone, for<'a> &'a A: Add<&'a A, Output = A> @@ -351,11 +364,13 @@ impl Iterator for StepBy> where } #[unstable(feature = "fused", issue = "35602")] +#[allow(deprecated)] impl FusedIterator for StepBy> where A: Clone, for<'a> &'a A: Add<&'a A, Output = A> {} #[unstable(feature = "step_by", reason = "recent addition", issue = "27741")] +#[allow(deprecated)] impl Iterator for StepBy> { type Item = A; @@ -393,11 +408,13 @@ impl Iterator for StepBy> { } #[unstable(feature = "fused", issue = "35602")] +#[allow(deprecated)] impl FusedIterator for StepBy> {} #[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")] +#[allow(deprecated)] impl Iterator for StepBy> { type Item = A; @@ -437,6 +454,7 @@ impl Iterator for StepBy> { } #[unstable(feature = "fused", issue = "35602")] +#[allow(deprecated)] impl FusedIterator for StepBy> {} macro_rules! range_exact_iter_impl { diff --git a/src/libcore/tests/iter.rs b/src/libcore/tests/iter.rs index 44d5936c63edd..4f9951cd15399 100644 --- a/src/libcore/tests/iter.rs +++ b/src/libcore/tests/iter.rs @@ -12,6 +12,15 @@ use core::iter::*; use core::{i8, i16, isize}; use core::usize; +// FIXME #27741: This is here to simplify calling Iterator::step_by. Remove +// once Range::step_by is completely gone (not just deprecated). +trait IterEx: Sized { + fn iter_step_by(self, n: usize) -> StepBy; +} +impl IterEx for I { + fn iter_step_by(self, n: usize) -> StepBy { self.step_by(n) } +} + #[test] fn test_lt() { let empty: [isize; 0] = []; @@ -67,7 +76,7 @@ fn test_multi_iter() { #[test] fn test_counter_from_iter() { - let it = (0..).step_by(5).take(10); + let it = (0..).iter_step_by(5).take(10); let xs: Vec = FromIterator::from_iter(it); assert_eq!(xs, [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]); } @@ -85,7 +94,7 @@ fn test_iterator_chain() { } assert_eq!(i, expected.len()); - let ys = (30..).step_by(10).take(4); + let ys = (30..).iter_step_by(10).take(4); let it = xs.iter().cloned().chain(ys); let mut i = 0; for x in it { @@ -147,15 +156,13 @@ fn test_iterator_chain_find() { #[test] fn test_iterator_step_by() { // Identity - // Replace with (0..).step_by(1) after Range::step_by gets removed - let mut it = Iterator::step_by((0..), 1).take(3); + let mut it = (0..).iter_step_by(1).take(3); assert_eq!(it.next(), Some(0)); assert_eq!(it.next(), Some(1)); assert_eq!(it.next(), Some(2)); assert_eq!(it.next(), None); - // Replace with (0..).step_by(3) after Range::step_by gets removed - let mut it = Iterator::step_by((0..), 3).take(4); + let mut it = (0..).iter_step_by(3).take(4); assert_eq!(it.next(), Some(0)); assert_eq!(it.next(), Some(3)); assert_eq!(it.next(), Some(6)); @@ -166,8 +173,7 @@ fn test_iterator_step_by() { #[test] #[should_panic] fn test_iterator_step_by_zero() { - // Replace with (0..).step_by(0) after Range::step_by gets removed - let mut it = Iterator::step_by((0..), 0); + let mut it = (0..).iter_step_by(0); it.next(); } @@ -246,7 +252,7 @@ fn test_iterator_step_by_size_hint() { #[test] fn test_filter_map() { - let it = (0..).step_by(1).take(10) + let it = (0..).iter_step_by(1).take(10) .filter_map(|x| if x % 2 == 0 { Some(x*x) } else { None }); assert_eq!(it.collect::>(), [0*0, 2*2, 4*4, 6*6, 8*8]); } @@ -648,7 +654,7 @@ fn test_iterator_scan() { fn test_iterator_flat_map() { let xs = [0, 3, 6]; let ys = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - let it = xs.iter().flat_map(|&x| (x..).step_by(1).take(3)); + let it = xs.iter().flat_map(|&x| (x..).iter_step_by(1).take(3)); let mut i = 0; for x in it { assert_eq!(x, ys[i]); @@ -674,13 +680,13 @@ fn test_inspect() { #[test] fn test_cycle() { let cycle_len = 3; - let it = (0..).step_by(1).take(cycle_len).cycle(); + let it = (0..).iter_step_by(1).take(cycle_len).cycle(); assert_eq!(it.size_hint(), (usize::MAX, None)); for (i, x) in it.take(100).enumerate() { assert_eq!(i % cycle_len, x); } - let mut it = (0..).step_by(1).take(0).cycle(); + let mut it = (0..).iter_step_by(1).take(0).cycle(); assert_eq!(it.size_hint(), (0, Some(0))); assert_eq!(it.next(), None); } @@ -759,7 +765,7 @@ fn test_iterator_min() { #[test] fn test_iterator_size_hint() { - let c = (0..).step_by(1); + let c = (0..).iter_step_by(1); let v: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; let v2 = &[10, 11, 12]; let vi = v.iter(); @@ -1081,6 +1087,8 @@ fn test_range() { #[test] fn test_range_step() { + #![allow(deprecated)] + assert_eq!((0..20).step_by(5).collect::>(), [0, 5, 10, 15]); assert_eq!((20..0).step_by(-5).collect::>(), [20, 15, 10, 5]); assert_eq!((20..0).step_by(-6).collect::>(), [20, 14, 8, 2]); diff --git a/src/librustc/dep_graph/README.md b/src/librustc/dep_graph/README.md index daed41f04700d..72715cf6bc74d 100644 --- a/src/librustc/dep_graph/README.md +++ b/src/librustc/dep_graph/README.md @@ -254,7 +254,7 @@ and `...` are whatever edges the `/* compute value */` closure creates. In particular, using the memoize helper is much better than writing the obvious code yourself: -``` +```rust if let Some(result) = map.get(key) { return result; } diff --git a/src/librustc/ich/fingerprint.rs b/src/librustc/ich/fingerprint.rs index a947f6aeff709..8308c756c0532 100644 --- a/src/librustc/ich/fingerprint.rs +++ b/src/librustc/ich/fingerprint.rs @@ -8,12 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; use rustc_data_structures::stable_hasher; use std::mem; use std::slice; -#[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Clone, Copy)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Clone, Copy, RustcEncodable, RustcDecodable)] pub struct Fingerprint(u64, u64); impl Fingerprint { @@ -37,23 +36,6 @@ impl Fingerprint { } } -impl Encodable for Fingerprint { - #[inline] - fn encode(&self, s: &mut S) -> Result<(), S::Error> { - s.emit_u64(self.0.to_le())?; - s.emit_u64(self.1.to_le()) - } -} - -impl Decodable for Fingerprint { - #[inline] - fn decode(d: &mut D) -> Result { - let _0 = u64::from_le(d.read_u64()?); - let _1 = u64::from_le(d.read_u64()?); - Ok(Fingerprint(_0, _1)) - } -} - impl ::std::fmt::Display for Fingerprint { fn fmt(&self, formatter: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> { write!(formatter, "{:x}-{:x}", self.0, self.1) diff --git a/src/tools/rust-installer b/src/tools/rust-installer index 8707ceaf040f6..b4ff403041f17 160000 --- a/src/tools/rust-installer +++ b/src/tools/rust-installer @@ -1 +1 @@ -Subproject commit 8707ceaf040f6d87b67a002de16a8d2bc4db7a41 +Subproject commit b4ff403041f17957f735ad750c3241a3a428b9b7