1
Fork 0

Replace _, _ with ..

This commit is contained in:
Vadim Petrochenkov 2016-08-26 19:23:42 +03:00
parent 6f7e51e49b
commit e05e74ac83
107 changed files with 275 additions and 271 deletions

View file

@ -279,7 +279,7 @@ impl OptGroup {
}], }],
} }
} }
(_, _) => panic!("something is wrong with the long-form opt"), _ => panic!("something is wrong with the long-form opt"),
} }
} }
} }

View file

@ -99,7 +99,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
fn pat(&mut self, pat: &hir::Pat, pred: CFGIndex) -> CFGIndex { fn pat(&mut self, pat: &hir::Pat, pred: CFGIndex) -> CFGIndex {
match pat.node { match pat.node {
PatKind::Binding(_, _, None) | PatKind::Binding(.., None) |
PatKind::Path(..) | PatKind::Path(..) |
PatKind::Lit(..) | PatKind::Lit(..) |
PatKind::Range(..) | PatKind::Range(..) |
@ -109,7 +109,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
PatKind::Box(ref subpat) | PatKind::Box(ref subpat) |
PatKind::Ref(ref subpat, _) | PatKind::Ref(ref subpat, _) |
PatKind::Binding(_, _, Some(ref subpat)) => { PatKind::Binding(.., Some(ref subpat)) => {
let subpat_exit = self.pat(&subpat, pred); let subpat_exit = self.pat(&subpat, pred);
self.add_ast_node(pat.id, &[subpat_exit]) self.add_ast_node(pat.id, &[subpat_exit])
} }
@ -306,7 +306,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
self.call(expr, pred, &func, args.iter().map(|e| &**e)) self.call(expr, pred, &func, args.iter().map(|e| &**e))
} }
hir::ExprMethodCall(_, _, ref args) => { hir::ExprMethodCall(.., ref args) => {
self.call(expr, pred, &args[0], args[1..].iter().map(|e| &**e)) self.call(expr, pred, &args[0], args[1..].iter().map(|e| &**e))
} }

View file

@ -104,7 +104,7 @@ impl Def {
pub fn var_id(&self) -> ast::NodeId { pub fn var_id(&self) -> ast::NodeId {
match *self { match *self {
Def::Local(_, id) | Def::Local(_, id) |
Def::Upvar(_, id, _, _) => { Def::Upvar(_, id, ..) => {
id id
} }

View file

@ -341,7 +341,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
visitor.visit_id(item.id); visitor.visit_id(item.id);
visitor.visit_trait_ref(trait_ref) visitor.visit_trait_ref(trait_ref)
} }
ItemImpl(_, _, ref type_parameters, ref opt_trait_reference, ref typ, ref impl_items) => { ItemImpl(.., ref type_parameters, ref opt_trait_reference, ref typ, ref impl_items) => {
visitor.visit_id(item.id); visitor.visit_id(item.id);
visitor.visit_generics(type_parameters); visitor.visit_generics(type_parameters);
walk_list!(visitor, visit_trait_ref, opt_trait_reference); walk_list!(visitor, visit_trait_ref, opt_trait_reference);
@ -625,7 +625,7 @@ pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V, function_kind: FnKind<'
FnKind::ItemFn(_, generics, ..) => { FnKind::ItemFn(_, generics, ..) => {
visitor.visit_generics(generics); visitor.visit_generics(generics);
} }
FnKind::Method(_, sig, _, _) => { FnKind::Method(_, sig, ..) => {
visitor.visit_generics(&sig.generics); visitor.visit_generics(&sig.generics);
} }
FnKind::Closure(_) => {} FnKind::Closure(_) => {}

View file

@ -109,7 +109,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
this.insert(struct_def.id(), NodeStructCtor(struct_def)); this.insert(struct_def.id(), NodeStructCtor(struct_def));
} }
} }
ItemTrait(_, _, ref bounds, _) => { ItemTrait(.., ref bounds, _) => {
for b in bounds.iter() { for b in bounds.iter() {
if let TraitTyParamBound(ref t, TraitBoundModifier::None) = *b { if let TraitTyParamBound(ref t, TraitBoundModifier::None) = *b {
this.insert(t.trait_ref.ref_id, NodeItem(i)); this.insert(t.trait_ref.ref_id, NodeItem(i));

View file

@ -469,7 +469,7 @@ impl Pat {
} }
match self.node { match self.node {
PatKind::Binding(_, _, Some(ref p)) => p.walk_(it), PatKind::Binding(.., Some(ref p)) => p.walk_(it),
PatKind::Struct(_, ref fields, _) => { PatKind::Struct(_, ref fields, _) => {
fields.iter().all(|field| field.node.pat.walk_(it)) fields.iter().all(|field| field.node.pat.walk_(it))
} }
@ -486,7 +486,7 @@ impl Pat {
} }
PatKind::Wild | PatKind::Wild |
PatKind::Lit(_) | PatKind::Lit(_) |
PatKind::Range(_, _) | PatKind::Range(..) |
PatKind::Binding(..) | PatKind::Binding(..) |
PatKind::Path(..) => { PatKind::Path(..) => {
true true

View file

@ -53,7 +53,7 @@ impl<T: ExactSizeIterator> EnumerateAndAdjustIterator for T {
pub fn pat_is_refutable(dm: &DefMap, pat: &hir::Pat) -> bool { pub fn pat_is_refutable(dm: &DefMap, pat: &hir::Pat) -> bool {
match pat.node { match pat.node {
PatKind::Lit(_) | PatKind::Range(_, _) | PatKind::Path(Some(..), _) => true, PatKind::Lit(_) | PatKind::Range(..) | PatKind::Path(Some(..), _) => true,
PatKind::TupleStruct(..) | PatKind::TupleStruct(..) |
PatKind::Path(..) | PatKind::Path(..) |
PatKind::Struct(..) => { PatKind::Struct(..) => {

View file

@ -140,9 +140,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
Some(ast_map::NodeExpr(expr)) => match expr.node { Some(ast_map::NodeExpr(expr)) => match expr.node {
hir::ExprCall(..) => "call", hir::ExprCall(..) => "call",
hir::ExprMethodCall(..) => "method call", hir::ExprMethodCall(..) => "method call",
hir::ExprMatch(_, _, hir::MatchSource::IfLetDesugar { .. }) => "if let", hir::ExprMatch(.., hir::MatchSource::IfLetDesugar { .. }) => "if let",
hir::ExprMatch(_, _, hir::MatchSource::WhileLetDesugar) => "while let", hir::ExprMatch(.., hir::MatchSource::WhileLetDesugar) => "while let",
hir::ExprMatch(_, _, hir::MatchSource::ForLoopDesugar) => "for", hir::ExprMatch(.., hir::MatchSource::ForLoopDesugar) => "for",
hir::ExprMatch(..) => "match", hir::ExprMatch(..) => "match",
_ => "expression", _ => "expression",
}, },

View file

@ -684,7 +684,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
warnings.extend( warnings.extend(
match self.region_vars.var_origin(vid) { match self.region_vars.var_origin(vid) {
LateBoundRegion(_, LateBoundRegion(_,
ty::BrNamed(_, _, wc), ty::BrNamed(.., wc),
_) => Some(wc), _) => Some(wc),
_ => None, _ => None,
}); });

View file

@ -225,7 +225,7 @@ impl TypeOrigin {
&TypeOrigin::RelateOutputImplTypes(_) | &TypeOrigin::RelateOutputImplTypes(_) |
&TypeOrigin::ExprAssignable(_) => "mismatched types", &TypeOrigin::ExprAssignable(_) => "mismatched types",
&TypeOrigin::MethodCompatCheck(_) => "method not compatible with trait", &TypeOrigin::MethodCompatCheck(_) => "method not compatible with trait",
&TypeOrigin::MatchExpressionArm(_, _, source) => match source { &TypeOrigin::MatchExpressionArm(.., source) => match source {
hir::MatchSource::IfLetDesugar{..} => "`if let` arms have incompatible types", hir::MatchSource::IfLetDesugar{..} => "`if let` arms have incompatible types",
_ => "match arms have incompatible types", _ => "match arms have incompatible types",
}, },
@ -1712,7 +1712,7 @@ impl TypeOrigin {
TypeOrigin::ExprAssignable(span) => span, TypeOrigin::ExprAssignable(span) => span,
TypeOrigin::Misc(span) => span, TypeOrigin::Misc(span) => span,
TypeOrigin::RelateOutputImplTypes(span) => span, TypeOrigin::RelateOutputImplTypes(span) => span,
TypeOrigin::MatchExpressionArm(match_span, _, _) => match_span, TypeOrigin::MatchExpressionArm(match_span, ..) => match_span,
TypeOrigin::IfExpression(span) => span, TypeOrigin::IfExpression(span) => span,
TypeOrigin::IfExpressionWithNoElse(span) => span, TypeOrigin::IfExpressionWithNoElse(span) => span,
TypeOrigin::RangeExpression(span) => span, TypeOrigin::RangeExpression(span) => span,
@ -1765,7 +1765,7 @@ impl RegionVariableOrigin {
Autoref(a) => a, Autoref(a) => a,
Coercion(a) => a, Coercion(a) => a,
EarlyBoundRegion(a, _) => a, EarlyBoundRegion(a, _) => a,
LateBoundRegion(a, _, _) => a, LateBoundRegion(a, ..) => a,
BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP, BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP,
UpvarRegion(_, a) => a UpvarRegion(_, a) => a
} }

View file

@ -605,7 +605,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
undo_entry: &UndoLogEntry<'tcx>) undo_entry: &UndoLogEntry<'tcx>)
-> bool { -> bool {
match undo_entry { match undo_entry {
&AddConstraint(ConstrainVarSubVar(_, _)) => &AddConstraint(ConstrainVarSubVar(..)) =>
false, false,
&AddConstraint(ConstrainRegSubVar(a, _)) => &AddConstraint(ConstrainRegSubVar(a, _)) =>
skols.contains(&a), skols.contains(&a),
@ -613,7 +613,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
skols.contains(&b), skols.contains(&b),
&AddConstraint(ConstrainRegSubReg(a, b)) => &AddConstraint(ConstrainRegSubReg(a, b)) =>
skols.contains(&a) || skols.contains(&b), skols.contains(&a) || skols.contains(&b),
&AddGiven(_, _) => &AddGiven(..) =>
false, false,
&AddVerify(_) => &AddVerify(_) =>
false, false,
@ -1372,7 +1372,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
(&ReFree(..), &ReFree(..)) => Equal, (&ReFree(..), &ReFree(..)) => Equal,
(&ReFree(..), _) => Less, (&ReFree(..), _) => Less,
(_, &ReFree(..)) => Greater, (_, &ReFree(..)) => Greater,
(_, _) => Equal, (..) => Equal,
} }
} }
lower_bounds.sort_by(|a, b| free_regions_first(a, b)); lower_bounds.sort_by(|a, b| free_regions_first(a, b));

View file

@ -267,7 +267,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
debug!("NewElem({}) new_elem_threshold={}", index, new_elem_threshold); debug!("NewElem({}) new_elem_threshold={}", index, new_elem_threshold);
} }
sv::UndoLog::Other(SpecifyVar(vid, _, _)) => { sv::UndoLog::Other(SpecifyVar(vid, ..)) => {
if vid.index < new_elem_threshold { if vid.index < new_elem_threshold {
// quick check to see if this variable was // quick check to see if this variable was
// created since the snapshot started or not. // created since the snapshot started or not.

View file

@ -43,7 +43,7 @@ enum RootUnsafeContext {
fn type_is_unsafe_function(ty: Ty) -> bool { fn type_is_unsafe_function(ty: Ty) -> bool {
match ty.sty { match ty.sty {
ty::TyFnDef(_, _, ref f) | ty::TyFnDef(.., ref f) |
ty::TyFnPtr(ref f) => f.unsafety == hir::Unsafety::Unsafe, ty::TyFnPtr(ref f) => f.unsafety == hir::Unsafety::Unsafe,
_ => false, _ => false,
} }
@ -85,7 +85,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> {
let (is_item_fn, is_unsafe_fn) = match fn_kind { let (is_item_fn, is_unsafe_fn) = match fn_kind {
FnKind::ItemFn(_, _, unsafety, ..) => FnKind::ItemFn(_, _, unsafety, ..) =>
(true, unsafety == hir::Unsafety::Unsafe), (true, unsafety == hir::Unsafety::Unsafe),
FnKind::Method(_, sig, _, _) => FnKind::Method(_, sig, ..) =>
(true, sig.unsafety == hir::Unsafety::Unsafe), (true, sig.unsafety == hir::Unsafety::Unsafe),
_ => (false, false), _ => (false, false),
}; };

View file

@ -409,7 +409,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
self.consume_exprs(args); self.consume_exprs(args);
} }
hir::ExprMethodCall(_, _, ref args) => { // callee.m(args) hir::ExprMethodCall(.., ref args) => { // callee.m(args)
self.consume_exprs(args); self.consume_exprs(args);
} }
@ -940,9 +940,9 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
pat); pat);
return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| { return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| {
match pat.node { match pat.node {
PatKind::Binding(hir::BindByRef(..), _, _) => PatKind::Binding(hir::BindByRef(..), ..) =>
mode.lub(BorrowingMatch), mode.lub(BorrowingMatch),
PatKind::Binding(hir::BindByValue(..), _, _) => { PatKind::Binding(hir::BindByValue(..), ..) => {
match copy_or_move(self.mc.infcx, &cmt_pat, PatBindingMove) { match copy_or_move(self.mc.infcx, &cmt_pat, PatBindingMove) {
Copy => mode.lub(CopyingMatch), Copy => mode.lub(CopyingMatch),
Move(..) => mode.lub(MovingMatch), Move(..) => mode.lub(MovingMatch),
@ -964,7 +964,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
let infcx = self.mc.infcx; let infcx = self.mc.infcx;
let delegate = &mut self.delegate; let delegate = &mut self.delegate;
return_if_err!(mc.cat_pattern(cmt_discr.clone(), pat, |mc, cmt_pat, pat| { return_if_err!(mc.cat_pattern(cmt_discr.clone(), pat, |mc, cmt_pat, pat| {
if let PatKind::Binding(bmode, _, _) = pat.node { if let PatKind::Binding(bmode, ..) = pat.node {
debug!("binding cmt_pat={:?} pat={:?} match_mode={:?}", cmt_pat, pat, match_mode); debug!("binding cmt_pat={:?} pat={:?} match_mode={:?}", cmt_pat, pat, match_mode);
// pat_ty: the type of the binding being produced. // pat_ty: the type of the binding being produced.

View file

@ -52,7 +52,7 @@ struct ExprVisitor<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> { impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> {
fn def_id_is_transmute(&self, def_id: DefId) -> bool { fn def_id_is_transmute(&self, def_id: DefId) -> bool {
let intrinsic = match self.infcx.tcx.lookup_item_type(def_id).ty.sty { let intrinsic = match self.infcx.tcx.lookup_item_type(def_id).ty.sty {
ty::TyFnDef(_, _, ref bfty) => bfty.abi == RustIntrinsic, ty::TyFnDef(.., ref bfty) => bfty.abi == RustIntrinsic,
_ => return false _ => return false
}; };
intrinsic && self.infcx.tcx.item_name(def_id).as_str() == "transmute" intrinsic && self.infcx.tcx.item_name(def_id).as_str() == "transmute"
@ -160,7 +160,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for ExprVisitor<'a, 'gcx, 'tcx> {
Def::Fn(did) if self.def_id_is_transmute(did) => { Def::Fn(did) if self.def_id_is_transmute(did) => {
let typ = self.infcx.tcx.node_id_to_type(expr.id); let typ = self.infcx.tcx.node_id_to_type(expr.id);
match typ.sty { match typ.sty {
ty::TyFnDef(_, _, ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => { ty::TyFnDef(.., ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
let from = bare_fn_ty.sig.0.inputs[0]; let from = bare_fn_ty.sig.0.inputs[0];
let to = bare_fn_ty.sig.0.output; let to = bare_fn_ty.sig.0.output;
self.check_transmute(expr.span, from, to, expr.id); self.check_transmute(expr.span, from, to, expr.id);

View file

@ -482,7 +482,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
ir.add_live_node_for_node(expr.id, ExprNode(expr.span)); ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
intravisit::walk_expr(ir, expr); intravisit::walk_expr(ir, expr);
} }
hir::ExprBinary(op, _, _) if op.node.is_lazy() => { hir::ExprBinary(op, ..) if op.node.is_lazy() => {
ir.add_live_node_for_node(expr.id, ExprNode(expr.span)); ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
intravisit::walk_expr(ir, expr); intravisit::walk_expr(ir, expr);
} }
@ -943,7 +943,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
self.propagate_through_expr(&e, succ) self.propagate_through_expr(&e, succ)
} }
hir::ExprClosure(_, _, ref blk, _) => { hir::ExprClosure(.., ref blk, _) => {
debug!("{} is an ExprClosure", debug!("{} is an ExprClosure",
expr_to_string(expr)); expr_to_string(expr));
@ -1123,7 +1123,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
self.propagate_through_expr(&f, succ) self.propagate_through_expr(&f, succ)
} }
hir::ExprMethodCall(_, _, ref args) => { hir::ExprMethodCall(.., ref args) => {
let method_call = ty::MethodCall::expr(expr.id); let method_call = ty::MethodCall::expr(expr.id);
let method_ty = self.ir.tcx.tables.borrow().method_map[&method_call].ty; let method_ty = self.ir.tcx.tables.borrow().method_map[&method_call].ty;
// FIXME(canndrew): This is_never should really be an is_uninhabited // FIXME(canndrew): This is_never should really be an is_uninhabited

View file

@ -228,7 +228,7 @@ fn deref_kind(t: Ty, context: DerefKindContext) -> McResult<deref_kind> {
Ok(deref_interior(InteriorField(PositionalField(0)))) Ok(deref_interior(InteriorField(PositionalField(0))))
} }
ty::TyArray(_, _) | ty::TySlice(_) => { ty::TyArray(..) | ty::TySlice(_) => {
// no deref of indexed content without supplying InteriorOffsetKind // no deref of indexed content without supplying InteriorOffsetKind
if let Some(context) = context { if let Some(context) = context {
Ok(deref_interior(InteriorElement(context, ElementKind::VecElement))) Ok(deref_interior(InteriorElement(context, ElementKind::VecElement)))
@ -318,7 +318,7 @@ impl MutabilityCategory {
fn from_local(tcx: TyCtxt, id: ast::NodeId) -> MutabilityCategory { fn from_local(tcx: TyCtxt, id: ast::NodeId) -> MutabilityCategory {
let ret = match tcx.map.get(id) { let ret = match tcx.map.get(id) {
ast_map::NodeLocal(p) => match p.node { ast_map::NodeLocal(p) => match p.node {
PatKind::Binding(bind_mode, _, _) => { PatKind::Binding(bind_mode, ..) => {
if bind_mode == hir::BindByValue(hir::MutMutable) { if bind_mode == hir::BindByValue(hir::MutMutable) {
McDeclared McDeclared
} else { } else {
@ -419,7 +419,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
// *being borrowed* is. But ideally we would put in a more // *being borrowed* is. But ideally we would put in a more
// fundamental fix to this conflated use of the node id. // fundamental fix to this conflated use of the node id.
let ret_ty = match pat.node { let ret_ty = match pat.node {
PatKind::Binding(hir::BindByRef(_), _, _) => { PatKind::Binding(hir::BindByRef(_), ..) => {
// a bind-by-ref means that the base_ty will be the type of the ident itself, // a bind-by-ref means that the base_ty will be the type of the ident itself,
// but what we want here is the type of the underlying value being borrowed. // but what we want here is the type of the underlying value being borrowed.
// So peel off one-level, turning the &T into T. // So peel off one-level, turning the &T into T.
@ -761,7 +761,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
}; };
match fn_expr.node { match fn_expr.node {
hir::ExprClosure(_, _, ref body, _) => body.id, hir::ExprClosure(.., ref body, _) => body.id,
_ => bug!() _ => bug!()
} }
}; };
@ -1185,7 +1185,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
} }
} }
PatKind::Binding(_, _, Some(ref subpat)) => { PatKind::Binding(.., Some(ref subpat)) => {
self.cat_pattern_(cmt, &subpat, op)?; self.cat_pattern_(cmt, &subpat, op)?;
} }
@ -1225,7 +1225,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
} }
} }
PatKind::Path(..) | PatKind::Binding(_, _, None) | PatKind::Path(..) | PatKind::Binding(.., None) |
PatKind::Lit(..) | PatKind::Range(..) | PatKind::Wild => { PatKind::Lit(..) | PatKind::Range(..) | PatKind::Wild => {
// always ok // always ok
} }
@ -1275,9 +1275,9 @@ impl<'tcx> cmt_<'tcx> {
Categorization::Rvalue(..) | Categorization::Rvalue(..) |
Categorization::StaticItem | Categorization::StaticItem |
Categorization::Local(..) | Categorization::Local(..) |
Categorization::Deref(_, _, UnsafePtr(..)) | Categorization::Deref(.., UnsafePtr(..)) |
Categorization::Deref(_, _, BorrowedPtr(..)) | Categorization::Deref(.., BorrowedPtr(..)) |
Categorization::Deref(_, _, Implicit(..)) | Categorization::Deref(.., Implicit(..)) |
Categorization::Upvar(..) => { Categorization::Upvar(..) => {
Rc::new((*self).clone()) Rc::new((*self).clone())
} }
@ -1320,7 +1320,7 @@ impl<'tcx> cmt_<'tcx> {
Categorization::Rvalue(..) | Categorization::Rvalue(..) |
Categorization::Local(..) | Categorization::Local(..) |
Categorization::Upvar(..) | Categorization::Upvar(..) |
Categorization::Deref(_, _, UnsafePtr(..)) => { // yes, it's aliasable, but... Categorization::Deref(.., UnsafePtr(..)) => { // yes, it's aliasable, but...
NonAliasable NonAliasable
} }
@ -1349,9 +1349,9 @@ impl<'tcx> cmt_<'tcx> {
match self.note { match self.note {
NoteClosureEnv(..) | NoteUpvarRef(..) => { NoteClosureEnv(..) | NoteUpvarRef(..) => {
Some(match self.cat { Some(match self.cat {
Categorization::Deref(ref inner, _, _) => { Categorization::Deref(ref inner, ..) => {
match inner.cat { match inner.cat {
Categorization::Deref(ref inner, _, _) => inner.clone(), Categorization::Deref(ref inner, ..) => inner.clone(),
Categorization::Upvar(..) => inner.clone(), Categorization::Upvar(..) => inner.clone(),
_ => bug!() _ => bug!()
} }
@ -1379,7 +1379,7 @@ impl<'tcx> cmt_<'tcx> {
"local variable".to_string() "local variable".to_string()
} }
} }
Categorization::Deref(_, _, pk) => { Categorization::Deref(.., pk) => {
let upvar = self.upvar(); let upvar = self.upvar();
match upvar.as_ref().map(|i| &i.cat) { match upvar.as_ref().map(|i| &i.cat) {
Some(&Categorization::Upvar(ref var)) => { Some(&Categorization::Upvar(ref var)) => {

View file

@ -956,7 +956,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor, local: &hir::Local) {
/// | box P& /// | box P&
fn is_binding_pat(pat: &hir::Pat) -> bool { fn is_binding_pat(pat: &hir::Pat) -> bool {
match pat.node { match pat.node {
PatKind::Binding(hir::BindByRef(_), _, _) => true, PatKind::Binding(hir::BindByRef(_), ..) => true,
PatKind::Struct(_, ref field_pats, _) => { PatKind::Struct(_, ref field_pats, _) => {
field_pats.iter().any(|fp| is_binding_pat(&fp.node.pat)) field_pats.iter().any(|fp| is_binding_pat(&fp.node.pat))

View file

@ -157,7 +157,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> {
hir::ItemEnum(_, ref generics) | hir::ItemEnum(_, ref generics) |
hir::ItemStruct(_, ref generics) | hir::ItemStruct(_, ref generics) |
hir::ItemUnion(_, ref generics) | hir::ItemUnion(_, ref generics) |
hir::ItemTrait(_, ref generics, _, _) | hir::ItemTrait(_, ref generics, ..) |
hir::ItemImpl(_, _, ref generics, ..) => { hir::ItemImpl(_, _, ref generics, ..) => {
// These kinds of items have only early bound lifetime parameters. // These kinds of items have only early bound lifetime parameters.
let lifetimes = &generics.lifetimes; let lifetimes = &generics.lifetimes;
@ -209,7 +209,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> {
this.add_scope_and_walk_fn(fk, decl, b, s, fn_id) this.add_scope_and_walk_fn(fk, decl, b, s, fn_id)
}) })
} }
FnKind::Method(_, sig, _, _) => { FnKind::Method(_, sig, ..) => {
self.visit_early_late( self.visit_early_late(
fn_id, fn_id,
decl, decl,
@ -455,7 +455,7 @@ fn extract_labels(ctxt: &mut LifetimeContext, b: &hir::Block) {
fn expression_label(ex: &hir::Expr) -> Option<(ast::Name, Span)> { fn expression_label(ex: &hir::Expr) -> Option<(ast::Name, Span)> {
match ex.node { match ex.node {
hir::ExprWhile(_, _, Some(label)) | hir::ExprWhile(.., Some(label)) |
hir::ExprLoop(_, Some(label)) => Some((label.node, label.span)), hir::ExprLoop(_, Some(label)) => Some((label.node, label.span)),
_ => None, _ => None,
} }
@ -503,7 +503,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
intravisit::walk_fn_decl(self, fd); intravisit::walk_fn_decl(self, fd);
self.visit_generics(generics); self.visit_generics(generics);
} }
FnKind::Method(_, sig, _, _) => { FnKind::Method(_, sig, ..) => {
intravisit::walk_fn_decl(self, fd); intravisit::walk_fn_decl(self, fd);
self.visit_generics(&sig.generics); self.visit_generics(&sig.generics);
} }
@ -583,7 +583,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
start += 1; // Self comes first. start += 1; // Self comes first.
} }
match parent.node { match parent.node {
hir::ItemTrait(_, ref generics, _, _) | hir::ItemTrait(_, ref generics, ..) |
hir::ItemImpl(_, _, ref generics, ..) => { hir::ItemImpl(_, _, ref generics, ..) => {
start += generics.lifetimes.len() + generics.ty_params.len(); start += generics.lifetimes.len() + generics.ty_params.len();
} }

View file

@ -553,7 +553,7 @@ pub fn check_expr<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, e: &hir::Expr,
&Option<DeprecationEntry>)) { &Option<DeprecationEntry>)) {
let span; let span;
let id = match e.node { let id = match e.node {
hir::ExprMethodCall(i, _, _) => { hir::ExprMethodCall(i, ..) => {
span = i.span; span = i.span;
let method_call = ty::MethodCall::expr(e.id); let method_call = ty::MethodCall::expr(e.id);
tcx.tables.borrow().method_map[&method_call].def_id tcx.tables.borrow().method_map[&method_call].def_id

View file

@ -153,7 +153,7 @@ impl<'tcx> Rvalue<'tcx> {
)) ))
} }
&Rvalue::Len(..) => Some(tcx.types.usize), &Rvalue::Len(..) => Some(tcx.types.usize),
&Rvalue::Cast(_, _, ty) => Some(ty), &Rvalue::Cast(.., ty) => Some(ty),
&Rvalue::BinaryOp(op, ref lhs, ref rhs) => { &Rvalue::BinaryOp(op, ref lhs, ref rhs) => {
let lhs_ty = lhs.ty(mir, tcx); let lhs_ty = lhs.ty(mir, tcx);
let rhs_ty = rhs.ty(mir, tcx); let rhs_ty = rhs.ty(mir, tcx);

View file

@ -1535,8 +1535,8 @@ pub fn get_unstable_features_setting() -> UnstableFeatures {
let bootstrap_provided_key = env::var("RUSTC_BOOTSTRAP_KEY").ok(); let bootstrap_provided_key = env::var("RUSTC_BOOTSTRAP_KEY").ok();
match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) { match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) {
(_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat, (_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat,
(true, _, _) => UnstableFeatures::Disallow, (true, ..) => UnstableFeatures::Disallow,
(false, _, _) => UnstableFeatures::Allow (false, ..) => UnstableFeatures::Allow
} }
} }

View file

@ -1379,7 +1379,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
} }
// provide an impl, but only for suitable `fn` pointers // provide an impl, but only for suitable `fn` pointers
ty::TyFnDef(_, _, &ty::BareFnTy { ty::TyFnDef(.., &ty::BareFnTy {
unsafety: hir::Unsafety::Normal, unsafety: hir::Unsafety::Normal,
abi: Abi::Rust, abi: Abi::Rust,
sig: ty::Binder(ty::FnSig { sig: ty::Binder(ty::FnSig {
@ -1635,7 +1635,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
} }
// [T; n] -> [T]. // [T; n] -> [T].
(&ty::TyArray(_, _), &ty::TySlice(_)) => true, (&ty::TyArray(..), &ty::TySlice(_)) => true,
// Struct<T> -> Struct<U>. // Struct<T> -> Struct<U>.
(&ty::TyStruct(def_id_a, _), &ty::TyStruct(def_id_b, _)) => { (&ty::TyStruct(def_id_a, _), &ty::TyStruct(def_id_b, _)) => {

View file

@ -160,7 +160,7 @@ impl<'a, 'gcx, 'tcx> ty::TyS<'tcx> {
AdjustReifyFnPointer => { AdjustReifyFnPointer => {
match self.sty { match self.sty {
ty::TyFnDef(_, _, f) => tcx.mk_fn_ptr(f), ty::TyFnDef(.., f) => tcx.mk_fn_ptr(f),
_ => { _ => {
bug!("AdjustReifyFnPointer adjustment on non-fn-item: {:?}", bug!("AdjustReifyFnPointer adjustment on non-fn-item: {:?}",
self); self);

View file

@ -202,7 +202,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
TC::None TC::None
} }
ty::TyRef(_, _) => { ty::TyRef(..) => {
TC::None TC::None
} }

View file

@ -90,7 +90,7 @@ pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
ty::TyTuple(ref tys) => { ty::TyTuple(ref tys) => {
Some(TupleSimplifiedType(tys.len())) Some(TupleSimplifiedType(tys.len()))
} }
ty::TyFnDef(_, _, ref f) | ty::TyFnPtr(ref f) => { ty::TyFnDef(.., ref f) | ty::TyFnPtr(ref f) => {
Some(FunctionSimplifiedType(f.sig.0.inputs.len())) Some(FunctionSimplifiedType(f.sig.0.inputs.len()))
} }
ty::TyProjection(_) | ty::TyParam(_) => { ty::TyProjection(_) | ty::TyParam(_) => {

View file

@ -337,7 +337,7 @@ pub fn characteristic_def_id_of_type(ty: Ty) -> Option<DefId> {
.filter_map(|ty| characteristic_def_id_of_type(ty)) .filter_map(|ty| characteristic_def_id_of_type(ty))
.next(), .next(),
ty::TyFnDef(def_id, _, _) | ty::TyFnDef(def_id, ..) |
ty::TyClosure(def_id, _) => Some(def_id), ty::TyClosure(def_id, _) => Some(def_id),
ty::TyBool | ty::TyBool |

View file

@ -1269,7 +1269,7 @@ impl<'a, 'tcx> ParameterEnvironment<'tcx> {
match tcx.map.find(id) { match tcx.map.find(id) {
Some(ast_map::NodeImplItem(ref impl_item)) => { Some(ast_map::NodeImplItem(ref impl_item)) => {
match impl_item.node { match impl_item.node {
hir::ImplItemKind::Type(_) | hir::ImplItemKind::Const(_, _) => { hir::ImplItemKind::Type(_) | hir::ImplItemKind::Const(..) => {
// associated types don't have their own entry (for some reason), // associated types don't have their own entry (for some reason),
// so for now just grab environment for the impl // so for now just grab environment for the impl
let impl_id = tcx.map.get_parent(id); let impl_id = tcx.map.get_parent(id);
@ -2290,7 +2290,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
match self.map.expect_item(id).node { match self.map.expect_item(id).node {
ItemTrait(.., ref tis) => { ItemTrait(.., ref tis) => {
tis.iter().filter_map(|ti| { tis.iter().filter_map(|ti| {
if let hir::ConstTraitItem(_, _) = ti.node { if let hir::ConstTraitItem(..) = ti.node {
match self.impl_or_trait_item(self.map.local_def_id(ti.id)) { match self.impl_or_trait_item(self.map.local_def_id(ti.id)) {
ConstTraitItem(ac) => Some(ac), ConstTraitItem(ac) => Some(ac),
_ => { _ => {
@ -2306,7 +2306,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
} }
ItemImpl(.., ref iis) => { ItemImpl(.., ref iis) => {
iis.iter().filter_map(|ii| { iis.iter().filter_map(|ii| {
if let hir::ImplItemKind::Const(_, _) = ii.node { if let hir::ImplItemKind::Const(..) = ii.node {
match self.impl_or_trait_item(self.map.local_def_id(ii.id)) { match self.impl_or_trait_item(self.map.local_def_id(ii.id)) {
ConstTraitItem(ac) => Some(ac), ConstTraitItem(ac) => Some(ac),
_ => { _ => {

View file

@ -1171,7 +1171,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
pub fn fn_sig(&self) -> &'tcx PolyFnSig<'tcx> { pub fn fn_sig(&self) -> &'tcx PolyFnSig<'tcx> {
match self.sty { match self.sty {
TyFnDef(_, _, ref f) | TyFnPtr(ref f) => &f.sig, TyFnDef(.., ref f) | TyFnPtr(ref f) => &f.sig,
_ => bug!("Ty::fn_sig() called on non-fn type: {:?}", self) _ => bug!("Ty::fn_sig() called on non-fn type: {:?}", self)
} }
} }
@ -1179,7 +1179,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
/// Returns the ABI of the given function. /// Returns the ABI of the given function.
pub fn fn_abi(&self) -> abi::Abi { pub fn fn_abi(&self) -> abi::Abi {
match self.sty { match self.sty {
TyFnDef(_, _, ref f) | TyFnPtr(ref f) => f.abi, TyFnDef(.., ref f) | TyFnPtr(ref f) => f.abi,
_ => bug!("Ty::fn_abi() called on non-fn type"), _ => bug!("Ty::fn_abi() called on non-fn type"),
} }
} }
@ -1252,7 +1252,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
TyFloat(_) | TyFloat(_) |
TyBox(_) | TyBox(_) |
TyStr | TyStr |
TyArray(_, _) | TyArray(..) |
TySlice(_) | TySlice(_) |
TyRawPtr(_) | TyRawPtr(_) |
TyNever | TyNever |

View file

@ -439,7 +439,7 @@ impl<'a, 'gcx, 'tcx> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx> {
TyRef(_, m) => self.hash(m.mutbl), TyRef(_, m) => self.hash(m.mutbl),
TyClosure(def_id, _) | TyClosure(def_id, _) |
TyAnon(def_id, _) | TyAnon(def_id, _) |
TyFnDef(def_id, _, _) => self.def_id(def_id), TyFnDef(def_id, ..) => self.def_id(def_id),
TyFnPtr(f) => { TyFnPtr(f) => {
self.hash(f.unsafety); self.hash(f.unsafety);
self.hash(f.abi); self.hash(f.abi);

View file

@ -56,7 +56,7 @@ fn owned_ptr_base_path<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> &'a LoanPath<
} }
} }
LpDowncast(ref lp_base, _) | LpDowncast(ref lp_base, _) |
LpExtend(ref lp_base, _, _) => helper(&lp_base) LpExtend(ref lp_base, ..) => helper(&lp_base)
} }
} }
} }
@ -80,7 +80,7 @@ fn owned_ptr_base_path_rc<'tcx>(loan_path: &Rc<LoanPath<'tcx>>) -> Rc<LoanPath<'
} }
} }
LpDowncast(ref lp_base, _) | LpDowncast(ref lp_base, _) |
LpExtend(ref lp_base, _, _) => helper(lp_base) LpExtend(ref lp_base, ..) => helper(lp_base)
} }
} }
} }
@ -312,7 +312,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
break; break;
} }
LpDowncast(ref lp_base, _) | LpDowncast(ref lp_base, _) |
LpExtend(ref lp_base, _, _) => { LpExtend(ref lp_base, ..) => {
loan_path = &lp_base; loan_path = &lp_base;
} }
} }
@ -542,7 +542,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
err err
} }
(_, _) => { (..) => {
let mut err = struct_span_err!(self.bccx, new_loan.span, E0502, let mut err = struct_span_err!(self.bccx, new_loan.span, E0502,
"cannot borrow `{}`{} as {} because \ "cannot borrow `{}`{} as {} because \
{} is also borrowed as {}{}", {} is also borrowed as {}{}",

View file

@ -365,9 +365,9 @@ fn add_fragment_siblings<'a, 'tcx>(this: &MoveData<'tcx>,
} }
// *LV for unsafe and borrowed pointers do not consume their loan path, so stop here. // *LV for unsafe and borrowed pointers do not consume their loan path, so stop here.
LpExtend(_, _, LpDeref(mc::UnsafePtr(..))) | LpExtend(.., LpDeref(mc::UnsafePtr(..))) |
LpExtend(_, _, LpDeref(mc::Implicit(..))) | LpExtend(.., LpDeref(mc::Implicit(..))) |
LpExtend(_, _, LpDeref(mc::BorrowedPtr(..))) => {} LpExtend(.., LpDeref(mc::BorrowedPtr(..))) => {}
// FIXME (pnkfelix): LV[j] should be tracked, at least in the // FIXME (pnkfelix): LV[j] should be tracked, at least in the
// sense of we will track the remaining drop obligation of the // sense of we will track the remaining drop obligation of the
@ -378,7 +378,7 @@ fn add_fragment_siblings<'a, 'tcx>(this: &MoveData<'tcx>,
// bind. // bind.
// //
// Anyway, for now: LV[j] is not tracked precisely // Anyway, for now: LV[j] is not tracked precisely
LpExtend(_, _, LpInterior(_, InteriorElement(..))) => { LpExtend(.., LpInterior(_, InteriorElement(..))) => {
let mp = this.move_path(tcx, lp.clone()); let mp = this.move_path(tcx, lp.clone());
gathered_fragments.push(AllButOneFrom(mp)); gathered_fragments.push(AllButOneFrom(mp));
} }

View file

@ -161,9 +161,9 @@ fn check_and_get_illegal_move_origin<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
cmt: &mc::cmt<'tcx>) cmt: &mc::cmt<'tcx>)
-> Option<mc::cmt<'tcx>> { -> Option<mc::cmt<'tcx>> {
match cmt.cat { match cmt.cat {
Categorization::Deref(_, _, mc::BorrowedPtr(..)) | Categorization::Deref(.., mc::BorrowedPtr(..)) |
Categorization::Deref(_, _, mc::Implicit(..)) | Categorization::Deref(.., mc::Implicit(..)) |
Categorization::Deref(_, _, mc::UnsafePtr(..)) | Categorization::Deref(.., mc::UnsafePtr(..)) |
Categorization::StaticItem => { Categorization::StaticItem => {
Some(cmt.clone()) Some(cmt.clone())
} }

View file

@ -74,9 +74,9 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
Categorization::Rvalue(..) | Categorization::Rvalue(..) |
Categorization::Local(..) | // L-Local Categorization::Local(..) | // L-Local
Categorization::Upvar(..) | Categorization::Upvar(..) |
Categorization::Deref(_, _, mc::BorrowedPtr(..)) | // L-Deref-Borrowed Categorization::Deref(.., mc::BorrowedPtr(..)) | // L-Deref-Borrowed
Categorization::Deref(_, _, mc::Implicit(..)) | Categorization::Deref(.., mc::Implicit(..)) |
Categorization::Deref(_, _, mc::UnsafePtr(..)) => { Categorization::Deref(.., mc::UnsafePtr(..)) => {
self.check_scope(self.scope(cmt)) self.check_scope(self.scope(cmt))
} }
@ -119,11 +119,11 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
self.bccx.tcx.region_maps.var_scope(local_id))) self.bccx.tcx.region_maps.var_scope(local_id)))
} }
Categorization::StaticItem | Categorization::StaticItem |
Categorization::Deref(_, _, mc::UnsafePtr(..)) => { Categorization::Deref(.., mc::UnsafePtr(..)) => {
self.bccx.tcx.mk_region(ty::ReStatic) self.bccx.tcx.mk_region(ty::ReStatic)
} }
Categorization::Deref(_, _, mc::BorrowedPtr(_, r)) | Categorization::Deref(.., mc::BorrowedPtr(_, r)) |
Categorization::Deref(_, _, mc::Implicit(_, r)) => { Categorization::Deref(.., mc::Implicit(_, r)) => {
r r
} }
Categorization::Downcast(ref cmt, _) | Categorization::Downcast(ref cmt, _) |

View file

@ -205,7 +205,7 @@ fn check_aliasability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
alias_cause); alias_cause);
Err(()) Err(())
} }
(_, _) => { (..) => {
Ok(()) Ok(())
} }
} }

View file

@ -117,9 +117,9 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
move_from: mc::cmt<'tcx>) move_from: mc::cmt<'tcx>)
-> DiagnosticBuilder<'a> { -> DiagnosticBuilder<'a> {
match move_from.cat { match move_from.cat {
Categorization::Deref(_, _, mc::BorrowedPtr(..)) | Categorization::Deref(.., mc::BorrowedPtr(..)) |
Categorization::Deref(_, _, mc::Implicit(..)) | Categorization::Deref(.., mc::Implicit(..)) |
Categorization::Deref(_, _, mc::UnsafePtr(..)) | Categorization::Deref(.., mc::UnsafePtr(..)) |
Categorization::StaticItem => { Categorization::StaticItem => {
let mut err = struct_span_err!(bccx, move_from.span, E0507, let mut err = struct_span_err!(bccx, move_from.span, E0507,
"cannot move out of {}", "cannot move out of {}",

View file

@ -142,7 +142,7 @@ fn borrowck_item(this: &mut BorrowckCtxt, item: &hir::Item) {
// loan step is intended for things that have a data // loan step is intended for things that have a data
// flow dependent conditions. // flow dependent conditions.
match item.node { match item.node {
hir::ItemStatic(_, _, ref ex) | hir::ItemStatic(.., ref ex) |
hir::ItemConst(_, ref ex) => { hir::ItemConst(_, ref ex) => {
gather_loans::gather_loans_in_static_initializer(this, item.id, &ex); gather_loans::gather_loans_in_static_initializer(this, item.id, &ex);
} }
@ -422,7 +422,7 @@ pub fn closure_to_block(closure_id: ast::NodeId,
tcx: TyCtxt) -> ast::NodeId { tcx: TyCtxt) -> ast::NodeId {
match tcx.map.get(closure_id) { match tcx.map.get(closure_id) {
hir_map::NodeExpr(expr) => match expr.node { hir_map::NodeExpr(expr) => match expr.node {
hir::ExprClosure(_, _, ref block, _) => { hir::ExprClosure(.., ref block, _) => {
block.id block.id
} }
_ => { _ => {
@ -442,7 +442,7 @@ impl<'a, 'tcx> LoanPath<'tcx> {
tcx.region_maps.node_extent(block_id) tcx.region_maps.node_extent(block_id)
} }
LpDowncast(ref base, _) | LpDowncast(ref base, _) |
LpExtend(ref base, _, _) => base.kill_scope(tcx), LpExtend(ref base, ..) => base.kill_scope(tcx),
} }
} }
@ -464,7 +464,7 @@ impl<'a, 'tcx> LoanPath<'tcx> {
fn depth(&self) -> usize { fn depth(&self) -> usize {
match self.kind { match self.kind {
LpExtend(ref base, _, LpDeref(_)) => base.depth(), LpExtend(ref base, _, LpDeref(_)) => base.depth(),
LpExtend(ref base, _, LpInterior(_, _)) => base.depth() + 1, LpExtend(ref base, _, LpInterior(..)) => base.depth() + 1,
_ => 0, _ => 0,
} }
} }
@ -1177,7 +1177,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
out.push(')'); out.push(')');
} }
LpVar(..) | LpUpvar(..) | LpExtend(_, _, LpInterior(..)) => { LpVar(..) | LpUpvar(..) | LpExtend(.., LpInterior(..)) => {
self.append_loan_path_to_string(loan_path, out) self.append_loan_path_to_string(loan_path, out)
} }
} }

View file

@ -197,7 +197,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool {
LpVar(_) | LpUpvar(_) => { LpVar(_) | LpUpvar(_) => {
true true
} }
LpExtend(_, _, LpInterior(_, InteriorKind::InteriorElement(..))) => { LpExtend(.., LpInterior(_, InteriorKind::InteriorElement(..))) => {
// Paths involving element accesses a[i] do not refer to a unique // Paths involving element accesses a[i] do not refer to a unique
// location, as there is no accurate tracking of the indices. // location, as there is no accurate tracking of the indices.
// //
@ -207,7 +207,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool {
false false
} }
LpDowncast(ref lp_base, _) | LpDowncast(ref lp_base, _) |
LpExtend(ref lp_base, _, _) => { LpExtend(ref lp_base, ..) => {
loan_path_is_precise(&lp_base) loan_path_is_precise(&lp_base)
} }
} }
@ -295,7 +295,7 @@ impl<'a, 'tcx> MoveData<'tcx> {
} }
LpDowncast(ref base, _) | LpDowncast(ref base, _) |
LpExtend(ref base, _, _) => { LpExtend(ref base, ..) => {
let parent_index = self.move_path(tcx, base.clone()); let parent_index = self.move_path(tcx, base.clone());
let index = MovePathIndex(self.paths.borrow().len()); let index = MovePathIndex(self.paths.borrow().len());
@ -351,7 +351,7 @@ impl<'a, 'tcx> MoveData<'tcx> {
match lp.kind { match lp.kind {
LpVar(..) | LpUpvar(..) => { } LpVar(..) | LpUpvar(..) => { }
LpDowncast(ref b, _) | LpDowncast(ref b, _) |
LpExtend(ref b, _, _) => { LpExtend(ref b, ..) => {
self.add_existing_base_paths(b, result); self.add_existing_base_paths(b, result);
} }
} }

View file

@ -372,8 +372,8 @@ fn check_arms(cx: &MatchCheckCtxt,
/// Checks for common cases of "catchall" patterns that may not be intended as such. /// Checks for common cases of "catchall" patterns that may not be intended as such.
fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool { fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool {
match p.node { match p.node {
PatKind::Binding(_, _, None) => true, PatKind::Binding(.., None) => true,
PatKind::Binding(_, _, Some(ref s)) => pat_is_catchall(dm, &s), PatKind::Binding(.., Some(ref s)) => pat_is_catchall(dm, &s),
PatKind::Ref(ref s, _) => pat_is_catchall(dm, &s), PatKind::Ref(ref s, _) => pat_is_catchall(dm, &s),
PatKind::Tuple(ref v, _) => v.iter().all(|p| pat_is_catchall(dm, &p)), PatKind::Tuple(ref v, _) => v.iter().all(|p| pat_is_catchall(dm, &p)),
_ => false _ => false
@ -382,7 +382,7 @@ fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool {
fn raw_pat(p: &Pat) -> &Pat { fn raw_pat(p: &Pat) -> &Pat {
match p.node { match p.node {
PatKind::Binding(_, _, Some(ref s)) => raw_pat(&s), PatKind::Binding(.., Some(ref s)) => raw_pat(&s),
_ => p _ => p
} }
} }
@ -804,7 +804,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
vec![ConstantRange(eval_const_expr(cx.tcx, &lo), eval_const_expr(cx.tcx, &hi))], vec![ConstantRange(eval_const_expr(cx.tcx, &lo), eval_const_expr(cx.tcx, &hi))],
PatKind::Vec(ref before, ref slice, ref after) => PatKind::Vec(ref before, ref slice, ref after) =>
match left_ty.sty { match left_ty.sty {
ty::TyArray(_, _) => vec![Single], ty::TyArray(..) => vec![Single],
ty::TySlice(_) if slice.is_some() => { ty::TySlice(_) if slice.is_some() => {
(before.len() + after.len()..max_slice_length+1) (before.len() + after.len()..max_slice_length+1)
.map(|length| Slice(length)) .map(|length| Slice(length))
@ -866,7 +866,7 @@ fn wrap_pat<'a, 'b, 'tcx>(cx: &MatchCheckCtxt<'b, 'tcx>,
{ {
let pat_ty = cx.tcx.pat_ty(pat); let pat_ty = cx.tcx.pat_ty(pat);
(pat, Some(match pat.node { (pat, Some(match pat.node {
PatKind::Binding(hir::BindByRef(..), _, _) => { PatKind::Binding(hir::BindByRef(..), ..) => {
pat_ty.builtin_deref(false, NoPreference).unwrap().ty pat_ty.builtin_deref(false, NoPreference).unwrap().ty
} }
_ => pat_ty _ => pat_ty
@ -1217,7 +1217,7 @@ struct AtBindingPatternVisitor<'a, 'b:'a, 'tcx:'b> {
impl<'a, 'b, 'tcx, 'v> Visitor<'v> for AtBindingPatternVisitor<'a, 'b, 'tcx> { impl<'a, 'b, 'tcx, 'v> Visitor<'v> for AtBindingPatternVisitor<'a, 'b, 'tcx> {
fn visit_pat(&mut self, pat: &Pat) { fn visit_pat(&mut self, pat: &Pat) {
match pat.node { match pat.node {
PatKind::Binding(_, _, ref subpat) => { PatKind::Binding(.., ref subpat) => {
if !self.bindings_allowed { if !self.bindings_allowed {
span_err!(self.cx.tcx.sess, pat.span, E0303, span_err!(self.cx.tcx.sess, pat.span, E0303,
"pattern bindings are not allowed after an `@`"); "pattern bindings are not allowed after an `@`");

View file

@ -106,7 +106,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
_ => None _ => None
}, },
Some(ast_map::NodeTraitItem(ti)) => match ti.node { Some(ast_map::NodeTraitItem(ti)) => match ti.node {
hir::ConstTraitItem(_, _) => { hir::ConstTraitItem(..) => {
if let Some(substs) = substs { if let Some(substs) = substs {
// If we have a trait item and the substitutions for it, // If we have a trait item and the substitutions for it,
// `resolve_trait_associated_const` will select an impl // `resolve_trait_associated_const` will select an impl
@ -151,7 +151,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
_ => None _ => None
}, },
Some((&InlinedItem::TraitItem(trait_id, ref ti), _)) => match ti.node { Some((&InlinedItem::TraitItem(trait_id, ref ti), _)) => match ti.node {
hir::ConstTraitItem(_, _) => { hir::ConstTraitItem(..) => {
used_substs = true; used_substs = true;
if let Some(substs) = substs { if let Some(substs) = substs {
// As mentioned in the comments above for in-crate // As mentioned in the comments above for in-crate
@ -231,7 +231,7 @@ pub fn lookup_const_fn_by_id<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefI
FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) => { FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) => {
Some(fn_like) Some(fn_like)
} }
FnKind::Method(_, m, _, _) => { FnKind::Method(_, m, ..) => {
if m.constness == hir::Constness::Const { if m.constness == hir::Constness::Const {
Some(fn_like) Some(fn_like)
} else { } else {

View file

@ -24,6 +24,7 @@
#![cfg_attr(not(stage0), deny(warnings))] #![cfg_attr(not(stage0), deny(warnings))]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![feature(libc)] #![feature(libc)]
#![feature(quote)] #![feature(quote)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
@ -802,7 +803,7 @@ Available lint options:
let (plugin_groups, builtin_groups): (Vec<_>, _) = lint_store.get_lint_groups() let (plugin_groups, builtin_groups): (Vec<_>, _) = lint_store.get_lint_groups()
.iter() .iter()
.cloned() .cloned()
.partition(|&(_, _, p)| p); .partition(|&(.., p)| p);
let plugin_groups = sort_lint_groups(plugin_groups); let plugin_groups = sort_lint_groups(plugin_groups);
let builtin_groups = sort_lint_groups(builtin_groups); let builtin_groups = sort_lint_groups(builtin_groups);
@ -877,7 +878,7 @@ Available lint options:
println!("Compiler plugins can provide additional lints and lint groups. To see a \ println!("Compiler plugins can provide additional lints and lint groups. To see a \
listing of these, re-run `rustc -W help` with a crate filename."); listing of these, re-run `rustc -W help` with a crate filename.");
} }
(false, _, _) => panic!("didn't load lint plugins but got them anyway!"), (false, ..) => panic!("didn't load lint plugins but got them anyway!"),
(true, 0, 0) => println!("This crate does not load any lint plugins or lint groups."), (true, 0, 0) => println!("This crate does not load any lint plugins or lint groups."),
(true, l, g) => { (true, l, g) => {
if l > 0 { if l > 0 {

View file

@ -196,7 +196,7 @@ fn check_paths<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let targets = match then_this_would_need.get(id) { let targets = match then_this_would_need.get(id) {
Some(targets) => targets, Some(targets) => targets,
None => { None => {
for &(source_span, _, _) in sources.iter().take(1) { for &(source_span, ..) in sources.iter().take(1) {
tcx.sess.span_err( tcx.sess.span_err(
source_span, source_span,
&format!("no targets for id `{}`", id)); &format!("no targets for id `{}`", id));

View file

@ -158,7 +158,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
ExprCall(..) => SawExprCall, ExprCall(..) => SawExprCall,
ExprMethodCall(..) => SawExprMethodCall, ExprMethodCall(..) => SawExprMethodCall,
ExprTup(..) => SawExprTup, ExprTup(..) => SawExprTup,
ExprBinary(op, _, _) => SawExprBinary(op.node), ExprBinary(op, ..) => SawExprBinary(op.node),
ExprUnary(op, _) => SawExprUnary(op), ExprUnary(op, _) => SawExprUnary(op),
ExprLit(ref lit) => SawExprLit(lit.node.clone()), ExprLit(ref lit) => SawExprLit(lit.node.clone()),
ExprCast(..) => SawExprCast, ExprCast(..) => SawExprCast,
@ -170,7 +170,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
ExprClosure(..) => SawExprClosure, ExprClosure(..) => SawExprClosure,
ExprBlock(..) => SawExprBlock, ExprBlock(..) => SawExprBlock,
ExprAssign(..) => SawExprAssign, ExprAssign(..) => SawExprAssign,
ExprAssignOp(op, _, _) => SawExprAssignOp(op.node), ExprAssignOp(op, ..) => SawExprAssignOp(op.node),
ExprField(_, name) => SawExprField(name.node.as_str()), ExprField(_, name) => SawExprField(name.node.as_str()),
ExprTupField(_, id) => SawExprTupField(id.node), ExprTupField(_, id) => SawExprTupField(id.node),
ExprIndex(..) => SawExprIndex, ExprIndex(..) => SawExprIndex,
@ -179,7 +179,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
ExprBreak(id) => SawExprBreak(id.map(|id| id.node.as_str())), ExprBreak(id) => SawExprBreak(id.map(|id| id.node.as_str())),
ExprAgain(id) => SawExprAgain(id.map(|id| id.node.as_str())), ExprAgain(id) => SawExprAgain(id.map(|id| id.node.as_str())),
ExprRet(..) => SawExprRet, ExprRet(..) => SawExprRet,
ExprInlineAsm(ref a,_,_) => SawExprInlineAsm(a), ExprInlineAsm(ref a,..) => SawExprInlineAsm(a),
ExprStruct(..) => SawExprStruct, ExprStruct(..) => SawExprStruct,
ExprRepeat(..) => SawExprRepeat, ExprRepeat(..) => SawExprRepeat,
} }

View file

@ -19,6 +19,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")] html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))] #![cfg_attr(not(stage0), deny(warnings))]
#![feature(dotdot_in_tuple_patterns)]
#![feature(question_mark)] #![feature(question_mark)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(staged_api)] #![feature(staged_api)]

View file

@ -880,12 +880,12 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
fn all_except_most_recent(deletion_candidates: Vec<(SystemTime, PathBuf, Option<flock::Lock>)>) fn all_except_most_recent(deletion_candidates: Vec<(SystemTime, PathBuf, Option<flock::Lock>)>)
-> FnvHashMap<PathBuf, Option<flock::Lock>> { -> FnvHashMap<PathBuf, Option<flock::Lock>> {
let most_recent = deletion_candidates.iter() let most_recent = deletion_candidates.iter()
.map(|&(timestamp, _, _)| timestamp) .map(|&(timestamp, ..)| timestamp)
.max(); .max();
if let Some(most_recent) = most_recent { if let Some(most_recent) = most_recent {
deletion_candidates.into_iter() deletion_candidates.into_iter()
.filter(|&(timestamp, _, _)| timestamp != most_recent) .filter(|&(timestamp, ..)| timestamp != most_recent)
.map(|(_, path, lock)| (path, lock)) .map(|(_, path, lock)| (path, lock))
.collect() .collect()
} else { } else {

View file

@ -72,7 +72,7 @@ impl LintPass for WhileTrue {
impl LateLintPass for WhileTrue { impl LateLintPass for WhileTrue {
fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) { fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
if let hir::ExprWhile(ref cond, _, _) = e.node { if let hir::ExprWhile(ref cond, ..) = e.node {
if let hir::ExprLit(ref lit) = cond.node { if let hir::ExprLit(ref lit) = cond.node {
if let ast::LitKind::Bool(true) = lit.node { if let ast::LitKind::Bool(true) = lit.node {
cx.span_lint(WHILE_TRUE, e.span, cx.span_lint(WHILE_TRUE, e.span,
@ -219,7 +219,7 @@ impl LateLintPass for UnsafeCode {
FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, ..) => FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, ..) =>
cx.span_lint(UNSAFE_CODE, span, "declaration of an `unsafe` function"), cx.span_lint(UNSAFE_CODE, span, "declaration of an `unsafe` function"),
FnKind::Method(_, sig, _, _) => { FnKind::Method(_, sig, ..) => {
if sig.unsafety == hir::Unsafety::Unsafe { if sig.unsafety == hir::Unsafety::Unsafe {
cx.span_lint(UNSAFE_CODE, span, "implementation of an `unsafe` method") cx.span_lint(UNSAFE_CODE, span, "implementation of an `unsafe` method")
} }
@ -1116,7 +1116,7 @@ impl LateLintPass for MutableTransmutes {
} }
let typ = cx.tcx.node_id_to_type(expr.id); let typ = cx.tcx.node_id_to_type(expr.id);
match typ.sty { match typ.sty {
ty::TyFnDef(_, _, ref bare_fn) if bare_fn.abi == RustIntrinsic => { ty::TyFnDef(.., ref bare_fn) if bare_fn.abi == RustIntrinsic => {
let from = bare_fn.sig.0.inputs[0]; let from = bare_fn.sig.0.inputs[0];
let to = bare_fn.sig.0.output; let to = bare_fn.sig.0.output;
return Some((&from.sty, &to.sty)); return Some((&from.sty, &to.sty));
@ -1129,7 +1129,7 @@ impl LateLintPass for MutableTransmutes {
fn def_id_is_transmute(cx: &LateContext, def_id: DefId) -> bool { fn def_id_is_transmute(cx: &LateContext, def_id: DefId) -> bool {
match cx.tcx.lookup_item_type(def_id).ty.sty { match cx.tcx.lookup_item_type(def_id).ty.sty {
ty::TyFnDef(_, _, ref bfty) if bfty.abi == RustIntrinsic => (), ty::TyFnDef(.., ref bfty) if bfty.abi == RustIntrinsic => (),
_ => return false _ => return false
} }
cx.tcx.item_name(def_id).as_str() == "transmute" cx.tcx.item_name(def_id).as_str() == "transmute"

View file

@ -334,7 +334,7 @@ impl UnusedParens {
contains_exterior_struct_lit(&x) contains_exterior_struct_lit(&x)
} }
ast::ExprKind::MethodCall(_, _, ref exprs) => { ast::ExprKind::MethodCall(.., ref exprs) => {
// X { y: 1 }.bar(...) // X { y: 1 }.bar(...)
contains_exterior_struct_lit(&exprs[0]) contains_exterior_struct_lit(&exprs[0])
} }
@ -355,15 +355,15 @@ impl EarlyLintPass for UnusedParens {
fn check_expr(&mut self, cx: &EarlyContext, e: &ast::Expr) { fn check_expr(&mut self, cx: &EarlyContext, e: &ast::Expr) {
use syntax::ast::ExprKind::*; use syntax::ast::ExprKind::*;
let (value, msg, struct_lit_needs_parens) = match e.node { let (value, msg, struct_lit_needs_parens) = match e.node {
If(ref cond, _, _) => (cond, "`if` condition", true), If(ref cond, ..) => (cond, "`if` condition", true),
While(ref cond, _, _) => (cond, "`while` condition", true), While(ref cond, ..) => (cond, "`while` condition", true),
IfLet(_, ref cond, _, _) => (cond, "`if let` head expression", true), IfLet(_, ref cond, ..) => (cond, "`if let` head expression", true),
WhileLet(_, ref cond, _, _) => (cond, "`while let` head expression", true), WhileLet(_, ref cond, ..) => (cond, "`while let` head expression", true),
ForLoop(_, ref cond, _, _) => (cond, "`for` head expression", true), ForLoop(_, ref cond, ..) => (cond, "`for` head expression", true),
Match(ref head, _) => (head, "`match` head expression", true), Match(ref head, _) => (head, "`match` head expression", true),
Ret(Some(ref value)) => (value, "`return` value", false), Ret(Some(ref value)) => (value, "`return` value", false),
Assign(_, ref value) => (value, "assigned value", false), Assign(_, ref value) => (value, "assigned value", false),
AssignOp(_, _, ref value) => (value, "assigned value", false), AssignOp(.., ref value) => (value, "assigned value", false),
InPlace(_, ref value) => (value, "emplacement value", false), InPlace(_, ref value) => (value, "emplacement value", false),
_ => return _ => return
}; };

View file

@ -303,7 +303,7 @@ impl Folder for NestedItemsDropper {
blk.and_then(|hir::Block {id, stmts, expr, rules, span, ..}| { blk.and_then(|hir::Block {id, stmts, expr, rules, span, ..}| {
let stmts_sans_items = stmts.into_iter().filter_map(|stmt| { let stmts_sans_items = stmts.into_iter().filter_map(|stmt| {
let use_stmt = match stmt.node { let use_stmt = match stmt.node {
hir::StmtExpr(_, _) | hir::StmtSemi(_, _) => true, hir::StmtExpr(..) | hir::StmtSemi(..) => true,
hir::StmtDecl(ref decl, _) => { hir::StmtDecl(ref decl, _) => {
match decl.node { match decl.node {
hir::DeclLocal(_) => true, hir::DeclLocal(_) => true,

View file

@ -490,7 +490,7 @@ impl<'a> CrateReader<'a> {
// numbers // numbers
let map: FnvHashMap<_, _> = decoder::get_crate_deps(cdata).iter().map(|dep| { let map: FnvHashMap<_, _> = decoder::get_crate_deps(cdata).iter().map(|dep| {
debug!("resolving dep crate {} hash: `{}`", dep.name, dep.hash); debug!("resolving dep crate {} hash: `{}`", dep.name, dep.hash);
let (local_cnum, _, _) = self.resolve_crate(root, let (local_cnum, ..) = self.resolve_crate(root,
&dep.name, &dep.name,
&dep.name, &dep.name,
Some(&dep.hash), Some(&dep.hash),
@ -1003,7 +1003,7 @@ impl<'a> LocalCrateReader<'a> {
if !info.should_link { if !info.should_link {
return; return;
} }
let (cnum, _, _) = self.creader.resolve_crate(&None, let (cnum, ..) = self.creader.resolve_crate(&None,
&info.ident, &info.ident,
&info.name, &info.name,
None, None,

View file

@ -492,7 +492,7 @@ pub fn get_adt_def<'a, 'tcx>(cdata: Cmd,
variant.name, variant.name,
ctor_ty); ctor_ty);
let field_tys = match ctor_ty.sty { let field_tys = match ctor_ty.sty {
ty::TyFnDef(_, _, &ty::BareFnTy { sig: ty::Binder(ty::FnSig { ty::TyFnDef(.., &ty::BareFnTy { sig: ty::Binder(ty::FnSig {
ref inputs, .. ref inputs, ..
}), ..}) => { }), ..}) => {
// tuple-struct constructors don't have escaping regions // tuple-struct constructors don't have escaping regions
@ -952,7 +952,7 @@ pub fn get_impl_or_trait_item<'a, 'tcx>(cdata: Cmd, id: DefIndex, tcx: TyCtxt<'a
let predicates = doc_predicates(item_doc, tcx, cdata, tag_item_predicates); let predicates = doc_predicates(item_doc, tcx, cdata, tag_item_predicates);
let ity = tcx.lookup_item_type(def_id).ty; let ity = tcx.lookup_item_type(def_id).ty;
let fty = match ity.sty { let fty = match ity.sty {
ty::TyFnDef(_, _, fty) => fty, ty::TyFnDef(.., fty) => fty,
_ => bug!( _ => bug!(
"the type {:?} of the method {:?} is not a function?", "the type {:?} of the method {:?} is not a function?",
ity, name) ity, name)

View file

@ -915,7 +915,7 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
encode_deprecation(self.rbml_w, depr); encode_deprecation(self.rbml_w, depr);
encode_attributes(self.rbml_w, &item.attrs); encode_attributes(self.rbml_w, &item.attrs);
} }
hir::ItemConst(_, _) => { hir::ItemConst(..) => {
encode_def_id_and_key(ecx, self.rbml_w, def_id); encode_def_id_and_key(ecx, self.rbml_w, def_id);
encode_family(self.rbml_w, 'C'); encode_family(self.rbml_w, 'C');
self.encode_bounds_and_type_for_item(item.id); self.encode_bounds_and_type_for_item(item.id);

View file

@ -217,7 +217,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
let kind = match expr.node { let kind = match expr.node {
// Here comes the interesting stuff: // Here comes the interesting stuff:
hir::ExprMethodCall(_, _, ref args) => { hir::ExprMethodCall(.., ref args) => {
// Rewrite a.b(c) into UFCS form like Trait::b(a, c) // Rewrite a.b(c) into UFCS form like Trait::b(a, c)
let expr = method_callee(cx, expr, ty::MethodCall::expr(expr.id)); let expr = method_callee(cx, expr, ty::MethodCall::expr(expr.id));
let args = args.iter() let args = args.iter()
@ -242,7 +242,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
let method = method_callee(cx, expr, ty::MethodCall::expr(expr.id)); let method = method_callee(cx, expr, ty::MethodCall::expr(expr.id));
let sig = match method.ty.sty { let sig = match method.ty.sty {
ty::TyFnDef(_, _, fn_ty) => &fn_ty.sig, ty::TyFnDef(.., fn_ty) => &fn_ty.sig,
_ => span_bug!(expr.span, "type of method is not an fn") _ => span_bug!(expr.span, "type of method is not an fn")
}; };
@ -743,7 +743,7 @@ fn convert_var<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
let body_id = match cx.tcx.map.find(closure_expr_id) { let body_id = match cx.tcx.map.find(closure_expr_id) {
Some(map::NodeExpr(expr)) => { Some(map::NodeExpr(expr)) => {
match expr.node { match expr.node {
hir::ExprClosure(_, _, ref body, _) => body.id, hir::ExprClosure(.., ref body, _) => body.id,
_ => { _ => {
span_bug!(expr.span, "closure expr is not a closure expr"); span_bug!(expr.span, "closure expr is not a closure expr");
} }

View file

@ -54,7 +54,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
let fn_like = FnLikeNode::from_node(infcx.tcx.map.get(id)); let fn_like = FnLikeNode::from_node(infcx.tcx.map.get(id));
match fn_like.map(|f| f.kind()) { match fn_like.map(|f| f.kind()) {
Some(FnKind::ItemFn(_, _, _, c, ..)) => c, Some(FnKind::ItemFn(_, _, _, c, ..)) => c,
Some(FnKind::Method(_, m, _, _)) => m.constness, Some(FnKind::Method(_, m, ..)) => m.constness,
_ => hir::Constness::NotConst _ => hir::Constness::NotConst
} }
} }

View file

@ -122,7 +122,7 @@ fn is_const_fn(tcx: TyCtxt, def_id: DefId) -> bool {
Some(FnKind::ItemFn(_, _, _, c, ..)) => { Some(FnKind::ItemFn(_, _, _, c, ..)) => {
c == hir::Constness::Const c == hir::Constness::Const
} }
Some(FnKind::Method(_, m, _, _)) => { Some(FnKind::Method(_, m, ..)) => {
m.constness == hir::Constness::Const m.constness == hir::Constness::Const
} }
_ => false _ => false
@ -576,9 +576,9 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
Rvalue::Repeat(..) | Rvalue::Repeat(..) |
Rvalue::UnaryOp(..) | Rvalue::UnaryOp(..) |
Rvalue::CheckedBinaryOp(..) | Rvalue::CheckedBinaryOp(..) |
Rvalue::Cast(CastKind::ReifyFnPointer, _, _) | Rvalue::Cast(CastKind::ReifyFnPointer, ..) |
Rvalue::Cast(CastKind::UnsafeFnPointer, _, _) | Rvalue::Cast(CastKind::UnsafeFnPointer, ..) |
Rvalue::Cast(CastKind::Unsize, _, _) => {} Rvalue::Cast(CastKind::Unsize, ..) => {}
Rvalue::Len(_) => { Rvalue::Len(_) => {
// Static lvalues in consts would have errored already, // Static lvalues in consts would have errored already,
@ -705,7 +705,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
} }
Rvalue::Aggregate(ref kind, _) => { Rvalue::Aggregate(ref kind, _) => {
if let AggregateKind::Adt(def, _, _, _) = *kind { if let AggregateKind::Adt(def, ..) = *kind {
if def.has_dtor() { if def.has_dtor() {
self.add(Qualif::NEEDS_DROP); self.add(Qualif::NEEDS_DROP);
self.deny_drop(); self.deny_drop();

View file

@ -457,7 +457,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
let func_ty = func.ty(mir, tcx); let func_ty = func.ty(mir, tcx);
debug!("check_terminator: call, func_ty={:?}", func_ty); debug!("check_terminator: call, func_ty={:?}", func_ty);
let func_ty = match func_ty.sty { let func_ty = match func_ty.sty {
ty::TyFnDef(_, _, func_ty) | ty::TyFnPtr(func_ty) => func_ty, ty::TyFnDef(.., func_ty) | ty::TyFnPtr(func_ty) => func_ty,
_ => { _ => {
span_mirbug!(self, term, "call to non-function {:?}", func_ty); span_mirbug!(self, term, "call to non-function {:?}", func_ty);
return; return;

View file

@ -98,7 +98,7 @@ impl<'a> Visitor for AstValidator<'a> {
fn visit_expr(&mut self, expr: &Expr) { fn visit_expr(&mut self, expr: &Expr) {
match expr.node { match expr.node {
ExprKind::While(_, _, Some(ident)) | ExprKind::While(.., Some(ident)) |
ExprKind::Loop(_, Some(ident)) | ExprKind::Loop(_, Some(ident)) |
ExprKind::WhileLet(.., Some(ident)) | ExprKind::WhileLet(.., Some(ident)) |
ExprKind::ForLoop(.., Some(ident)) | ExprKind::ForLoop(.., Some(ident)) |

View file

@ -149,7 +149,7 @@ impl<'a, 'gcx> CheckCrateVisitor<'a, 'gcx> {
let mode = match fk { let mode = match fk {
FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) FnKind::ItemFn(_, _, _, hir::Constness::Const, ..)
=> Mode::ConstFn, => Mode::ConstFn,
FnKind::Method(_, m, _, _) => { FnKind::Method(_, m, ..) => {
if m.constness == hir::Constness::Const { if m.constness == hir::Constness::Const {
Mode::ConstFn Mode::ConstFn
} else { } else {
@ -307,8 +307,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
hir::DeclItem(_) => continue, hir::DeclItem(_) => continue,
} }
} }
hir::StmtExpr(_, _) => {} hir::StmtExpr(..) => {}
hir::StmtSemi(_, _) => {} hir::StmtSemi(..) => {}
} }
self.add_qualif(ConstQualif::NOT_CONST); self.add_qualif(ConstQualif::NOT_CONST);
} }
@ -671,7 +671,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
Categorization::StaticItem => { Categorization::StaticItem => {
break; break;
} }
Categorization::Deref(ref cmt, _, _) | Categorization::Deref(ref cmt, ..) |
Categorization::Downcast(ref cmt, _) | Categorization::Downcast(ref cmt, _) |
Categorization::Interior(ref cmt, _) => cur = cmt, Categorization::Interior(ref cmt, _) => cur = cmt,
@ -716,7 +716,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
// type of the expression. `&mut [1]` has exactly the // type of the expression. `&mut [1]` has exactly the
// same representation as &mut 1. // same representation as &mut 1.
match cmt.ty.sty { match cmt.ty.sty {
ty::TyArray(_, _) | ty::TyArray(..) |
ty::TySlice(_) => break, ty::TySlice(_) => break,
_ => {} _ => {}
} }
@ -727,7 +727,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
Categorization::StaticItem => { Categorization::StaticItem => {
break; break;
} }
Categorization::Deref(ref cmt, _, _) | Categorization::Deref(ref cmt, ..) |
Categorization::Downcast(ref cmt, _) | Categorization::Downcast(ref cmt, _) |
Categorization::Interior(ref cmt, _) => { Categorization::Interior(ref cmt, _) => {
cur = cmt; cur = cmt;

View file

@ -53,7 +53,7 @@ impl<'a, 'v> Visitor<'v> for CheckLoopVisitor<'a> {
hir::ExprLoop(ref b, _) => { hir::ExprLoop(ref b, _) => {
self.with_context(Loop, |v| v.visit_block(&b)); self.with_context(Loop, |v| v.visit_block(&b));
} }
hir::ExprClosure(_, _, ref b, _) => { hir::ExprClosure(.., ref b, _) => {
self.with_context(Closure, |v| v.visit_block(&b)); self.with_context(Closure, |v| v.visit_block(&b));
} }
hir::ExprBreak(_) => self.require_loop("break", e.span), hir::ExprBreak(_) => self.require_loop("break", e.span),

View file

@ -249,7 +249,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
// The interface is empty // The interface is empty
hir::ItemDefaultImpl(..) => {} hir::ItemDefaultImpl(..) => {}
// Visit everything except for private impl items // Visit everything except for private impl items
hir::ItemImpl(_, _, ref generics, None, _, ref impl_items) => { hir::ItemImpl(.., ref generics, None, _, ref impl_items) => {
if item_level.is_some() { if item_level.is_some() {
self.reach().visit_generics(generics); self.reach().visit_generics(generics);
for impl_item in impl_items { for impl_item in impl_items {
@ -454,7 +454,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
if let Def::Struct(..) = self.tcx.expect_def(expr.id) { if let Def::Struct(..) = self.tcx.expect_def(expr.id) {
let expr_ty = self.tcx.expr_ty(expr); let expr_ty = self.tcx.expr_ty(expr);
let def = match expr_ty.sty { let def = match expr_ty.sty {
ty::TyFnDef(_, _, &ty::BareFnTy { sig: ty::Binder(ty::FnSig { ty::TyFnDef(.., &ty::BareFnTy { sig: ty::Binder(ty::FnSig {
output: ty, .. output: ty, ..
}), ..}) => ty, }), ..}) => ty,
_ => expr_ty _ => expr_ty
@ -644,7 +644,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx>
// namespace (the contents have their own privacies). // namespace (the contents have their own privacies).
hir::ItemForeignMod(_) => {} hir::ItemForeignMod(_) => {}
hir::ItemTrait(_, _, ref bounds, _) => { hir::ItemTrait(.., ref bounds, _) => {
if !self.trait_is_public(item.id) { if !self.trait_is_public(item.id) {
return return
} }
@ -659,7 +659,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx>
// (i.e. we could just return here to not check them at // (i.e. we could just return here to not check them at
// all, or some worse estimation of whether an impl is // all, or some worse estimation of whether an impl is
// publicly visible). // publicly visible).
hir::ItemImpl(_, _, ref g, ref trait_ref, ref self_, ref impl_items) => { hir::ItemImpl(.., ref g, ref trait_ref, ref self_, ref impl_items) => {
// `impl [... for] Private` is never visible. // `impl [... for] Private` is never visible.
let self_contains_private; let self_contains_private;
// impl [... for] Public<...>, but not `impl [... for] // impl [... for] Public<...>, but not `impl [... for]
@ -1091,7 +1091,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivateItemsInPublicInterfacesVisitor<'a, 'tc
hir::ItemDefaultImpl(..) => {} hir::ItemDefaultImpl(..) => {}
// An inherent impl is public when its type is public // An inherent impl is public when its type is public
// Subitems of inherent impls have their own publicity // Subitems of inherent impls have their own publicity
hir::ItemImpl(_, _, ref generics, None, ref ty, ref impl_items) => { hir::ItemImpl(.., ref generics, None, ref ty, ref impl_items) => {
let ty_vis = self.ty_visibility(ty); let ty_vis = self.ty_visibility(ty);
check.required_visibility = ty_vis; check.required_visibility = ty_vis;
check.visit_generics(generics); check.visit_generics(generics);
@ -1105,7 +1105,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivateItemsInPublicInterfacesVisitor<'a, 'tc
} }
// A trait impl is public when both its type and its trait are public // A trait impl is public when both its type and its trait are public
// Subitems of trait impls have inherited publicity // Subitems of trait impls have inherited publicity
hir::ItemImpl(_, _, ref generics, Some(ref trait_ref), ref ty, ref impl_items) => { hir::ItemImpl(.., ref generics, Some(ref trait_ref), ref ty, ref impl_items) => {
let vis = min(self.ty_visibility(ty), self.trait_ref_visibility(trait_ref)); let vis = min(self.ty_visibility(ty), self.trait_ref_visibility(trait_ref));
check.required_visibility = vis; check.required_visibility = vis;
check.visit_generics(generics); check.visit_generics(generics);

View file

@ -228,7 +228,7 @@ impl<'b> Resolver<'b> {
let def = Def::Static(self.definitions.local_def_id(item.id), mutbl); let def = Def::Static(self.definitions.local_def_id(item.id), mutbl);
self.define(parent, name, ValueNS, (def, sp, vis)); self.define(parent, name, ValueNS, (def, sp, vis));
} }
ItemKind::Const(_, _) => { ItemKind::Const(..) => {
let def = Def::Const(self.definitions.local_def_id(item.id)); let def = Def::Const(self.definitions.local_def_id(item.id));
self.define(parent, name, ValueNS, (def, sp, vis)); self.define(parent, name, ValueNS, (def, sp, vis));
} }
@ -292,7 +292,7 @@ impl<'b> Resolver<'b> {
self.structs.insert(item_def_id, field_names); self.structs.insert(item_def_id, field_names);
} }
ItemKind::DefaultImpl(_, _) | ItemKind::Impl(..) => {} ItemKind::DefaultImpl(..) | ItemKind::Impl(..) => {}
ItemKind::Trait(.., ref items) => { ItemKind::Trait(.., ref items) => {
let def_id = self.definitions.local_def_id(item.id); let def_id = self.definitions.local_def_id(item.id);

View file

@ -95,7 +95,7 @@ impl<'a, 'b> Visitor for UnusedImportCheckVisitor<'a, 'b> {
} }
ast::ItemKind::Use(ref p) => { ast::ItemKind::Use(ref p) => {
match p.node { match p.node {
ViewPathSimple(_, _) => { ViewPathSimple(..) => {
self.check_import(item.id, p.span) self.check_import(item.id, p.span)
} }

View file

@ -381,7 +381,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
module = path, module = path,
ident = ident.node) ident = ident.node)
} }
Some(&ExprKind::MethodCall(ident, _, _)) => { Some(&ExprKind::MethodCall(ident, ..)) => {
format!("to call a function from the `{module}` module, \ format!("to call a function from the `{module}` module, \
use `{module}::{ident}(..)`", use `{module}::{ident}(..)`",
module = path, module = path,
@ -1643,7 +1643,7 @@ impl<'a> Resolver<'a> {
ItemKind::DefaultImpl(_, ref trait_ref) => { ItemKind::DefaultImpl(_, ref trait_ref) => {
self.with_optional_trait_ref(Some(trait_ref), |_, _| {}); self.with_optional_trait_ref(Some(trait_ref), |_, _| {});
} }
ItemKind::Impl(_, _, ref generics, ref opt_trait_ref, ref self_type, ref impl_items) => ItemKind::Impl(.., ref generics, ref opt_trait_ref, ref self_type, ref impl_items) =>
self.resolve_implementation(generics, self.resolve_implementation(generics,
opt_trait_ref, opt_trait_ref,
&self_type, &self_type,
@ -2369,7 +2369,7 @@ impl<'a> Resolver<'a> {
self.record_def(pat.id, resolution); self.record_def(pat.id, resolution);
} }
PatKind::TupleStruct(ref path, _, _) => { PatKind::TupleStruct(ref path, ..) => {
self.resolve_pattern_path(pat.id, None, path, ValueNS, |def| { self.resolve_pattern_path(pat.id, None, path, ValueNS, |def| {
match def { match def {
Def::Struct(..) | Def::Variant(..) => true, Def::Struct(..) | Def::Variant(..) => true,
@ -2388,7 +2388,7 @@ impl<'a> Resolver<'a> {
}, "variant, struct or constant"); }, "variant, struct or constant");
} }
PatKind::Struct(ref path, _, _) => { PatKind::Struct(ref path, ..) => {
self.resolve_pattern_path(pat.id, None, path, TypeNS, |def| { self.resolve_pattern_path(pat.id, None, path, TypeNS, |def| {
match def { match def {
Def::Struct(..) | Def::Union(..) | Def::Variant(..) | Def::Struct(..) | Def::Union(..) | Def::Variant(..) |
@ -2963,7 +2963,7 @@ impl<'a> Resolver<'a> {
visit::walk_expr(self, expr); visit::walk_expr(self, expr);
} }
ExprKind::Struct(ref path, _, _) => { ExprKind::Struct(ref path, ..) => {
// Resolve the path to the structure it goes to. We don't // Resolve the path to the structure it goes to. We don't
// check to ensure that the path is actually a structure; that // check to ensure that the path is actually a structure; that
// is checked later during typeck. // is checked later during typeck.
@ -2985,7 +2985,7 @@ impl<'a> Resolver<'a> {
visit::walk_expr(self, expr); visit::walk_expr(self, expr);
} }
ExprKind::Loop(_, Some(label)) | ExprKind::While(_, _, Some(label)) => { ExprKind::Loop(_, Some(label)) | ExprKind::While(.., Some(label)) => {
self.with_label_rib(|this| { self.with_label_rib(|this| {
let def = Def::Label(expr.id); let def = Def::Label(expr.id);
@ -3077,7 +3077,7 @@ impl<'a> Resolver<'a> {
let traits = self.get_traits_containing_item(name.node.name); let traits = self.get_traits_containing_item(name.node.name);
self.trait_map.insert(expr.id, traits); self.trait_map.insert(expr.id, traits);
} }
ExprKind::MethodCall(name, _, _) => { ExprKind::MethodCall(name, ..) => {
debug!("(recording candidate traits for expr) recording traits for {}", debug!("(recording candidate traits for expr) recording traits for {}",
expr.id); expr.id);
let traits = self.get_traits_containing_item(name.node.name); let traits = self.get_traits_containing_item(name.node.name);
@ -3241,7 +3241,7 @@ impl<'a> Resolver<'a> {
if !in_module_is_extern || name_binding.vis == ty::Visibility::Public { if !in_module_is_extern || name_binding.vis == ty::Visibility::Public {
// add the module to the lookup // add the module to the lookup
let is_extern = in_module_is_extern || name_binding.is_extern_crate(); let is_extern = in_module_is_extern || name_binding.is_extern_crate();
if !worklist.iter().any(|&(m, _, _)| m.def == module.def) { if !worklist.iter().any(|&(m, ..)| m.def == module.def) {
worklist.push((module, path_segments, is_extern)); worklist.push((module, path_segments, is_extern));
} }
} }

View file

@ -312,7 +312,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
qualname: String::new() qualname: String::new()
}.lower(self.tcx)); }.lower(self.tcx));
} }
Def::Static(_, _) | Def::Static(..) |
Def::Const(_) | Def::Const(_) |
Def::AssociatedConst(..) | Def::AssociatedConst(..) |
Def::Local(..) | Def::Local(..) |
@ -351,7 +351,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
let mut collector = PathCollector::new(); let mut collector = PathCollector::new();
collector.visit_pat(&arg.pat); collector.visit_pat(&arg.pat);
let span_utils = self.span.clone(); let span_utils = self.span.clone();
for &(id, ref p, _, _) in &collector.collected_paths { for &(id, ref p, ..) in &collector.collected_paths {
let typ = self.tcx.node_types().get(&id).unwrap().to_string(); let typ = self.tcx.node_types().get(&id).unwrap().to_string();
// get the span only for the name of the variable (I hope the path is only ever a // get the span only for the name of the variable (I hope the path is only ever a
// variable name, but who knows?) // variable name, but who knows?)
@ -879,7 +879,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
} }
} }
Def::Local(..) | Def::Local(..) |
Def::Static(_,_) | Def::Static(..) |
Def::Const(..) | Def::Const(..) |
Def::AssociatedConst(..) | Def::AssociatedConst(..) |
Def::Struct(..) | Def::Struct(..) |
@ -1145,7 +1145,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
self.process_static_or_const_item(item, &typ, &expr), self.process_static_or_const_item(item, &typ, &expr),
Struct(ref def, ref ty_params) => self.process_struct(item, def, ty_params), Struct(ref def, ref ty_params) => self.process_struct(item, def, ty_params),
Enum(ref def, ref ty_params) => self.process_enum(item, def, ty_params), Enum(ref def, ref ty_params) => self.process_enum(item, def, ty_params),
Impl(_, _, Impl(..,
ref ty_params, ref ty_params,
ref trait_ref, ref trait_ref,
ref typ, ref typ,
@ -1280,7 +1280,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
let def = self.tcx.expect_def(hir_expr.id); let def = self.tcx.expect_def(hir_expr.id);
self.process_struct_lit(ex, path, fields, adt.variant_of_def(def), base) self.process_struct_lit(ex, path, fields, adt.variant_of_def(def), base)
} }
ast::ExprKind::MethodCall(_, _, ref args) => self.process_method_call(ex, args), ast::ExprKind::MethodCall(.., ref args) => self.process_method_call(ex, args),
ast::ExprKind::Field(ref sub_ex, _) => { ast::ExprKind::Field(ref sub_ex, _) => {
self.visit_expr(&sub_ex); self.visit_expr(&sub_ex);
@ -1409,7 +1409,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
paths_to_process.push((id, p.clone(), Some(ref_kind))) paths_to_process.push((id, p.clone(), Some(ref_kind)))
} }
// FIXME(nrc) what are these doing here? // FIXME(nrc) what are these doing here?
Def::Static(_, _) | Def::Static(..) |
Def::Const(..) | Def::Const(..) |
Def::AssociatedConst(..) => {} Def::AssociatedConst(..) => {}
def => error!("unexpected definition kind when processing collected paths: {:?}", def => error!("unexpected definition kind when processing collected paths: {:?}",

View file

@ -422,7 +422,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
} }
} }
} }
ast::ExprKind::Struct(ref path, _, _) => { ast::ExprKind::Struct(ref path, ..) => {
match self.tcx.expr_ty_adjusted(&hir_node).sty { match self.tcx.expr_ty_adjusted(&hir_node).sty {
ty::TyStruct(def, _) | ty::TyUnion(def, _) => { ty::TyStruct(def, _) | ty::TyUnion(def, _) => {
let sub_span = self.span_utils.span_for_last_ident(path.span); let sub_span = self.span_utils.span_for_last_ident(path.span);
@ -694,11 +694,11 @@ impl PathCollector {
impl Visitor for PathCollector { impl Visitor for PathCollector {
fn visit_pat(&mut self, p: &ast::Pat) { fn visit_pat(&mut self, p: &ast::Pat) {
match p.node { match p.node {
PatKind::Struct(ref path, _, _) => { PatKind::Struct(ref path, ..) => {
self.collected_paths.push((p.id, path.clone(), self.collected_paths.push((p.id, path.clone(),
ast::Mutability::Mutable, recorder::TypeRef)); ast::Mutability::Mutable, recorder::TypeRef));
} }
PatKind::TupleStruct(ref path, _, _) | PatKind::TupleStruct(ref path, ..) |
PatKind::Path(_, ref path) => { PatKind::Path(_, ref path) => {
self.collected_paths.push((p.id, path.clone(), self.collected_paths.push((p.id, path.clone(),
ast::Mutability::Mutable, recorder::VarRef)); ast::Mutability::Mutable, recorder::VarRef));

View file

@ -701,7 +701,7 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
debug!("adt::generic_type_of r: {:?} name: {:?} sizing: {} dst: {}", debug!("adt::generic_type_of r: {:?} name: {:?} sizing: {} dst: {}",
r, name, sizing, dst); r, name, sizing, dst);
match *r { match *r {
CEnum(ity, _, _) => ll_inttype(cx, ity), CEnum(ity, ..) => ll_inttype(cx, ity),
RawNullablePointer { nnty, .. } => RawNullablePointer { nnty, .. } =>
type_of::sizing_type_of(cx, nnty), type_of::sizing_type_of(cx, nnty),
StructWrappedNullablePointer { nonnull: ref st, .. } => { StructWrappedNullablePointer { nonnull: ref st, .. } => {
@ -839,7 +839,7 @@ pub fn trans_switch<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
pub fn is_discr_signed<'tcx>(r: &Repr<'tcx>) -> bool { pub fn is_discr_signed<'tcx>(r: &Repr<'tcx>) -> bool {
match *r { match *r {
CEnum(ity, _, _) => ity.is_signed(), CEnum(ity, ..) => ity.is_signed(),
General(ity, _) => ity.is_signed(), General(ity, _) => ity.is_signed(),
Univariant(..) | UntaggedUnion(..) => false, Univariant(..) | UntaggedUnion(..) => false,
RawNullablePointer { .. } => false, RawNullablePointer { .. } => false,
@ -918,7 +918,7 @@ fn load_discr(bcx: Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr,
pub fn trans_case<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr, discr: Disr) pub fn trans_case<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr, discr: Disr)
-> ValueRef { -> ValueRef {
match *r { match *r {
CEnum(ity, _, _) => { CEnum(ity, ..) => {
C_integral(ll_inttype(bcx.ccx(), ity), discr.0, true) C_integral(ll_inttype(bcx.ccx(), ity), discr.0, true)
} }
General(ity, _) => { General(ity, _) => {

View file

@ -1130,10 +1130,10 @@ pub unsafe fn with_llvm_pmb(llmod: ModuleRef,
// inline with lifetime intrinsics, and O2+ we add an inliner with a // inline with lifetime intrinsics, and O2+ we add an inliner with a
// thresholds copied from clang. // thresholds copied from clang.
match (opt_level, opt_size, inline_threshold) { match (opt_level, opt_size, inline_threshold) {
(_, _, Some(t)) => { (.., Some(t)) => {
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, t as u32); llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, t as u32);
} }
(llvm::CodeGenOptLevel::Aggressive, _, _) => { (llvm::CodeGenOptLevel::Aggressive, ..) => {
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 275); llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 275);
} }
(_, llvm::CodeGenOptSizeDefault, _) => { (_, llvm::CodeGenOptSizeDefault, _) => {
@ -1142,16 +1142,16 @@ pub unsafe fn with_llvm_pmb(llmod: ModuleRef,
(_, llvm::CodeGenOptSizeAggressive, _) => { (_, llvm::CodeGenOptSizeAggressive, _) => {
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 25); llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 25);
} }
(llvm::CodeGenOptLevel::None, _, _) => { (llvm::CodeGenOptLevel::None, ..) => {
llvm::LLVMRustAddAlwaysInlinePass(builder, false); llvm::LLVMRustAddAlwaysInlinePass(builder, false);
} }
(llvm::CodeGenOptLevel::Less, _, _) => { (llvm::CodeGenOptLevel::Less, ..) => {
llvm::LLVMRustAddAlwaysInlinePass(builder, true); llvm::LLVMRustAddAlwaysInlinePass(builder, true);
} }
(llvm::CodeGenOptLevel::Default, _, _) => { (llvm::CodeGenOptLevel::Default, ..) => {
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 225); llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 225);
} }
(llvm::CodeGenOptLevel::Other, _, _) => { (llvm::CodeGenOptLevel::Other, ..) => {
bug!("CodeGenOptLevel::Other selected") bug!("CodeGenOptLevel::Other selected")
} }
} }

View file

@ -924,7 +924,7 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
block_arena: &'blk TypedArena<common::BlockS<'blk, 'tcx>>) block_arena: &'blk TypedArena<common::BlockS<'blk, 'tcx>>)
-> FunctionContext<'blk, 'tcx> { -> FunctionContext<'blk, 'tcx> {
let (param_substs, def_id) = match definition { let (param_substs, def_id) = match definition {
Some((instance, _, _)) => { Some((instance, ..)) => {
common::validate_substs(instance.substs); common::validate_substs(instance.substs);
(instance.substs, Some(instance.def)) (instance.substs, Some(instance.def))
} }

View file

@ -182,7 +182,7 @@ fn classify_ty(ty: Type) -> Vec<RegClass> {
(SSEDs, SSEUp) | (SSEDs, SSEUp) |
(SSEInt(_), SSEUp) => return, (SSEInt(_), SSEUp) => return,
(_, _) => newv (..) => newv
}; };
cls[i] = to_write; cls[i] = to_write;
} }

View file

@ -98,7 +98,7 @@ impl<'tcx> Callee<'tcx> {
} }
let fn_ty = def_ty(ccx.shared(), def_id, substs); let fn_ty = def_ty(ccx.shared(), def_id, substs);
if let ty::TyFnDef(_, _, f) = fn_ty.sty { if let ty::TyFnDef(.., f) = fn_ty.sty {
if f.abi == Abi::RustIntrinsic || f.abi == Abi::PlatformIntrinsic { if f.abi == Abi::RustIntrinsic || f.abi == Abi::PlatformIntrinsic {
return Callee { return Callee {
data: Intrinsic, data: Intrinsic,
@ -314,7 +314,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
// Construct the "tuply" version of `bare_fn_ty`. It takes two arguments: `self`, // Construct the "tuply" version of `bare_fn_ty`. It takes two arguments: `self`,
// which is the fn pointer, and `args`, which is the arguments tuple. // which is the fn pointer, and `args`, which is the arguments tuple.
let sig = match bare_fn_ty.sty { let sig = match bare_fn_ty.sty {
ty::TyFnDef(_, _, ty::TyFnDef(..,
&ty::BareFnTy { unsafety: hir::Unsafety::Normal, &ty::BareFnTy { unsafety: hir::Unsafety::Normal,
abi: Abi::Rust, abi: Abi::Rust,
ref sig }) | ref sig }) |
@ -442,7 +442,7 @@ fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
// other weird situations. Annoying. // other weird situations. Annoying.
let fn_ptr_ty = match fn_ty.sty { let fn_ptr_ty = match fn_ty.sty {
ty::TyFnDef(_, _, fty) => { ty::TyFnDef(.., fty) => {
// Create a fn pointer with the substituted signature. // Create a fn pointer with the substituted signature.
tcx.mk_fn_ptr(fty) tcx.mk_fn_ptr(fty)
} }

View file

@ -628,7 +628,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
def_id: DefId) def_id: DefId)
-> bool { -> bool {
if !match tcx.lookup_item_type(def_id).ty.sty { if !match tcx.lookup_item_type(def_id).ty.sty {
ty::TyFnDef(def_id, _, _) => { ty::TyFnDef(def_id, ..) => {
// Some constructors also have type TyFnDef but they are // Some constructors also have type TyFnDef but they are
// always instantiated inline and don't result in // always instantiated inline and don't result in
// translation item. Same for FFI functions. // translation item. Same for FFI functions.
@ -1214,8 +1214,7 @@ fn create_trans_items_for_default_impls<'a, 'tcx>(scx: &SharedCrateContext<'a, '
hir::ItemImpl(_, hir::ItemImpl(_,
_, _,
ref generics, ref generics,
_, ..,
_,
ref items) => { ref items) => {
if generics.is_type_parameterized() { if generics.is_type_parameterized() {
return return

View file

@ -252,7 +252,7 @@ impl<'tcx> TypeMap<'tcx> {
principal.substs, principal.substs,
&mut unique_type_id); &mut unique_type_id);
}, },
ty::TyFnDef(_, _, &ty::BareFnTy{ unsafety, abi, ref sig } ) | ty::TyFnDef(.., &ty::BareFnTy{ unsafety, abi, ref sig } ) |
ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => { ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => {
if unsafety == hir::Unsafety::Unsafe { if unsafety == hir::Unsafety::Unsafe {
unique_type_id.push_str("unsafe "); unique_type_id.push_str("unsafe ");
@ -756,7 +756,7 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
} }
} }
} }
ty::TyFnDef(_, _, ref barefnty) | ty::TyFnPtr(ref barefnty) => { ty::TyFnDef(.., ref barefnty) | ty::TyFnPtr(ref barefnty) => {
let fn_metadata = subroutine_type_metadata(cx, let fn_metadata = subroutine_type_metadata(cx,
unique_type_id, unique_type_id,
&barefnty.sig, &barefnty.sig,
@ -1679,7 +1679,7 @@ fn prepare_enum_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
let type_rep = adt::represent_type(cx, enum_type); let type_rep = adt::represent_type(cx, enum_type);
let discriminant_type_metadata = match *type_rep { let discriminant_type_metadata = match *type_rep {
adt::CEnum(inttype, _, _) => { adt::CEnum(inttype, ..) => {
return FinalMetadata(discriminant_type_metadata(inttype)) return FinalMetadata(discriminant_type_metadata(inttype))
}, },
adt::RawNullablePointer { .. } | adt::RawNullablePointer { .. } |

View file

@ -100,7 +100,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
push_item_name(cx, principal.def_id, false, output); push_item_name(cx, principal.def_id, false, output);
push_type_params(cx, principal.substs, output); push_type_params(cx, principal.substs, output);
}, },
ty::TyFnDef(_, _, &ty::BareFnTy{ unsafety, abi, ref sig } ) | ty::TyFnDef(.., &ty::BareFnTy{ unsafety, abi, ref sig } ) |
ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => { ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => {
if unsafety == hir::Unsafety::Unsafe { if unsafety == hir::Unsafety::Unsafe {
output.push_str("unsafe "); output.push_str("unsafe ");

View file

@ -544,7 +544,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
} }
(_, _) => { (..) => {
let intr = match Intrinsic::find(&name) { let intr = match Intrinsic::find(&name) {
Some(intr) => intr, Some(intr) => intr,
None => bug!("unknown intrinsic '{}'", name), None => bug!("unknown intrinsic '{}'", name),

View file

@ -406,7 +406,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
// Handle intrinsics old trans wants Expr's for, ourselves. // Handle intrinsics old trans wants Expr's for, ourselves.
let intrinsic = match (&callee.ty.sty, &callee.data) { let intrinsic = match (&callee.ty.sty, &callee.data) {
(&ty::TyFnDef(def_id, _, _), &Intrinsic) => { (&ty::TyFnDef(def_id, ..), &Intrinsic) => {
Some(bcx.tcx().item_name(def_id).as_str()) Some(bcx.tcx().item_name(def_id).as_str())
} }
_ => None _ => None
@ -880,7 +880,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
// FIXME #19925 Remove this hack after a release cycle. // FIXME #19925 Remove this hack after a release cycle.
let f = Callee::def(bcx.ccx(), def_id, substs); let f = Callee::def(bcx.ccx(), def_id, substs);
let ty = match f.ty.sty { let ty = match f.ty.sty {
ty::TyFnDef(_, _, f) => bcx.tcx().mk_fn_ptr(f), ty::TyFnDef(.., f) => bcx.tcx().mk_fn_ptr(f),
_ => f.ty _ => f.ty
}; };
val = OperandRef { val = OperandRef {

View file

@ -454,7 +454,7 @@ pub fn push_unique_type_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
&trait_data.projection_bounds, &trait_data.projection_bounds,
output); output);
}, },
ty::TyFnDef(_, _, &ty::BareFnTy{ unsafety, abi, ref sig } ) | ty::TyFnDef(.., &ty::BareFnTy{ unsafety, abi, ref sig } ) |
ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => { ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => {
if unsafety == hir::Unsafety::Unsafe { if unsafety == hir::Unsafety::Unsafe {
output.push_str("unsafe "); output.push_str("unsafe ");

View file

@ -186,7 +186,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let error_fn_sig; let error_fn_sig;
let fn_sig = match callee_ty.sty { let fn_sig = match callee_ty.sty {
ty::TyFnDef(_, _, &ty::BareFnTy {ref sig, ..}) | ty::TyFnDef(.., &ty::BareFnTy {ref sig, ..}) |
ty::TyFnPtr(&ty::BareFnTy {ref sig, ..}) => { ty::TyFnPtr(&ty::BareFnTy {ref sig, ..}) => {
sig sig
} }

View file

@ -319,7 +319,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
(Some(t_from), Some(t_cast)) => (t_from, t_cast), (Some(t_from), Some(t_cast)) => (t_from, t_cast),
// Function item types may need to be reified before casts. // Function item types may need to be reified before casts.
(None, Some(t_cast)) => { (None, Some(t_cast)) => {
if let ty::TyFnDef(_, _, f) = self.expr_ty.sty { if let ty::TyFnDef(.., f) = self.expr_ty.sty {
// Attempt a coercion to a fn pointer type. // Attempt a coercion to a fn pointer type.
let res = fcx.try_coerce(self.expr, fcx.tcx.mk_fn_ptr(f)); let res = fcx.try_coerce(self.expr, fcx.tcx.mk_fn_ptr(f));
if !res.is_ok() { if !res.is_ok() {

View file

@ -195,7 +195,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
} }
match a.sty { match a.sty {
ty::TyFnDef(_, _, a_f) => { ty::TyFnDef(.., a_f) => {
// Function items are coercible to any closure // Function items are coercible to any closure
// type; function pointers are not (that would // type; function pointers are not (that would
// require double indirection). // require double indirection).

View file

@ -53,7 +53,7 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
if i_n_tps != n_tps { if i_n_tps != n_tps {
let span = match it.node { let span = match it.node {
hir::ForeignItemFn(_, ref generics) => generics.span, hir::ForeignItemFn(_, ref generics) => generics.span,
hir::ForeignItemStatic(_, _) => it.span hir::ForeignItemStatic(..) => it.span
}; };
struct_span_err!(tcx.sess, span, E0094, struct_span_err!(tcx.sess, span, E0094,

View file

@ -501,7 +501,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
assert!(adr.unsize.is_none()); assert!(adr.unsize.is_none());
(adr.autoderefs, None) (adr.autoderefs, None)
} }
Some(AutoPtr(_, _)) => { Some(AutoPtr(..)) => {
(adr.autoderefs, adr.unsize.map(|target| { (adr.autoderefs, adr.unsize.map(|target| {
target.builtin_deref(false, NoPreference) target.builtin_deref(false, NoPreference)
.expect("fixup: AutoPtr is not &T").ty .expect("fixup: AutoPtr is not &T").ty

View file

@ -1314,8 +1314,8 @@ impl<'tcx> Candidate<'tcx> {
Pick { Pick {
item: self.item.clone(), item: self.item.clone(),
kind: match self.kind { kind: match self.kind {
InherentImplCandidate(_, _) => InherentImplPick, InherentImplCandidate(..) => InherentImplPick,
ExtensionImplCandidate(def_id, _, _) => { ExtensionImplCandidate(def_id, ..) => {
ExtensionImplPick(def_id) ExtensionImplPick(def_id)
} }
ObjectCandidate => ObjectPick, ObjectCandidate => ObjectPick,
@ -1340,10 +1340,10 @@ impl<'tcx> Candidate<'tcx> {
fn to_source(&self) -> CandidateSource { fn to_source(&self) -> CandidateSource {
match self.kind { match self.kind {
InherentImplCandidate(_, _) => { InherentImplCandidate(..) => {
ImplSource(self.item.container().id()) ImplSource(self.item.container().id())
} }
ExtensionImplCandidate(def_id, _, _) => ImplSource(def_id), ExtensionImplCandidate(def_id, ..) => ImplSource(def_id),
ObjectCandidate | ObjectCandidate |
TraitCandidate | TraitCandidate |
WhereClauseCandidate(_) => TraitSource(self.item.container().id()), WhereClauseCandidate(_) => TraitSource(self.item.container().id()),

View file

@ -536,7 +536,7 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
fn_id: ast::NodeId) { fn_id: ast::NodeId) {
let raw_fty = ccx.tcx.lookup_item_type(ccx.tcx.map.local_def_id(fn_id)).ty; let raw_fty = ccx.tcx.lookup_item_type(ccx.tcx.map.local_def_id(fn_id)).ty;
let fn_ty = match raw_fty.sty { let fn_ty = match raw_fty.sty {
ty::TyFnDef(_, _, f) => f, ty::TyFnDef(.., f) => f,
_ => span_bug!(body.span, "check_bare_fn: function type expected") _ => span_bug!(body.span, "check_bare_fn: function type expected")
}; };
@ -732,7 +732,7 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) {
let _indenter = indenter(); let _indenter = indenter();
match it.node { match it.node {
// Consts can play a role in type-checking, so they are included here. // Consts can play a role in type-checking, so they are included here.
hir::ItemStatic(_, _, ref e) | hir::ItemStatic(.., ref e) |
hir::ItemConst(_, ref e) => check_const(ccx, &e, it.id), hir::ItemConst(_, ref e) => check_const(ccx, &e, it.id),
hir::ItemEnum(ref enum_definition, _) => { hir::ItemEnum(ref enum_definition, _) => {
check_enum_variants(ccx, check_enum_variants(ccx,
@ -2410,7 +2410,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
self.tcx.types.err self.tcx.types.err
} else { } else {
match method_fn_ty.sty { match method_fn_ty.sty {
ty::TyFnDef(_, _, ref fty) => { ty::TyFnDef(.., ref fty) => {
// HACK(eddyb) ignore self in the definition (see above). // HACK(eddyb) ignore self in the definition (see above).
let expected_arg_tys = self.expected_types_for_fn_args(sp, expected, let expected_arg_tys = self.expected_types_for_fn_args(sp, expected,
fty.sig.0.output, fty.sig.0.output,
@ -2647,7 +2647,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
t) t)
}, arg_ty); }, arg_ty);
} }
ty::TyFnDef(_, _, f) => { ty::TyFnDef(.., f) => {
let ptr_ty = self.tcx.mk_fn_ptr(f); let ptr_ty = self.tcx.mk_fn_ptr(f);
let ptr_ty = self.resolve_type_vars_if_possible(&ptr_ty); let ptr_ty = self.resolve_type_vars_if_possible(&ptr_ty);
self.type_error_message(arg.span, self.type_error_message(arg.span,
@ -3983,7 +3983,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
_ => false, _ => false,
} }
} }
hir::StmtExpr(_, _) | hir::StmtSemi(_, _) => true, hir::StmtExpr(..) | hir::StmtSemi(..) => true,
} { } {
self.tcx self.tcx
.sess .sess
@ -4209,7 +4209,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
self.tcx.prohibit_type_params(&segments[..segments.len() - poly_segments]); self.tcx.prohibit_type_params(&segments[..segments.len() - poly_segments]);
match def { match def {
Def::Local(_, nid) | Def::Upvar(_, nid, _, _) => { Def::Local(_, nid) | Def::Upvar(_, nid, ..) => {
let ty = self.local_ty(span, nid); let ty = self.local_ty(span, nid);
let ty = self.normalize_associated_types_in(span, &ty); let ty = self.normalize_associated_types_in(span, &ty);
self.write_ty(node_id, ty); self.write_ty(node_id, ty);

View file

@ -576,7 +576,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for RegionCtxt<'a, 'gcx, 'tcx> {
} }
} }
/* /*
adjustment::AutoObject(_, ref bounds, _, _) => { adjustment::AutoObject(_, ref bounds, ..) => {
// Determine if we are casting `expr` to a trait // Determine if we are casting `expr` to a trait
// instance. If so, we have to be sure that the type // instance. If so, we have to be sure that the type
// of the source obeys the new region bound. // of the source obeys the new region bound.
@ -643,7 +643,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for RegionCtxt<'a, 'gcx, 'tcx> {
intravisit::walk_expr(self, expr); intravisit::walk_expr(self, expr);
} }
hir::ExprMethodCall(_, _, ref args) => { hir::ExprMethodCall(.., ref args) => {
self.constrain_call(expr, Some(&args[0]), self.constrain_call(expr, Some(&args[0]),
args[1..].iter().map(|e| &**e), false); args[1..].iter().map(|e| &**e), false);
@ -758,7 +758,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for RegionCtxt<'a, 'gcx, 'tcx> {
intravisit::walk_expr(self, expr); intravisit::walk_expr(self, expr);
} }
hir::ExprClosure(_, _, ref body, _) => { hir::ExprClosure(.., ref body, _) => {
self.check_expr_fn_block(expr, &body); self.check_expr_fn_block(expr, &body);
} }
@ -1156,7 +1156,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
let _ = mc.cat_pattern(discr_cmt, root_pat, |_, sub_cmt, sub_pat| { let _ = mc.cat_pattern(discr_cmt, root_pat, |_, sub_cmt, sub_pat| {
match sub_pat.node { match sub_pat.node {
// `ref x` pattern // `ref x` pattern
PatKind::Binding(hir::BindByRef(mutbl), _, _) => { PatKind::Binding(hir::BindByRef(mutbl), ..) => {
self.link_region_from_node_type(sub_pat.span, sub_pat.id, self.link_region_from_node_type(sub_pat.span, sub_pat.id,
mutbl, sub_cmt); mutbl, sub_cmt);
} }
@ -1269,7 +1269,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
borrow_kind = borrow_kind; borrow_kind = borrow_kind;
} }
Categorization::Deref(_, _, mc::UnsafePtr(..)) | Categorization::Deref(.., mc::UnsafePtr(..)) |
Categorization::StaticItem | Categorization::StaticItem |
Categorization::Upvar(..) | Categorization::Upvar(..) |
Categorization::Local(..) | Categorization::Local(..) |

View file

@ -283,8 +283,8 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> {
debug!("adjust_upvar_borrow_kind_for_consume: guarantor={:?}", debug!("adjust_upvar_borrow_kind_for_consume: guarantor={:?}",
guarantor); guarantor);
match guarantor.cat { match guarantor.cat {
Categorization::Deref(_, _, mc::BorrowedPtr(..)) | Categorization::Deref(.., mc::BorrowedPtr(..)) |
Categorization::Deref(_, _, mc::Implicit(..)) => { Categorization::Deref(.., mc::Implicit(..)) => {
match cmt.note { match cmt.note {
mc::NoteUpvarRef(upvar_id) => { mc::NoteUpvarRef(upvar_id) => {
debug!("adjust_upvar_borrow_kind_for_consume: \ debug!("adjust_upvar_borrow_kind_for_consume: \
@ -344,7 +344,7 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> {
} }
} }
Categorization::Deref(_, _, mc::UnsafePtr(..)) | Categorization::Deref(.., mc::UnsafePtr(..)) |
Categorization::StaticItem | Categorization::StaticItem |
Categorization::Rvalue(_) | Categorization::Rvalue(_) |
Categorization::Local(_) | Categorization::Local(_) |
@ -376,7 +376,7 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> {
} }
} }
Categorization::Deref(_, _, mc::UnsafePtr(..)) | Categorization::Deref(.., mc::UnsafePtr(..)) |
Categorization::StaticItem | Categorization::StaticItem |
Categorization::Rvalue(_) | Categorization::Rvalue(_) |
Categorization::Local(_) | Categorization::Local(_) |

View file

@ -112,7 +112,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
ref trait_ref, ref self_ty, _) => { ref trait_ref, ref self_ty, _) => {
self.check_impl(item, self_ty, trait_ref); self.check_impl(item, self_ty, trait_ref);
} }
hir::ItemImpl(_, hir::ImplPolarity::Negative, _, Some(_), _, _) => { hir::ItemImpl(_, hir::ImplPolarity::Negative, _, Some(_), ..) => {
// FIXME(#27579) what amount of WF checking do we need for neg impls? // FIXME(#27579) what amount of WF checking do we need for neg impls?
let trait_ref = ccx.tcx.impl_trait_ref(ccx.tcx.map.local_def_id(item.id)).unwrap(); let trait_ref = ccx.tcx.impl_trait_ref(ccx.tcx.map.local_def_id(item.id)).unwrap();
@ -286,7 +286,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
let type_scheme = fcx.tcx.lookup_item_type(fcx.tcx.map.local_def_id(item.id)); let type_scheme = fcx.tcx.lookup_item_type(fcx.tcx.map.local_def_id(item.id));
let item_ty = fcx.instantiate_type_scheme(item.span, free_substs, &type_scheme.ty); let item_ty = fcx.instantiate_type_scheme(item.span, free_substs, &type_scheme.ty);
let bare_fn_ty = match item_ty.sty { let bare_fn_ty = match item_ty.sty {
ty::TyFnDef(_, _, ref bare_fn_ty) => bare_fn_ty, ty::TyFnDef(.., ref bare_fn_ty) => bare_fn_ty,
_ => { _ => {
span_bug!(item.span, "Fn item without fn type"); span_bug!(item.span, "Fn item without fn type");
} }

View file

@ -201,7 +201,7 @@ impl<'cx, 'gcx, 'tcx, 'v> Visitor<'v> for WritebackCx<'cx, 'gcx, 'tcx> {
self.visit_method_map_entry(ResolvingExpr(e.span), self.visit_method_map_entry(ResolvingExpr(e.span),
MethodCall::expr(e.id)); MethodCall::expr(e.id));
if let hir::ExprClosure(_, ref decl, _, _) = e.node { if let hir::ExprClosure(_, ref decl, ..) = e.node {
for input in &decl.inputs { for input in &decl.inputs {
self.visit_node_id(ResolvingExpr(e.span), input.id); self.visit_node_id(ResolvingExpr(e.span), input.id);
} }
@ -323,7 +323,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
// Free regions that come from early-bound regions are valid. // Free regions that come from early-bound regions are valid.
ty::ReFree(ty::FreeRegion { ty::ReFree(ty::FreeRegion {
bound_region: ty::BoundRegion::BrNamed(def_id, _, _), .. bound_region: ty::BoundRegion::BrNamed(def_id, ..), ..
}) if self.free_to_bound_regions.contains_key(&def_id) => { }) if self.free_to_bound_regions.contains_key(&def_id) => {
self.free_to_bound_regions[&def_id] self.free_to_bound_regions[&def_id]
} }

View file

@ -86,7 +86,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {
TyBool | TyChar | TyInt(..) | TyUint(..) | TyFloat(..) | TyBool | TyChar | TyInt(..) | TyUint(..) | TyFloat(..) |
TyStr | TyArray(..) | TySlice(..) | TyFnDef(..) | TyFnPtr(_) | TyStr | TyArray(..) | TySlice(..) | TyFnDef(..) | TyFnPtr(_) |
TyTuple(..) | TyParam(..) | TyError | TyNever | TyTuple(..) | TyParam(..) | TyError | TyNever |
TyRawPtr(_) | TyRef(_, _) | TyProjection(..) => { TyRawPtr(_) | TyRef(..) | TyProjection(..) => {
None None
} }

View file

@ -740,7 +740,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
tcx.impl_trait_refs.borrow_mut().insert(ccx.tcx.map.local_def_id(it.id), tcx.impl_trait_refs.borrow_mut().insert(ccx.tcx.map.local_def_id(it.id),
Some(trait_ref)); Some(trait_ref));
} }
hir::ItemImpl(_, _, hir::ItemImpl(..,
ref generics, ref generics,
ref opt_trait_ref, ref opt_trait_ref,
ref selfty, ref selfty,
@ -1456,7 +1456,7 @@ fn generics_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
generics generics
} }
ItemTrait(_, ref generics, _, _) => { ItemTrait(_, ref generics, ..) => {
// Add in the self type parameter. // Add in the self type parameter.
// //
// Something of a hack: use the node id for the trait, also as // Something of a hack: use the node id for the trait, also as
@ -1566,7 +1566,7 @@ fn type_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
let ty = match ccx.tcx.map.get(node_id) { let ty = match ccx.tcx.map.get(node_id) {
NodeItem(item) => { NodeItem(item) => {
match item.node { match item.node {
ItemStatic(ref t, _, _) | ItemConst(ref t, _) => { ItemStatic(ref t, ..) | ItemConst(ref t, _) => {
ccx.icx(&()).to_ty(&ElidableRscope::new(ty::ReStatic), &t) ccx.icx(&()).to_ty(&ElidableRscope::new(ty::ReStatic), &t)
} }
ItemFn(ref decl, unsafety, _, abi, ref generics, _) => { ItemFn(ref decl, unsafety, _, abi, ref generics, _) => {

View file

@ -415,7 +415,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
} }
} }
ty::TyFnDef(_, _, &ty::BareFnTy { ref sig, .. }) | ty::TyFnDef(.., &ty::BareFnTy { ref sig, .. }) |
ty::TyFnPtr(&ty::BareFnTy { ref sig, .. }) => { ty::TyFnPtr(&ty::BareFnTy { ref sig, .. }) => {
self.add_constraints_from_sig(generics, sig, variance); self.add_constraints_from_sig(generics, sig, variance);
} }

View file

@ -238,7 +238,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> {
hir::ItemUnion(_, ref generics) => { hir::ItemUnion(_, ref generics) => {
self.add_inferreds_for_item(item.id, false, generics); self.add_inferreds_for_item(item.id, false, generics);
} }
hir::ItemTrait(_, ref generics, _, _) => { hir::ItemTrait(_, ref generics, ..) => {
// Note: all inputs for traits are ultimately // Note: all inputs for traits are ultimately
// constrained to be invariant. See `visit_item` in // constrained to be invariant. See `visit_item` in
// the impl for `ConstraintContext` in `constraints.rs`. // the impl for `ConstraintContext` in `constraints.rs`.

View file

@ -180,7 +180,7 @@ fn build_external_function<'a, 'tcx>(cx: &DocContext, tcx: TyCtxt<'a, 'tcx, 'tcx
did: DefId) -> clean::Function { did: DefId) -> clean::Function {
let t = tcx.lookup_item_type(did); let t = tcx.lookup_item_type(did);
let (decl, style, abi) = match t.ty.sty { let (decl, style, abi) = match t.ty.sty {
ty::TyFnDef(_, _, ref f) => ((did, &f.sig).clean(cx), f.unsafety, f.abi), ty::TyFnDef(.., ref f) => ((did, &f.sig).clean(cx), f.unsafety, f.abi),
_ => panic!("bad function"), _ => panic!("bad function"),
}; };

View file

@ -642,7 +642,7 @@ fn external_path_params(cx: &DocContext, trait_did: Option<DefId>, has_self: boo
output: output output: output
} }
}, },
(_, _) => { (..) => {
PathParameters::AngleBracketed { PathParameters::AngleBracketed {
lifetimes: lifetimes, lifetimes: lifetimes,
types: types.clean(cx), types: types.clean(cx),
@ -717,7 +717,7 @@ impl<'tcx> Clean<TyParamBound> for ty::TraitRef<'tcx> {
if let ty::TyTuple(ts) = ty_s.sty { if let ty::TyTuple(ts) = ty_s.sty {
for &ty_s in ts { for &ty_s in ts {
if let ty::TyRef(ref reg, _) = ty_s.sty { if let ty::TyRef(ref reg, _) = ty_s.sty {
if let &ty::Region::ReLateBound(_, _) = *reg { if let &ty::Region::ReLateBound(..) = *reg {
debug!(" hit an ReLateBound {:?}", reg); debug!(" hit an ReLateBound {:?}", reg);
if let Some(lt) = reg.clean(cx) { if let Some(lt) = reg.clean(cx) {
late_bounds.push(lt); late_bounds.push(lt);
@ -1794,7 +1794,7 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
mutability: mt.mutbl.clean(cx), mutability: mt.mutbl.clean(cx),
type_: box mt.ty.clean(cx), type_: box mt.ty.clean(cx),
}, },
ty::TyFnDef(_, _, ref fty) | ty::TyFnDef(.., ref fty) |
ty::TyFnPtr(ref fty) => BareFunction(box BareFunctionDecl { ty::TyFnPtr(ref fty) => BareFunction(box BareFunctionDecl {
unsafety: fty.unsafety, unsafety: fty.unsafety,
generics: Generics { generics: Generics {
@ -2699,7 +2699,7 @@ fn name_from_pat(p: &hir::Pat) -> String {
match p.node { match p.node {
PatKind::Wild => "_".to_string(), PatKind::Wild => "_".to_string(),
PatKind::Binding(_, ref p, _) => p.node.to_string(), PatKind::Binding(_, ref p, _) => p.node.to_string(),
PatKind::TupleStruct(ref p, _, _) | PatKind::Path(None, ref p) => path_to_string(p), PatKind::TupleStruct(ref p, ..) | PatKind::Path(None, ref p) => path_to_string(p),
PatKind::Path(..) => panic!("tried to get argument name from qualified PatKind::Path, \ PatKind::Path(..) => panic!("tried to get argument name from qualified PatKind::Path, \
which is not allowed in function arguments"), which is not allowed in function arguments"),
PatKind::Struct(ref name, ref fields, etc) => { PatKind::Struct(ref name, ref fields, etc) => {

View file

@ -1891,7 +1891,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
(false, &Some(ref tracker_url), Some(issue_no)) if issue_no > 0 => (false, &Some(ref tracker_url), Some(issue_no)) if issue_no > 0 =>
format!(" (<a href=\"{}{}\">#{}</a>)", Escape(&tracker_url), issue_no, format!(" (<a href=\"{}{}\">#{}</a>)", Escape(&tracker_url), issue_no,
issue_no), issue_no),
(true, _, _) => (true, ..) =>
format!(" (<code>{}</code>)", Escape(&stab.feature)), format!(" (<code>{}</code>)", Escape(&stab.feature)),
_ => String::new(), _ => String::new(),
} }

View file

@ -20,6 +20,7 @@
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![feature(libc)] #![feature(libc)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(set_stdio)] #![feature(set_stdio)]
@ -420,7 +421,7 @@ fn rust_input(cratefile: &str, externs: Externs, matches: &getopts::Matches) ->
let mut pm = plugins::PluginManager::new(PathBuf::from(path)); let mut pm = plugins::PluginManager::new(PathBuf::from(path));
for pass in &passes { for pass in &passes {
let plugin = match PASSES.iter() let plugin = match PASSES.iter()
.position(|&(p, _, _)| { .position(|&(p, ..)| {
p == *pass p == *pass
}) { }) {
Some(i) => PASSES[i].1, Some(i) => PASSES[i].1,

View file

@ -82,7 +82,7 @@ impl fmt::Display for FromHexError {
impl error::Error for FromHexError { impl error::Error for FromHexError {
fn description(&self) -> &str { fn description(&self) -> &str {
match *self { match *self {
InvalidHexCharacter(_, _) => "invalid character", InvalidHexCharacter(..) => "invalid character",
InvalidHexLength => "invalid length", InvalidHexLength => "invalid length",
} }
} }

View file

@ -332,7 +332,7 @@ impl<'a> Prefix<'a> {
pub fn is_verbatim(&self) -> bool { pub fn is_verbatim(&self) -> bool {
use self::Prefix::*; use self::Prefix::*;
match *self { match *self {
Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(_, _) => true, Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(..) => true,
_ => false, _ => false,
} }
} }

View file

@ -561,7 +561,7 @@ impl Pat {
} }
PatKind::Wild | PatKind::Wild |
PatKind::Lit(_) | PatKind::Lit(_) |
PatKind::Range(_, _) | PatKind::Range(..) |
PatKind::Ident(..) | PatKind::Ident(..) |
PatKind::Path(..) | PatKind::Path(..) |
PatKind::Mac(_) => { PatKind::Mac(_) => {

View file

@ -156,7 +156,7 @@ pub fn count_names(ms: &[TokenTree]) -> usize {
TokenTree::Token(_, MatchNt(..)) => { TokenTree::Token(_, MatchNt(..)) => {
1 1
} }
TokenTree::Token(_, _) => 0, TokenTree::Token(..) => 0,
} }
}) })
} }
@ -231,7 +231,7 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
TokenTree::Token(sp, SubstNt(..)) => { TokenTree::Token(sp, SubstNt(..)) => {
return Err((sp, "missing fragment specifier".to_string())) return Err((sp, "missing fragment specifier".to_string()))
} }
TokenTree::Token(_, _) => (), TokenTree::Token(..) => (),
} }
Ok(()) Ok(())

View file

@ -180,7 +180,7 @@ impl Token {
Ident(..) => true, Ident(..) => true,
Underscore => true, Underscore => true,
Tilde => true, Tilde => true,
Literal(_, _) => true, Literal(..) => true,
Not => true, Not => true,
BinOp(Minus) => true, BinOp(Minus) => true,
BinOp(Star) => true, BinOp(Star) => true,
@ -202,7 +202,7 @@ impl Token {
/// Returns `true` if the token is any literal /// Returns `true` if the token is any literal
pub fn is_lit(&self) -> bool { pub fn is_lit(&self) -> bool {
match *self { match *self {
Literal(_, _) => true, Literal(..) => true,
_ => false, _ => false,
} }
} }

View file

@ -233,7 +233,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt,
p.bump(); p.bump();
state = st; state = st;
} }
(&token::Eof, _, _) => break 'statement, (&token::Eof, ..) => break 'statement,
_ => break, _ => break,
} }
} }

Some files were not shown because too many files have changed in this diff Show more