Skip to content

Commit e05e74a

Browse files
committed
Replace _, _ with ..
1 parent 6f7e51e commit e05e74a

File tree

107 files changed

+275
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+275
-271
lines changed

src/libgetopts/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl OptGroup {
279279
}],
280280
}
281281
}
282-
(_, _) => panic!("something is wrong with the long-form opt"),
282+
_ => panic!("something is wrong with the long-form opt"),
283283
}
284284
}
285285
}

src/librustc/cfg/construct.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
9999

100100
fn pat(&mut self, pat: &hir::Pat, pred: CFGIndex) -> CFGIndex {
101101
match pat.node {
102-
PatKind::Binding(_, _, None) |
102+
PatKind::Binding(.., None) |
103103
PatKind::Path(..) |
104104
PatKind::Lit(..) |
105105
PatKind::Range(..) |
@@ -109,7 +109,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
109109

110110
PatKind::Box(ref subpat) |
111111
PatKind::Ref(ref subpat, _) |
112-
PatKind::Binding(_, _, Some(ref subpat)) => {
112+
PatKind::Binding(.., Some(ref subpat)) => {
113113
let subpat_exit = self.pat(&subpat, pred);
114114
self.add_ast_node(pat.id, &[subpat_exit])
115115
}
@@ -306,7 +306,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
306306
self.call(expr, pred, &func, args.iter().map(|e| &**e))
307307
}
308308

309-
hir::ExprMethodCall(_, _, ref args) => {
309+
hir::ExprMethodCall(.., ref args) => {
310310
self.call(expr, pred, &args[0], args[1..].iter().map(|e| &**e))
311311
}
312312

src/librustc/hir/def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Def {
104104
pub fn var_id(&self) -> ast::NodeId {
105105
match *self {
106106
Def::Local(_, id) |
107-
Def::Upvar(_, id, _, _) => {
107+
Def::Upvar(_, id, ..) => {
108108
id
109109
}
110110

src/librustc/hir/intravisit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
341341
visitor.visit_id(item.id);
342342
visitor.visit_trait_ref(trait_ref)
343343
}
344-
ItemImpl(_, _, ref type_parameters, ref opt_trait_reference, ref typ, ref impl_items) => {
344+
ItemImpl(.., ref type_parameters, ref opt_trait_reference, ref typ, ref impl_items) => {
345345
visitor.visit_id(item.id);
346346
visitor.visit_generics(type_parameters);
347347
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<'
625625
FnKind::ItemFn(_, generics, ..) => {
626626
visitor.visit_generics(generics);
627627
}
628-
FnKind::Method(_, sig, _, _) => {
628+
FnKind::Method(_, sig, ..) => {
629629
visitor.visit_generics(&sig.generics);
630630
}
631631
FnKind::Closure(_) => {}

src/librustc/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
109109
this.insert(struct_def.id(), NodeStructCtor(struct_def));
110110
}
111111
}
112-
ItemTrait(_, _, ref bounds, _) => {
112+
ItemTrait(.., ref bounds, _) => {
113113
for b in bounds.iter() {
114114
if let TraitTyParamBound(ref t, TraitBoundModifier::None) = *b {
115115
this.insert(t.trait_ref.ref_id, NodeItem(i));

src/librustc/hir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl Pat {
469469
}
470470

471471
match self.node {
472-
PatKind::Binding(_, _, Some(ref p)) => p.walk_(it),
472+
PatKind::Binding(.., Some(ref p)) => p.walk_(it),
473473
PatKind::Struct(_, ref fields, _) => {
474474
fields.iter().all(|field| field.node.pat.walk_(it))
475475
}
@@ -486,7 +486,7 @@ impl Pat {
486486
}
487487
PatKind::Wild |
488488
PatKind::Lit(_) |
489-
PatKind::Range(_, _) |
489+
PatKind::Range(..) |
490490
PatKind::Binding(..) |
491491
PatKind::Path(..) => {
492492
true

src/librustc/hir/pat_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<T: ExactSizeIterator> EnumerateAndAdjustIterator for T {
5353

5454
pub fn pat_is_refutable(dm: &DefMap, pat: &hir::Pat) -> bool {
5555
match pat.node {
56-
PatKind::Lit(_) | PatKind::Range(_, _) | PatKind::Path(Some(..), _) => true,
56+
PatKind::Lit(_) | PatKind::Range(..) | PatKind::Path(Some(..), _) => true,
5757
PatKind::TupleStruct(..) |
5858
PatKind::Path(..) |
5959
PatKind::Struct(..) => {

src/librustc/infer/error_reporting.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
140140
Some(ast_map::NodeExpr(expr)) => match expr.node {
141141
hir::ExprCall(..) => "call",
142142
hir::ExprMethodCall(..) => "method call",
143-
hir::ExprMatch(_, _, hir::MatchSource::IfLetDesugar { .. }) => "if let",
144-
hir::ExprMatch(_, _, hir::MatchSource::WhileLetDesugar) => "while let",
145-
hir::ExprMatch(_, _, hir::MatchSource::ForLoopDesugar) => "for",
143+
hir::ExprMatch(.., hir::MatchSource::IfLetDesugar { .. }) => "if let",
144+
hir::ExprMatch(.., hir::MatchSource::WhileLetDesugar) => "while let",
145+
hir::ExprMatch(.., hir::MatchSource::ForLoopDesugar) => "for",
146146
hir::ExprMatch(..) => "match",
147147
_ => "expression",
148148
},

src/librustc/infer/higher_ranked/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
684684
warnings.extend(
685685
match self.region_vars.var_origin(vid) {
686686
LateBoundRegion(_,
687-
ty::BrNamed(_, _, wc),
687+
ty::BrNamed(.., wc),
688688
_) => Some(wc),
689689
_ => None,
690690
});

src/librustc/infer/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl TypeOrigin {
225225
&TypeOrigin::RelateOutputImplTypes(_) |
226226
&TypeOrigin::ExprAssignable(_) => "mismatched types",
227227
&TypeOrigin::MethodCompatCheck(_) => "method not compatible with trait",
228-
&TypeOrigin::MatchExpressionArm(_, _, source) => match source {
228+
&TypeOrigin::MatchExpressionArm(.., source) => match source {
229229
hir::MatchSource::IfLetDesugar{..} => "`if let` arms have incompatible types",
230230
_ => "match arms have incompatible types",
231231
},
@@ -1712,7 +1712,7 @@ impl TypeOrigin {
17121712
TypeOrigin::ExprAssignable(span) => span,
17131713
TypeOrigin::Misc(span) => span,
17141714
TypeOrigin::RelateOutputImplTypes(span) => span,
1715-
TypeOrigin::MatchExpressionArm(match_span, _, _) => match_span,
1715+
TypeOrigin::MatchExpressionArm(match_span, ..) => match_span,
17161716
TypeOrigin::IfExpression(span) => span,
17171717
TypeOrigin::IfExpressionWithNoElse(span) => span,
17181718
TypeOrigin::RangeExpression(span) => span,
@@ -1765,7 +1765,7 @@ impl RegionVariableOrigin {
17651765
Autoref(a) => a,
17661766
Coercion(a) => a,
17671767
EarlyBoundRegion(a, _) => a,
1768-
LateBoundRegion(a, _, _) => a,
1768+
LateBoundRegion(a, ..) => a,
17691769
BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP,
17701770
UpvarRegion(_, a) => a
17711771
}

src/librustc/infer/region_inference/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -605,15 +605,15 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
605605
undo_entry: &UndoLogEntry<'tcx>)
606606
-> bool {
607607
match undo_entry {
608-
&AddConstraint(ConstrainVarSubVar(_, _)) =>
608+
&AddConstraint(ConstrainVarSubVar(..)) =>
609609
false,
610610
&AddConstraint(ConstrainRegSubVar(a, _)) =>
611611
skols.contains(&a),
612612
&AddConstraint(ConstrainVarSubReg(_, b)) =>
613613
skols.contains(&b),
614614
&AddConstraint(ConstrainRegSubReg(a, b)) =>
615615
skols.contains(&a) || skols.contains(&b),
616-
&AddGiven(_, _) =>
616+
&AddGiven(..) =>
617617
false,
618618
&AddVerify(_) =>
619619
false,
@@ -1372,7 +1372,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
13721372
(&ReFree(..), &ReFree(..)) => Equal,
13731373
(&ReFree(..), _) => Less,
13741374
(_, &ReFree(..)) => Greater,
1375-
(_, _) => Equal,
1375+
(..) => Equal,
13761376
}
13771377
}
13781378
lower_bounds.sort_by(|a, b| free_regions_first(a, b));

src/librustc/infer/type_variable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
267267
debug!("NewElem({}) new_elem_threshold={}", index, new_elem_threshold);
268268
}
269269

270-
sv::UndoLog::Other(SpecifyVar(vid, _, _)) => {
270+
sv::UndoLog::Other(SpecifyVar(vid, ..)) => {
271271
if vid.index < new_elem_threshold {
272272
// quick check to see if this variable was
273273
// created since the snapshot started or not.

src/librustc/middle/effect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ enum RootUnsafeContext {
4343

4444
fn type_is_unsafe_function(ty: Ty) -> bool {
4545
match ty.sty {
46-
ty::TyFnDef(_, _, ref f) |
46+
ty::TyFnDef(.., ref f) |
4747
ty::TyFnPtr(ref f) => f.unsafety == hir::Unsafety::Unsafe,
4848
_ => false,
4949
}
@@ -85,7 +85,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> {
8585
let (is_item_fn, is_unsafe_fn) = match fn_kind {
8686
FnKind::ItemFn(_, _, unsafety, ..) =>
8787
(true, unsafety == hir::Unsafety::Unsafe),
88-
FnKind::Method(_, sig, _, _) =>
88+
FnKind::Method(_, sig, ..) =>
8989
(true, sig.unsafety == hir::Unsafety::Unsafe),
9090
_ => (false, false),
9191
};

src/librustc/middle/expr_use_visitor.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
409409
self.consume_exprs(args);
410410
}
411411

412-
hir::ExprMethodCall(_, _, ref args) => { // callee.m(args)
412+
hir::ExprMethodCall(.., ref args) => { // callee.m(args)
413413
self.consume_exprs(args);
414414
}
415415

@@ -940,9 +940,9 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
940940
pat);
941941
return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| {
942942
match pat.node {
943-
PatKind::Binding(hir::BindByRef(..), _, _) =>
943+
PatKind::Binding(hir::BindByRef(..), ..) =>
944944
mode.lub(BorrowingMatch),
945-
PatKind::Binding(hir::BindByValue(..), _, _) => {
945+
PatKind::Binding(hir::BindByValue(..), ..) => {
946946
match copy_or_move(self.mc.infcx, &cmt_pat, PatBindingMove) {
947947
Copy => mode.lub(CopyingMatch),
948948
Move(..) => mode.lub(MovingMatch),
@@ -964,7 +964,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
964964
let infcx = self.mc.infcx;
965965
let delegate = &mut self.delegate;
966966
return_if_err!(mc.cat_pattern(cmt_discr.clone(), pat, |mc, cmt_pat, pat| {
967-
if let PatKind::Binding(bmode, _, _) = pat.node {
967+
if let PatKind::Binding(bmode, ..) = pat.node {
968968
debug!("binding cmt_pat={:?} pat={:?} match_mode={:?}", cmt_pat, pat, match_mode);
969969

970970
// pat_ty: the type of the binding being produced.

src/librustc/middle/intrinsicck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct ExprVisitor<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
5252
impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> {
5353
fn def_id_is_transmute(&self, def_id: DefId) -> bool {
5454
let intrinsic = match self.infcx.tcx.lookup_item_type(def_id).ty.sty {
55-
ty::TyFnDef(_, _, ref bfty) => bfty.abi == RustIntrinsic,
55+
ty::TyFnDef(.., ref bfty) => bfty.abi == RustIntrinsic,
5656
_ => return false
5757
};
5858
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> {
160160
Def::Fn(did) if self.def_id_is_transmute(did) => {
161161
let typ = self.infcx.tcx.node_id_to_type(expr.id);
162162
match typ.sty {
163-
ty::TyFnDef(_, _, ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
163+
ty::TyFnDef(.., ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
164164
let from = bare_fn_ty.sig.0.inputs[0];
165165
let to = bare_fn_ty.sig.0.output;
166166
self.check_transmute(expr.span, from, to, expr.id);

src/librustc/middle/liveness.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
482482
ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
483483
intravisit::walk_expr(ir, expr);
484484
}
485-
hir::ExprBinary(op, _, _) if op.node.is_lazy() => {
485+
hir::ExprBinary(op, ..) if op.node.is_lazy() => {
486486
ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
487487
intravisit::walk_expr(ir, expr);
488488
}
@@ -943,7 +943,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
943943
self.propagate_through_expr(&e, succ)
944944
}
945945

946-
hir::ExprClosure(_, _, ref blk, _) => {
946+
hir::ExprClosure(.., ref blk, _) => {
947947
debug!("{} is an ExprClosure",
948948
expr_to_string(expr));
949949

@@ -1123,7 +1123,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
11231123
self.propagate_through_expr(&f, succ)
11241124
}
11251125

1126-
hir::ExprMethodCall(_, _, ref args) => {
1126+
hir::ExprMethodCall(.., ref args) => {
11271127
let method_call = ty::MethodCall::expr(expr.id);
11281128
let method_ty = self.ir.tcx.tables.borrow().method_map[&method_call].ty;
11291129
// FIXME(canndrew): This is_never should really be an is_uninhabited

src/librustc/middle/mem_categorization.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn deref_kind(t: Ty, context: DerefKindContext) -> McResult<deref_kind> {
228228
Ok(deref_interior(InteriorField(PositionalField(0))))
229229
}
230230

231-
ty::TyArray(_, _) | ty::TySlice(_) => {
231+
ty::TyArray(..) | ty::TySlice(_) => {
232232
// no deref of indexed content without supplying InteriorOffsetKind
233233
if let Some(context) = context {
234234
Ok(deref_interior(InteriorElement(context, ElementKind::VecElement)))
@@ -318,7 +318,7 @@ impl MutabilityCategory {
318318
fn from_local(tcx: TyCtxt, id: ast::NodeId) -> MutabilityCategory {
319319
let ret = match tcx.map.get(id) {
320320
ast_map::NodeLocal(p) => match p.node {
321-
PatKind::Binding(bind_mode, _, _) => {
321+
PatKind::Binding(bind_mode, ..) => {
322322
if bind_mode == hir::BindByValue(hir::MutMutable) {
323323
McDeclared
324324
} else {
@@ -419,7 +419,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
419419
// *being borrowed* is. But ideally we would put in a more
420420
// fundamental fix to this conflated use of the node id.
421421
let ret_ty = match pat.node {
422-
PatKind::Binding(hir::BindByRef(_), _, _) => {
422+
PatKind::Binding(hir::BindByRef(_), ..) => {
423423
// a bind-by-ref means that the base_ty will be the type of the ident itself,
424424
// but what we want here is the type of the underlying value being borrowed.
425425
// So peel off one-level, turning the &T into T.
@@ -761,7 +761,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
761761
};
762762

763763
match fn_expr.node {
764-
hir::ExprClosure(_, _, ref body, _) => body.id,
764+
hir::ExprClosure(.., ref body, _) => body.id,
765765
_ => bug!()
766766
}
767767
};
@@ -1185,7 +1185,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
11851185
}
11861186
}
11871187

1188-
PatKind::Binding(_, _, Some(ref subpat)) => {
1188+
PatKind::Binding(.., Some(ref subpat)) => {
11891189
self.cat_pattern_(cmt, &subpat, op)?;
11901190
}
11911191

@@ -1225,7 +1225,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
12251225
}
12261226
}
12271227

1228-
PatKind::Path(..) | PatKind::Binding(_, _, None) |
1228+
PatKind::Path(..) | PatKind::Binding(.., None) |
12291229
PatKind::Lit(..) | PatKind::Range(..) | PatKind::Wild => {
12301230
// always ok
12311231
}
@@ -1275,9 +1275,9 @@ impl<'tcx> cmt_<'tcx> {
12751275
Categorization::Rvalue(..) |
12761276
Categorization::StaticItem |
12771277
Categorization::Local(..) |
1278-
Categorization::Deref(_, _, UnsafePtr(..)) |
1279-
Categorization::Deref(_, _, BorrowedPtr(..)) |
1280-
Categorization::Deref(_, _, Implicit(..)) |
1278+
Categorization::Deref(.., UnsafePtr(..)) |
1279+
Categorization::Deref(.., BorrowedPtr(..)) |
1280+
Categorization::Deref(.., Implicit(..)) |
12811281
Categorization::Upvar(..) => {
12821282
Rc::new((*self).clone())
12831283
}
@@ -1320,7 +1320,7 @@ impl<'tcx> cmt_<'tcx> {
13201320
Categorization::Rvalue(..) |
13211321
Categorization::Local(..) |
13221322
Categorization::Upvar(..) |
1323-
Categorization::Deref(_, _, UnsafePtr(..)) => { // yes, it's aliasable, but...
1323+
Categorization::Deref(.., UnsafePtr(..)) => { // yes, it's aliasable, but...
13241324
NonAliasable
13251325
}
13261326

@@ -1349,9 +1349,9 @@ impl<'tcx> cmt_<'tcx> {
13491349
match self.note {
13501350
NoteClosureEnv(..) | NoteUpvarRef(..) => {
13511351
Some(match self.cat {
1352-
Categorization::Deref(ref inner, _, _) => {
1352+
Categorization::Deref(ref inner, ..) => {
13531353
match inner.cat {
1354-
Categorization::Deref(ref inner, _, _) => inner.clone(),
1354+
Categorization::Deref(ref inner, ..) => inner.clone(),
13551355
Categorization::Upvar(..) => inner.clone(),
13561356
_ => bug!()
13571357
}
@@ -1379,7 +1379,7 @@ impl<'tcx> cmt_<'tcx> {
13791379
"local variable".to_string()
13801380
}
13811381
}
1382-
Categorization::Deref(_, _, pk) => {
1382+
Categorization::Deref(.., pk) => {
13831383
let upvar = self.upvar();
13841384
match upvar.as_ref().map(|i| &i.cat) {
13851385
Some(&Categorization::Upvar(ref var)) => {

src/librustc/middle/region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor, local: &hir::Local) {
956956
/// | box P&
957957
fn is_binding_pat(pat: &hir::Pat) -> bool {
958958
match pat.node {
959-
PatKind::Binding(hir::BindByRef(_), _, _) => true,
959+
PatKind::Binding(hir::BindByRef(_), ..) => true,
960960

961961
PatKind::Struct(_, ref field_pats, _) => {
962962
field_pats.iter().any(|fp| is_binding_pat(&fp.node.pat))

0 commit comments

Comments
 (0)