/// 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) -> T;
/// Aborts the execution of the process.
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;
let mut dl = TargetDataLayout::default();
for spec in sess.target.target.data_layout.split("-") {
- match slice_pat(&&spec.split(":").collect::<Vec<_>>()[..]) {
+ match &spec.split(":").collect::<Vec<_>>()[..] {
&["e"] => dl.endian = Endian::Little,
&["E"] => dl.endian = Endian::Big,
&["a", ref a..] => dl.aggregate_align = align(a, "a"),
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
-}
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,
hir::MatchSource::ForLoopDesugar => {
// `witnesses[0]` has the form `Some(<head>)`, 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!(),
},
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};
// 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<extern fn()>`.
if !is_repr_nullable_ptr(cx, def, substs) {
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;
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,
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;
decl.decl)
}
clean::Tuple(ref typs) => {
- match slice_pat(&&**typs) {
+ match &typs[..] {
&[] => primitive_link(f, clean::PrimitiveTuple, "()"),
&[ref one] => {
primitive_link(f, clean::PrimitiveTuple, "(")?;
// 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
-}
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
}
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
}
impl DirEntry {
fn new(root: &Arc<PathBuf>, wfd: &c::WIN32_FIND_DATAW) -> Option<DirEntry> {
- match ::slice_pat(&&wfd.cFileName[0..3]) {
+ match &wfd.cFileName[0..3] {
// check for '.' and '..'
&[46, 0, ..] |
&[46, 46, 0, ..] => return None,
# 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