Skip to content

Commit 7ad125c

Browse files
authored
Auto merge of #34686 - alexcrichton:new-stage, r=luqmana
rustc: Update stage0 to beta-2016-07-06 Hot off the presses, let's update our stage0 compiler!
2 parents 3ab8054 + 0c137ab commit 7ad125c

File tree

11 files changed

+11
-42
lines changed

11 files changed

+11
-42
lines changed

src/libcore/intrinsics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ extern "rust-intrinsic" {
175175
/// that `rustc_peek(potentially_uninitialized)` would actually
176176
/// double-check that dataflow did indeed compute that it is
177177
/// uninitialized at that point in the control flow.
178-
#[cfg(not(stage0))]
179178
pub fn rustc_peek<T>(_: T) -> T;
180179

181180
/// Aborts the execution of the process.

src/librustc/ty/layout.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ use session::Session;
1717
use traits;
1818
use ty::{self, Ty, TyCtxt, TypeFoldable};
1919

20-
use util::common::slice_pat;
21-
2220
use syntax::ast::{FloatTy, IntTy, UintTy};
2321
use syntax::attr;
2422
use syntax_pos::DUMMY_SP;
@@ -100,7 +98,7 @@ impl TargetDataLayout {
10098

10199
let mut dl = TargetDataLayout::default();
102100
for spec in sess.target.target.data_layout.split("-") {
103-
match slice_pat(&&spec.split(":").collect::<Vec<_>>()[..]) {
101+
match &spec.split(":").collect::<Vec<_>>()[..] {
104102
&["e"] => dl.endian = Endian::Little,
105103
&["E"] => dl.endian = Endian::Big,
106104
&["a", ref a..] => dl.aggregate_align = align(a, "a"),

src/librustc/util/common.rs

-12
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,3 @@ pub fn path2cstr(p: &Path) -> CString {
247247
pub fn path2cstr(p: &Path) -> CString {
248248
CString::new(p.to_str().unwrap()).unwrap()
249249
}
250-
251-
// FIXME(stage0): remove this
252-
// HACK: this is needed because the interpretation of slice
253-
// patterns changed between stage0 and now.
254-
#[cfg(stage0)]
255-
pub fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'a &'b [T] {
256-
t
257-
}
258-
#[cfg(not(stage0))]
259-
pub fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'b [T] {
260-
*t
261-
}

src/librustc_const_eval/check_match.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use rustc::hir::fold::{Folder, noop_fold_pat};
4343
use rustc::hir::print::pat_to_string;
4444
use syntax::ptr::P;
4545
use rustc::util::nodemap::FnvHashMap;
46-
use rustc::util::common::slice_pat;
4746

4847
pub const DUMMY_WILD_PAT: &'static Pat = &Pat {
4948
id: DUMMY_NODE_ID,
@@ -400,7 +399,7 @@ fn check_exhaustive<'a, 'tcx>(cx: &MatchCheckCtxt<'a, 'tcx>,
400399
hir::MatchSource::ForLoopDesugar => {
401400
// `witnesses[0]` has the form `Some(<head>)`, peel off the `Some`
402401
let witness = match witnesses[0].node {
403-
PatKind::TupleStruct(_, ref pats, _) => match slice_pat(&&pats[..]) {
402+
PatKind::TupleStruct(_, ref pats, _) => match &pats[..] {
404403
&[ref pat] => &**pat,
405404
_ => bug!(),
406405
},

src/librustc_lint/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustc::ty::{self, Ty, TyCtxt};
1616
use middle::const_val::ConstVal;
1717
use rustc_const_eval::eval_const_expr_partial;
1818
use rustc_const_eval::EvalHint::ExprTypeChecked;
19-
use util::common::slice_pat;
2019
use util::nodemap::{FnvHashSet};
2120
use lint::{LateContext, LintContext, LintArray};
2221
use lint::{LintPass, LateLintPass};
@@ -461,7 +460,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
461460
// Check for a repr() attribute to specify the size of the
462461
// discriminant.
463462
let repr_hints = cx.lookup_repr_hints(def.did);
464-
match slice_pat(&&**repr_hints) {
463+
match &repr_hints[..] {
465464
&[] => {
466465
// Special-case types like `Option<extern fn()>`.
467466
if !is_repr_nullable_ptr(cx, def, substs) {

src/librustdoc/clean/inline.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use rustc::hir::def_id::DefId;
2222
use rustc::hir::print as pprust;
2323
use rustc::ty::{self, TyCtxt};
2424
use rustc::ty::subst;
25-
use rustc::util::common::slice_pat;
2625

2726
use rustc_const_eval::lookup_const_by_id;
2827

@@ -204,7 +203,7 @@ fn build_struct<'a, 'tcx>(cx: &DocContext, tcx: TyCtxt<'a, 'tcx, 'tcx>,
204203
let variant = tcx.lookup_adt_def(did).struct_variant();
205204

206205
clean::Struct {
207-
struct_type: match slice_pat(&&*variant.fields) {
206+
struct_type: match &variant.fields[..] {
208207
&[] => doctree::Unit,
209208
&[_] if variant.kind == ty::VariantKind::Tuple => doctree::Newtype,
210209
&[..] if variant.kind == ty::VariantKind::Tuple => doctree::Tuple,

src/librustdoc/html/format.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use std::iter::repeat;
2020

2121
use rustc::middle::cstore::LOCAL_CRATE;
2222
use rustc::hir::def_id::{CRATE_DEF_INDEX, DefId};
23-
use rustc::util::common::slice_pat;
2423
use syntax::abi::Abi;
2524
use rustc::hir;
2625

@@ -471,7 +470,7 @@ impl fmt::Display for clean::Type {
471470
decl.decl)
472471
}
473472
clean::Tuple(ref typs) => {
474-
match slice_pat(&&**typs) {
473+
match &typs[..] {
475474
&[] => primitive_link(f, clean::PrimitiveTuple, "()"),
476475
&[ref one] => {
477476
primitive_link(f, clean::PrimitiveTuple, "(")?;

src/libstd/lib.rs

-12
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,3 @@ pub mod __rand {
468468
// the rustdoc documentation for primitive types. Using `include!`
469469
// because rustdoc only looks for these modules at the crate level.
470470
include!("primitive_docs.rs");
471-
472-
// FIXME(stage0): remove this after a snapshot
473-
// HACK: this is needed because the interpretation of slice
474-
// patterns changed between stage0 and now.
475-
#[cfg(stage0)]
476-
fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'a &'b [T] {
477-
t
478-
}
479-
#[cfg(not(stage0))]
480-
fn slice_pat<'a, 'b, T>(t: &'a &'b [T]) -> &'b [T] {
481-
*t
482-
}

src/libstd/sys/common/wtf8.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl Wtf8 {
566566
if len < 3 {
567567
return None
568568
}
569-
match ::slice_pat(&&self.bytes[(len - 3)..]) {
569+
match &self.bytes[(len - 3)..] {
570570
&[0xED, b2 @ 0xA0...0xAF, b3] => Some(decode_surrogate(b2, b3)),
571571
_ => None
572572
}
@@ -578,7 +578,7 @@ impl Wtf8 {
578578
if len < 3 {
579579
return None
580580
}
581-
match ::slice_pat(&&self.bytes[..3]) {
581+
match &self.bytes[..3] {
582582
&[0xED, b2 @ 0xB0...0xBF, b3] => Some(decode_surrogate(b2, b3)),
583583
_ => None
584584
}

src/libstd/sys/windows/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl Drop for FindNextFileHandle {
117117

118118
impl DirEntry {
119119
fn new(root: &Arc<PathBuf>, wfd: &c::WIN32_FIND_DATAW) -> Option<DirEntry> {
120-
match ::slice_pat(&&wfd.cFileName[0..3]) {
120+
match &wfd.cFileName[0..3] {
121121
// check for '.' and '..'
122122
&[46, 0, ..] |
123123
&[46, 46, 0, ..] => return None,

src/stage0.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# tarball for a stable release you'll likely see `1.x.0-$date` where `1.x.0` was
1313
# released on `$date`
1414

15-
rustc: beta-2016-05-24
16-
rustc_key: a4922355
17-
cargo: nightly-2016-05-22
15+
rustc: beta-2016-07-06
16+
rustc_key: 411fd48b
17+
cargo: nightly-2016-07-05

0 commit comments

Comments
 (0)