From 0c137ab0a64b27e9bc0dc68d35ba6f5f60536a97 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 6 Jul 2016 09:29:15 -0700 Subject: [PATCH] rustc: Update stage0 to beta-2016-07-06 Hot off the presses, let's update our stage0 compiler! --- src/libcore/intrinsics.rs | 1 - src/librustc/ty/layout.rs | 4 +--- src/librustc/util/common.rs | 12 ------------ src/librustc_const_eval/check_match.rs | 3 +-- src/librustc_lint/types.rs | 3 +-- src/librustdoc/clean/inline.rs | 3 +-- src/librustdoc/html/format.rs | 3 +-- src/libstd/lib.rs | 12 ------------ src/libstd/sys/common/wtf8.rs | 4 ++-- src/libstd/sys/windows/fs.rs | 2 +- src/stage0.txt | 6 +++--- 11 files changed, 11 insertions(+), 42 deletions(-) diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 94baf188bca..cedcd986562 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -175,7 +175,6 @@ extern "rust-intrinsic" { /// that `rustc_peek(potentially_uninitialized)` would actually /// double-check that dataflow did indeed compute that it is /// uninitialized at that point in the control flow. - #[cfg(not(stage0))] pub fn rustc_peek(_: T) -> T; /// Aborts the execution of the process. diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index 61c8aa8fceb..27ed88e929e 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -17,8 +17,6 @@ use session::Session; use traits; use ty::{self, Ty, TyCtxt, TypeFoldable}; -use util::common::slice_pat; - use syntax::ast::{FloatTy, IntTy, UintTy}; use syntax::attr; use syntax_pos::DUMMY_SP; @@ -100,7 +98,7 @@ impl TargetDataLayout { let mut dl = TargetDataLayout::default(); for spec in sess.target.target.data_layout.split("-") { - match slice_pat(&&spec.split(":").collect::>()[..]) { + match &spec.split(":").collect::>()[..] { &["e"] => dl.endian = Endian::Little, &["E"] => dl.endian = Endian::Big, &["a", ref a..] => dl.aggregate_align = align(a, "a"), diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 57c429152c8..bdfb97549d5 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -247,15 +247,3 @@ pub fn path2cstr(p: &Path) -> CString { pub fn path2cstr(p: &Path) -> CString { CString::new(p.to_str().unwrap()).unwrap() } - -// FIXME(stage0): remove this -// HACK: this is needed because the interpretation of slice -// patterns changed between stage0 and now. -#[cfg(stage0)] -pub fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'a &'b [T] { - t -} -#[cfg(not(stage0))] -pub fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'b [T] { - *t -} diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index a5a9dea61ad..307a408d3e6 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -43,7 +43,6 @@ use rustc::hir::fold::{Folder, noop_fold_pat}; use rustc::hir::print::pat_to_string; use syntax::ptr::P; use rustc::util::nodemap::FnvHashMap; -use rustc::util::common::slice_pat; pub const DUMMY_WILD_PAT: &'static Pat = &Pat { id: DUMMY_NODE_ID, @@ -400,7 +399,7 @@ fn check_exhaustive<'a, 'tcx>(cx: &MatchCheckCtxt<'a, 'tcx>, hir::MatchSource::ForLoopDesugar => { // `witnesses[0]` has the form `Some()`, peel off the `Some` let witness = match witnesses[0].node { - PatKind::TupleStruct(_, ref pats, _) => match slice_pat(&&pats[..]) { + PatKind::TupleStruct(_, ref pats, _) => match &pats[..] { &[ref pat] => &**pat, _ => bug!(), }, diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 97f97a889ed..5e3ae01591d 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -16,7 +16,6 @@ use rustc::ty::{self, Ty, TyCtxt}; use middle::const_val::ConstVal; use rustc_const_eval::eval_const_expr_partial; use rustc_const_eval::EvalHint::ExprTypeChecked; -use util::common::slice_pat; use util::nodemap::{FnvHashSet}; use lint::{LateContext, LintContext, LintArray}; use lint::{LintPass, LateLintPass}; @@ -461,7 +460,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { // Check for a repr() attribute to specify the size of the // discriminant. let repr_hints = cx.lookup_repr_hints(def.did); - match slice_pat(&&**repr_hints) { + match &repr_hints[..] { &[] => { // Special-case types like `Option`. if !is_repr_nullable_ptr(cx, def, substs) { diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 8894b9732fe..3d6925041cf 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -22,7 +22,6 @@ use rustc::hir::def_id::DefId; use rustc::hir::print as pprust; use rustc::ty::{self, TyCtxt}; use rustc::ty::subst; -use rustc::util::common::slice_pat; use rustc_const_eval::lookup_const_by_id; @@ -204,7 +203,7 @@ fn build_struct<'a, 'tcx>(cx: &DocContext, tcx: TyCtxt<'a, 'tcx, 'tcx>, let variant = tcx.lookup_adt_def(did).struct_variant(); clean::Struct { - struct_type: match slice_pat(&&*variant.fields) { + struct_type: match &variant.fields[..] { &[] => doctree::Unit, &[_] if variant.kind == ty::VariantKind::Tuple => doctree::Newtype, &[..] if variant.kind == ty::VariantKind::Tuple => doctree::Tuple, diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 77c4a0f8174..11c1b8b09d2 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -20,7 +20,6 @@ use std::iter::repeat; use rustc::middle::cstore::LOCAL_CRATE; use rustc::hir::def_id::{CRATE_DEF_INDEX, DefId}; -use rustc::util::common::slice_pat; use syntax::abi::Abi; use rustc::hir; @@ -471,7 +470,7 @@ impl fmt::Display for clean::Type { decl.decl) } clean::Tuple(ref typs) => { - match slice_pat(&&**typs) { + match &typs[..] { &[] => primitive_link(f, clean::PrimitiveTuple, "()"), &[ref one] => { primitive_link(f, clean::PrimitiveTuple, "(")?; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index a396c7be09a..d05a5a09614 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -468,15 +468,3 @@ pub mod __rand { // the rustdoc documentation for primitive types. Using `include!` // because rustdoc only looks for these modules at the crate level. include!("primitive_docs.rs"); - -// FIXME(stage0): remove this after a snapshot -// HACK: this is needed because the interpretation of slice -// patterns changed between stage0 and now. -#[cfg(stage0)] -fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'a &'b [T] { - t -} -#[cfg(not(stage0))] -fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'b [T] { - *t -} diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index b6be85a4dfa..2c1a656290f 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -566,7 +566,7 @@ impl Wtf8 { if len < 3 { return None } - match ::slice_pat(&&self.bytes[(len - 3)..]) { + match &self.bytes[(len - 3)..] { &[0xED, b2 @ 0xA0...0xAF, b3] => Some(decode_surrogate(b2, b3)), _ => None } @@ -578,7 +578,7 @@ impl Wtf8 { if len < 3 { return None } - match ::slice_pat(&&self.bytes[..3]) { + match &self.bytes[..3] { &[0xED, b2 @ 0xB0...0xBF, b3] => Some(decode_surrogate(b2, b3)), _ => None } diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index c243e890526..38a17caa2f6 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -117,7 +117,7 @@ impl Drop for FindNextFileHandle { impl DirEntry { fn new(root: &Arc, wfd: &c::WIN32_FIND_DATAW) -> Option { - match ::slice_pat(&&wfd.cFileName[0..3]) { + match &wfd.cFileName[0..3] { // check for '.' and '..' &[46, 0, ..] | &[46, 46, 0, ..] => return None, diff --git a/src/stage0.txt b/src/stage0.txt index 8e46bdfc5b6..aaf88a67d27 100644 --- a/src/stage0.txt +++ b/src/stage0.txt @@ -12,6 +12,6 @@ # tarball for a stable release you'll likely see `1.x.0-$date` where `1.x.0` was # released on `$date` -rustc: beta-2016-05-24 -rustc_key: a4922355 -cargo: nightly-2016-05-22 +rustc: beta-2016-07-06 +rustc_key: 411fd48b +cargo: nightly-2016-07-05