From 6f7e51e49b7d74f8112cf048fcbd377d0db7c326 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 26 Aug 2016 19:23:42 +0300 Subject: [PATCH 1/2] Replace `_, _, _` with `..` --- src/librustc/hir/def.rs | 2 +- src/librustc/hir/intravisit.rs | 6 +++--- src/librustc/hir/pat_util.rs | 2 +- src/librustc/infer/error_reporting.rs | 4 ++-- src/librustc/infer/mod.rs | 2 +- src/librustc/lib.rs | 1 + src/librustc/middle/dead.rs | 4 ++-- src/librustc/middle/effect.rs | 4 ++-- src/librustc/middle/expr_use_visitor.rs | 2 +- src/librustc/middle/reachable.rs | 14 +++++++------- src/librustc/middle/resolve_lifetime.rs | 8 ++++---- src/librustc/middle/stability.rs | 6 +++--- src/librustc/ty/mod.rs | 10 +++++----- src/librustc_borrowck/borrowck/mir/mod.rs | 4 ++-- src/librustc_borrowck/borrowck/mod.rs | 2 +- src/librustc_borrowck/lib.rs | 1 + src/librustc_const_eval/eval.rs | 2 +- src/librustc_const_eval/lib.rs | 2 +- src/librustc_lint/bad_style.rs | 4 ++-- src/librustc_lint/builtin.rs | 12 ++++++------ src/librustc_lint/lib.rs | 1 + src/librustc_metadata/encoder.rs | 8 ++++---- src/librustc_metadata/lib.rs | 1 + src/librustc_mir/hair/cx/mod.rs | 2 +- src/librustc_mir/lib.rs | 1 + src/librustc_mir/transform/qualify_consts.rs | 2 +- src/librustc_passes/ast_validation.rs | 10 +++++----- src/librustc_passes/consts.rs | 2 +- src/librustc_passes/lib.rs | 1 + src/librustc_privacy/lib.rs | 13 +++++++------ src/librustc_resolve/build_reduced_graph.rs | 4 ++-- src/librustc_resolve/lib.rs | 5 +++-- src/librustc_save_analysis/dump_visitor.rs | 2 +- src/librustc_save_analysis/lib.rs | 7 ++++--- src/librustc_trans/collector.rs | 4 ++-- src/librustc_trans/lib.rs | 1 + src/librustc_typeck/astconv.rs | 2 +- src/librustc_typeck/check/mod.rs | 8 ++++---- src/librustc_typeck/check/wfcheck.rs | 4 ++-- src/librustc_typeck/coherence/mod.rs | 10 +++++----- src/librustc_typeck/coherence/orphan.rs | 4 ++-- src/librustc_typeck/coherence/overlap.rs | 2 +- src/librustc_typeck/coherence/unsafety.rs | 2 +- src/librustc_typeck/collect.rs | 10 +++++----- src/librustc_typeck/lib.rs | 5 +++-- src/libstd/lib.rs | 1 + src/libstd/sys/windows/fs.rs | 2 +- src/libsyntax/ast.rs | 2 +- .../auxiliary/macro_crate_test.rs | 5 +++-- .../auxiliary/macro_crate_test.rs | 7 ++++--- 50 files changed, 117 insertions(+), 103 deletions(-) diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs index aa0eac37ecff1..71bc2693abd27 100644 --- a/src/librustc/hir/def.rs +++ b/src/librustc/hir/def.rs @@ -124,7 +124,7 @@ impl Def { Def::Variant(_, id) | Def::Enum(id) | Def::TyAlias(id) | Def::AssociatedTy(_, id) | Def::TyParam(id) | Def::Struct(id) | Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) | Def::AssociatedConst(id) | - Def::Local(id, _) | Def::Upvar(id, _, _, _) => { + Def::Local(id, _) | Def::Upvar(id, ..) => { id } diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 62157b1ca3681..81b1be53615d6 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -49,8 +49,8 @@ pub enum FnKind<'a> { impl<'a> FnKind<'a> { pub fn attrs(&self) -> &'a [Attribute] { match *self { - FnKind::ItemFn(_, _, _, _, _, _, attrs) => attrs, - FnKind::Method(_, _, _, attrs) => attrs, + FnKind::ItemFn(.., attrs) => attrs, + FnKind::Method(.., attrs) => attrs, FnKind::Closure(attrs) => attrs, } } @@ -622,7 +622,7 @@ pub fn walk_fn_decl_nopat<'v, V: Visitor<'v>>(visitor: &mut V, function_declarat pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V, function_kind: FnKind<'v>) { match function_kind { - FnKind::ItemFn(_, generics, _, _, _, _, _) => { + FnKind::ItemFn(_, generics, ..) => { visitor.visit_generics(generics); } FnKind::Method(_, sig, _, _) => { diff --git a/src/librustc/hir/pat_util.rs b/src/librustc/hir/pat_util.rs index 593d10ef4f7c4..abb6084002448 100644 --- a/src/librustc/hir/pat_util.rs +++ b/src/librustc/hir/pat_util.rs @@ -62,7 +62,7 @@ pub fn pat_is_refutable(dm: &DefMap, pat: &hir::Pat) -> bool { _ => false } } - PatKind::Vec(_, _, _) => true, + PatKind::Vec(..) => true, _ => false } } diff --git a/src/librustc/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs index efce0c8354bac..753dd01d87eea 100644 --- a/src/librustc/infer/error_reporting.rs +++ b/src/librustc/infer/error_reporting.rs @@ -1787,7 +1787,7 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>, let method_id_opt = match tcx.map.find(parent) { Some(node) => match node { ast_map::NodeItem(item) => match item.node { - hir::ItemFn(_, _, _, _, ref gen, _) => { + hir::ItemFn(.., ref gen, _) => { taken.extend_from_slice(&gen.lifetimes); None }, @@ -1811,7 +1811,7 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>, if let Some(node) = tcx.map.find(parent) { match node { ast_map::NodeItem(item) => match item.node { - hir::ItemImpl(_, _, ref gen, _, _, _) => { + hir::ItemImpl(_, _, ref gen, ..) => { taken.extend_from_slice(&gen.lifetimes); } _ => () diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index b6114f293ad3a..bc5ca76c3f857 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -248,7 +248,7 @@ impl TypeOrigin { &TypeOrigin::RelateOutputImplTypes(_) => { "trait type parameters matches those specified on the impl" } - &TypeOrigin::MatchExpressionArm(_, _, _) => "match arms have compatible types", + &TypeOrigin::MatchExpressionArm(..) => "match arms have compatible types", &TypeOrigin::IfExpression(_) => "if and else have compatible types", &TypeOrigin::IfExpressionWithNoElse(_) => "if missing an else returns ()", &TypeOrigin::RangeExpression(_) => "start and end of range have compatible types", diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 1e4b2e9116fd2..f70349d0ee08b 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -30,6 +30,7 @@ #![feature(conservative_impl_trait)] #![feature(const_fn)] #![feature(core_intrinsics)] +#![feature(dotdot_in_tuple_patterns)] #![feature(enumset)] #![feature(libc)] #![feature(nonzero)] diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 0b1d9e8d8f69e..8cb362c1625a5 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -344,7 +344,7 @@ impl<'v> Visitor<'v> for LifeSeeder { self.worklist.extend(enum_def.variants.iter() .map(|variant| variant.node.data.id())); } - hir::ItemTrait(_, _, _, ref trait_items) => { + hir::ItemTrait(.., ref trait_items) => { for trait_item in trait_items { match trait_item.node { hir::ConstTraitItem(_, Some(_)) | @@ -357,7 +357,7 @@ impl<'v> Visitor<'v> for LifeSeeder { } } } - hir::ItemImpl(_, _, _, ref opt_trait, _, ref impl_items) => { + hir::ItemImpl(.., ref opt_trait, _, ref impl_items) => { for impl_item in impl_items { if opt_trait.is_some() || has_allow_dead_code_or_lang_attr(&impl_item.attrs) { diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index e52eba68da198..66c55eb1f3e5f 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -83,7 +83,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> { block: &'v hir::Block, span: Span, id: ast::NodeId) { let (is_item_fn, is_unsafe_fn) = match fn_kind { - FnKind::ItemFn(_, _, unsafety, _, _, _, _) => + FnKind::ItemFn(_, _, unsafety, ..) => (true, unsafety == hir::Unsafety::Unsafe), FnKind::Method(_, sig, _, _) => (true, sig.unsafety == hir::Unsafety::Unsafe), @@ -143,7 +143,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> { fn visit_expr(&mut self, expr: &hir::Expr) { match expr.node { - hir::ExprMethodCall(_, _, _) => { + hir::ExprMethodCall(..) => { let method_call = MethodCall::expr(expr.id); let base_type = self.tcx.tables.borrow().method_map[&method_call].ty; debug!("effect: method call case, base type is {:?}", diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 541aeeb7d8dd7..66c8a8ac0d37b 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -544,7 +544,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> { self.consume_expr(&count); } - hir::ExprClosure(_, _, _, fn_decl_span) => { + hir::ExprClosure(.., fn_decl_span) => { self.walk_captures(expr, fn_decl_span) } diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 0625504af88ea..beffaff1e5b8a 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -46,8 +46,8 @@ fn item_might_be_inlined(item: &hir::Item) -> bool { } match item.node { - hir::ItemImpl(_, _, ref generics, _, _, _) | - hir::ItemFn(_, _, _, _, ref generics, _) => { + hir::ItemImpl(_, _, ref generics, ..) | + hir::ItemFn(.., ref generics, _) => { generics_require_inlining(generics) } _ => false, @@ -187,7 +187,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> { // does too. let impl_node_id = self.tcx.map.as_local_node_id(impl_did).unwrap(); match self.tcx.map.expect_item(impl_node_id).node { - hir::ItemImpl(_, _, ref generics, _, _, _) => { + hir::ItemImpl(_, _, ref generics, ..) => { generics_require_inlining(generics) } _ => false @@ -226,7 +226,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> { // If we are building an executable, only explicitly extern // types need to be exported. if let ast_map::NodeItem(item) = *node { - let reachable = if let hir::ItemFn(_, _, _, abi, _, _) = item.node { + let reachable = if let hir::ItemFn(.., abi, _, _) = item.node { abi != Abi::Rust } else { false @@ -248,7 +248,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> { match *node { ast_map::NodeItem(item) => { match item.node { - hir::ItemFn(_, _, _, _, _, ref search_block) => { + hir::ItemFn(.., ref search_block) => { if item_might_be_inlined(&item) { intravisit::walk_block(self, &search_block) } @@ -265,7 +265,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> { // inherently and their children are already in the // worklist, as determined by the privacy pass hir::ItemExternCrate(_) | hir::ItemUse(_) | - hir::ItemTy(..) | hir::ItemStatic(_, _, _) | + hir::ItemTy(..) | hir::ItemStatic(..) | hir::ItemMod(..) | hir::ItemForeignMod(..) | hir::ItemImpl(..) | hir::ItemTrait(..) | hir::ItemStruct(..) | hir::ItemEnum(..) | @@ -329,7 +329,7 @@ struct CollectPrivateImplItemsVisitor<'a> { impl<'a, 'v> Visitor<'v> for CollectPrivateImplItemsVisitor<'a> { fn visit_item(&mut self, item: &hir::Item) { // We need only trait impls here, not inherent impls, and only non-exported ones - if let hir::ItemImpl(_, _, _, Some(_), _, ref impl_items) = item.node { + if let hir::ItemImpl(.., Some(_), _, ref impl_items) = item.node { if !self.access_levels.is_reachable(item.id) { for impl_item in impl_items { self.worklist.push(impl_item.id); diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 4d1eed612cfd5..b6faf834b26f7 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -158,7 +158,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> { hir::ItemStruct(_, ref generics) | hir::ItemUnion(_, ref generics) | hir::ItemTrait(_, ref generics, _, _) | - hir::ItemImpl(_, _, ref generics, _, _, _) => { + hir::ItemImpl(_, _, ref generics, ..) => { // These kinds of items have only early bound lifetime parameters. let lifetimes = &generics.lifetimes; let start = if let hir::ItemTrait(..) = item.node { @@ -204,7 +204,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> { fn visit_fn(&mut self, fk: FnKind<'v>, decl: &'v hir::FnDecl, b: &'v hir::Block, s: Span, fn_id: ast::NodeId) { match fk { - FnKind::ItemFn(_, generics, _, _, _, _, _) => { + FnKind::ItemFn(_, generics, ..) => { self.visit_early_late(fn_id,decl, generics, |this| { this.add_scope_and_walk_fn(fk, decl, b, s, fn_id) }) @@ -499,7 +499,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { fn_id: ast::NodeId) { match fk { - FnKind::ItemFn(_, generics, _, _, _, _, _) => { + FnKind::ItemFn(_, generics, ..) => { intravisit::walk_fn_decl(self, fd); self.visit_generics(generics); } @@ -584,7 +584,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { } match parent.node { hir::ItemTrait(_, ref generics, _, _) | - hir::ItemImpl(_, _, ref generics, _, _, _) => { + hir::ItemImpl(_, _, ref generics, ..) => { start += generics.lifetimes.len() + generics.ty_params.len(); } _ => {} diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index aea1ee8d82401..9fc83557fa44b 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -252,11 +252,11 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Annotator<'a, 'tcx> { // they don't have their own stability. They still can be annotated as unstable // and propagate this unstability to children, but this annotation is completely // optional. They inherit stability from their parents when unannotated. - hir::ItemImpl(_, _, _, None, _, _) | hir::ItemForeignMod(..) => { + hir::ItemImpl(.., None, _, _) | hir::ItemForeignMod(..) => { self.in_trait_impl = false; kind = AnnotationKind::Container; } - hir::ItemImpl(_, _, _, Some(_), _, _) => { + hir::ItemImpl(.., Some(_), _, _) => { self.in_trait_impl = true; } hir::ItemStruct(ref sd, _) => { @@ -528,7 +528,7 @@ pub fn check_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // For implementations of traits, check the stability of each item // individually as it's possible to have a stable trait with unstable // items. - hir::ItemImpl(_, _, _, Some(ref t), _, ref impl_items) => { + hir::ItemImpl(.., Some(ref t), _, ref impl_items) => { let trait_did = tcx.expect_def(t.ref_id).def_id(); let trait_items = tcx.trait_items(trait_did); diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 3c450e14dea81..a9b3833b40175 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1336,7 +1336,7 @@ impl<'a, 'tcx> ParameterEnvironment<'tcx> { } Some(ast_map::NodeItem(item)) => { match item.node { - hir::ItemFn(_, _, _, _, _, ref body) => { + hir::ItemFn(.., ref body) => { // We assume this is a function. let fn_def_id = tcx.map.local_def_id(id); @@ -2262,7 +2262,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { pub fn provided_trait_methods(self, id: DefId) -> Vec>> { if let Some(id) = self.map.as_local_node_id(id) { - if let ItemTrait(_, _, _, ref ms) = self.map.expect_item(id).node { + if let ItemTrait(.., ref ms) = self.map.expect_item(id).node { ms.iter().filter_map(|ti| { if let hir::MethodTraitItem(_, Some(_)) = ti.node { match self.impl_or_trait_item(self.map.local_def_id(ti.id)) { @@ -2288,7 +2288,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { pub fn associated_consts(self, id: DefId) -> Vec>> { if let Some(id) = self.map.as_local_node_id(id) { match self.map.expect_item(id).node { - ItemTrait(_, _, _, ref tis) => { + ItemTrait(.., ref tis) => { tis.iter().filter_map(|ti| { if let hir::ConstTraitItem(_, _) = ti.node { match self.impl_or_trait_item(self.map.local_def_id(ti.id)) { @@ -2304,7 +2304,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } }).collect() } - ItemImpl(_, _, _, _, _, ref iis) => { + ItemImpl(.., ref iis) => { iis.iter().filter_map(|ii| { if let hir::ImplItemKind::Const(_, _) = ii.node { match self.impl_or_trait_item(self.map.local_def_id(ii.id)) { @@ -2334,7 +2334,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { match self.map.find(id) { Some(ast_map::NodeItem(item)) => { match item.node { - hir::ItemImpl(_, polarity, _, _, _, _) => Some(polarity), + hir::ItemImpl(_, polarity, ..) => Some(polarity), _ => None } } diff --git a/src/librustc_borrowck/borrowck/mir/mod.rs b/src/librustc_borrowck/borrowck/mir/mod.rs index be408e2db5c34..9c462feeaadd7 100644 --- a/src/librustc_borrowck/borrowck/mir/mod.rs +++ b/src/librustc_borrowck/borrowck/mir/mod.rs @@ -67,8 +67,8 @@ pub fn borrowck_mir<'a, 'tcx: 'a>( id: ast::NodeId, attributes: &[ast::Attribute]) { match fk { - FnKind::ItemFn(name, _, _, _, _, _, _) | - FnKind::Method(name, _, _, _) => { + FnKind::ItemFn(name, ..) | + FnKind::Method(name, ..) => { debug!("borrowck_mir({}) UNIMPLEMENTED", name); } FnKind::Closure(_) => { diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index f5e20285e0c1b..e25adadbb2443 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -711,7 +711,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { move_data::Captured => (match self.tcx.map.expect_expr(the_move.id).node { - hir::ExprClosure(_, _, _, fn_decl_span) => fn_decl_span, + hir::ExprClosure(.., fn_decl_span) => fn_decl_span, ref r => bug!("Captured({}) maps to non-closure: {:?}", the_move.id, r), }, " (into closure)"), diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index 16fefee347269..22b590592fe16 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -19,6 +19,7 @@ #![allow(non_camel_case_types)] +#![feature(dotdot_in_tuple_patterns)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs index 114b5e1331de2..a74b8848c4d6b 100644 --- a/src/librustc_const_eval/eval.rs +++ b/src/librustc_const_eval/eval.rs @@ -228,7 +228,7 @@ pub fn lookup_const_fn_by_id<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefI }; match fn_like.kind() { - FnKind::ItemFn(_, _, _, hir::Constness::Const, _, _, _) => { + FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) => { Some(fn_like) } FnKind::Method(_, m, _, _) => { diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index a6714c178e7cf..f926fef065ea6 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -22,7 +22,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] - +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(rustc_diagnostic_macros)] diff --git a/src/librustc_lint/bad_style.rs b/src/librustc_lint/bad_style.rs index 1094d0ee12bbd..84d65308f952f 100644 --- a/src/librustc_lint/bad_style.rs +++ b/src/librustc_lint/bad_style.rs @@ -239,7 +239,7 @@ impl LateLintPass for NonSnakeCase { fk: FnKind, _: &hir::FnDecl, _: &hir::Block, span: Span, id: ast::NodeId) { match fk { - FnKind::Method(name, _, _, _) => match method_context(cx, id, span) { + FnKind::Method(name, ..) => match method_context(cx, id, span) { MethodLateContext::PlainImpl => { self.check_snake_case(cx, "method", &name.as_str(), Some(span)) }, @@ -248,7 +248,7 @@ impl LateLintPass for NonSnakeCase { }, _ => (), }, - FnKind::ItemFn(name, _, _, _, _, _, _) => { + FnKind::ItemFn(name, ..) => { self.check_snake_case(cx, "function", &name.as_str(), Some(span)) }, FnKind::Closure(_) => (), diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 1702c1c0edc9a..eb2ded45c04c5 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -203,10 +203,10 @@ impl LateLintPass for UnsafeCode { fn check_item(&mut self, cx: &LateContext, it: &hir::Item) { match it.node { - hir::ItemTrait(hir::Unsafety::Unsafe, _, _, _) => + hir::ItemTrait(hir::Unsafety::Unsafe, ..) => cx.span_lint(UNSAFE_CODE, it.span, "declaration of an `unsafe` trait"), - hir::ItemImpl(hir::Unsafety::Unsafe, _, _, _, _, _) => + hir::ItemImpl(hir::Unsafety::Unsafe, ..) => cx.span_lint(UNSAFE_CODE, it.span, "implementation of an `unsafe` trait"), _ => return, @@ -216,7 +216,7 @@ impl LateLintPass for UnsafeCode { fn check_fn(&mut self, cx: &LateContext, fk: FnKind, _: &hir::FnDecl, _: &hir::Block, span: Span, _: ast::NodeId) { match fk { - FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, _, _, _, _) => + FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, ..) => cx.span_lint(UNSAFE_CODE, span, "declaration of an `unsafe` function"), FnKind::Method(_, sig, _, _) => { @@ -351,7 +351,7 @@ impl LateLintPass for MissingDoc { hir::ItemEnum(..) => "an enum", hir::ItemStruct(..) => "a struct", hir::ItemUnion(..) => "a union", - hir::ItemTrait(_, _, _, ref items) => { + hir::ItemTrait(.., ref items) => { // Issue #11592, traits are always considered exported, even when private. if it.vis == hir::Visibility::Inherited { self.private_traits.insert(it.id); @@ -363,7 +363,7 @@ impl LateLintPass for MissingDoc { "a trait" }, hir::ItemTy(..) => "a type alias", - hir::ItemImpl(_, _, _, Some(ref trait_ref), _, ref impl_items) => { + hir::ItemImpl(.., Some(ref trait_ref), _, ref impl_items) => { // If the trait is private, add the impl items to private_traits so they don't get // reported for missing docs. let real_trait = cx.tcx.expect_def(trait_ref.ref_id).def_id(); @@ -1037,7 +1037,7 @@ impl LintPass for InvalidNoMangleItems { impl LateLintPass for InvalidNoMangleItems { fn check_item(&mut self, cx: &LateContext, it: &hir::Item) { match it.node { - hir::ItemFn(_, _, _, _, ref generics, _) => { + hir::ItemFn(.., ref generics, _) => { if attr::contains_name(&it.attrs, "no_mangle") { if !cx.access_levels.is_reachable(it.id) { let msg = format!("function {} is marked #[no_mangle], but not exported", diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index c3b752d605f97..b9817cc6ff45a 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -31,6 +31,7 @@ #![cfg_attr(test, feature(test))] #![feature(box_patterns)] #![feature(box_syntax)] +#![feature(dotdot_in_tuple_patterns)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 35f5eba4160d9..583631d2e0ab5 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -1065,7 +1065,7 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> { let trait_ref = tcx.impl_trait_ref(ecx.tcx.map.local_def_id(item.id)).unwrap(); encode_trait_ref(self.rbml_w, ecx, trait_ref, tag_item_trait_ref); } - hir::ItemImpl(unsafety, polarity, _, _, _, _) => { + hir::ItemImpl(unsafety, polarity, ..) => { // We need to encode information about the default methods we // have inherited, so we drive self based on the impl structure. let impl_items = tcx.impl_items.borrow(); @@ -1129,7 +1129,7 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> { encode_stability(self.rbml_w, stab); encode_deprecation(self.rbml_w, depr); } - hir::ItemTrait(_, _, _, _) => { + hir::ItemTrait(..) => { encode_def_id_and_key(ecx, self.rbml_w, def_id); encode_family(self.rbml_w, 'I'); encode_item_variances(self.rbml_w, ecx, item.id); @@ -1209,10 +1209,10 @@ impl<'a, 'tcx, 'encoder> IndexBuilder<'a, 'tcx, 'encoder> { hir::ItemUnion(..) => { self.encode_addl_union_info(def_id); } - hir::ItemImpl(_, _, _, _, _, ref ast_items) => { + hir::ItemImpl(.., ref ast_items) => { self.encode_addl_impl_info(def_id, item.id, ast_items); } - hir::ItemTrait(_, _, _, ref trait_items) => { + hir::ItemTrait(.., ref trait_items) => { self.encode_addl_trait_info(def_id, trait_items); } } diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index a3afb9d84bd30..84323d4646607 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -18,6 +18,7 @@ #![cfg_attr(not(stage0), deny(warnings))] #![feature(box_patterns)] +#![feature(dotdot_in_tuple_patterns)] #![feature(enumset)] #![feature(question_mark)] #![feature(quote)] diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index 1767630b81b1a..919b23ffda540 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -53,7 +53,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> { MirSource::Fn(id) => { let fn_like = FnLikeNode::from_node(infcx.tcx.map.get(id)); match fn_like.map(|f| f.kind()) { - Some(FnKind::ItemFn(_, _, _, c, _, _, _)) => c, + Some(FnKind::ItemFn(_, _, _, c, ..)) => c, Some(FnKind::Method(_, m, _, _)) => m.constness, _ => hir::Constness::NotConst } diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 3d01d49c53472..f580ceeee5d7f 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -22,6 +22,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![feature(associated_consts)] #![feature(box_patterns)] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 6c6a5f7fc74b0..751f25b279401 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -119,7 +119,7 @@ fn is_const_fn(tcx: TyCtxt, def_id: DefId) -> bool { if let Some(node_id) = tcx.map.as_local_node_id(def_id) { let fn_like = FnLikeNode::from_node(tcx.map.get(node_id)); match fn_like.map(|f| f.kind()) { - Some(FnKind::ItemFn(_, _, _, c, _, _, _)) => { + Some(FnKind::ItemFn(_, _, _, c, ..)) => { c == hir::Constness::Const } Some(FnKind::Method(_, m, _, _)) => { diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index b8284f5dcf10d..6a24742426ab0 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -100,8 +100,8 @@ impl<'a> Visitor for AstValidator<'a> { match expr.node { ExprKind::While(_, _, Some(ident)) | ExprKind::Loop(_, Some(ident)) | - ExprKind::WhileLet(_, _, _, Some(ident)) | - ExprKind::ForLoop(_, _, _, Some(ident)) | + ExprKind::WhileLet(.., Some(ident)) | + ExprKind::ForLoop(.., Some(ident)) | ExprKind::Break(Some(ident)) | ExprKind::Continue(Some(ident)) => { self.check_label(ident.node, ident.span, expr.id); @@ -155,7 +155,7 @@ impl<'a> Visitor for AstValidator<'a> { .span_err(path.span, "type or lifetime parameters in import path"); } } - ItemKind::Impl(_, _, _, Some(..), _, ref impl_items) => { + ItemKind::Impl(.., Some(..), _, ref impl_items) => { self.invalid_visibility(&item.vis, item.span, None); for impl_item in impl_items { self.invalid_visibility(&impl_item.vis, impl_item.span, None); @@ -164,7 +164,7 @@ impl<'a> Visitor for AstValidator<'a> { } } } - ItemKind::Impl(_, _, _, None, _, _) => { + ItemKind::Impl(.., None, _, _) => { self.invalid_visibility(&item.vis, item.span, Some("place qualifiers on individual impl items instead")); @@ -185,7 +185,7 @@ impl<'a> Visitor for AstValidator<'a> { } } } - ItemKind::Trait(_, _, _, ref trait_items) => { + ItemKind::Trait(.., ref trait_items) => { for trait_item in trait_items { if let TraitItemKind::Method(ref sig, _) = trait_item.node { self.check_trait_fn_not_const(sig.constness); diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index c3749bf4546f3..3094ff49f1f59 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -147,7 +147,7 @@ impl<'a, 'gcx> CheckCrateVisitor<'a, 'gcx> { } let mode = match fk { - FnKind::ItemFn(_, _, _, hir::Constness::Const, _, _, _) + FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) => Mode::ConstFn, FnKind::Method(_, m, _, _) => { if m.constness == hir::Constness::Const { diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index e59c4a6fc4186..a4657251c9ce2 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -23,6 +23,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_diagnostic_macros)] #![feature(staged_api)] #![feature(rustc_private)] diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 179863c16fff2..5e374ce7c5803 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -17,6 +17,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] @@ -125,10 +126,10 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> { fn visit_item(&mut self, item: &hir::Item) { let inherited_item_level = match item.node { // Impls inherit level from their types and traits - hir::ItemImpl(_, _, _, None, ref ty, _) => { + hir::ItemImpl(.., None, ref ty, _) => { self.ty_level(&ty) } - hir::ItemImpl(_, _, _, Some(ref trait_ref), ref ty, _) => { + hir::ItemImpl(.., Some(ref trait_ref), ref ty, _) => { cmp::min(self.ty_level(&ty), self.trait_level(trait_ref)) } hir::ItemDefaultImpl(_, ref trait_ref) => { @@ -157,19 +158,19 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> { } } } - hir::ItemImpl(_, _, _, None, _, ref impl_items) => { + hir::ItemImpl(.., None, _, ref impl_items) => { for impl_item in impl_items { if impl_item.vis == hir::Public { self.update(impl_item.id, item_level); } } } - hir::ItemImpl(_, _, _, Some(_), _, ref impl_items) => { + hir::ItemImpl(.., Some(_), _, ref impl_items) => { for impl_item in impl_items { self.update(impl_item.id, item_level); } } - hir::ItemTrait(_, _, _, ref trait_items) => { + hir::ItemTrait(.., ref trait_items) => { for trait_item in trait_items { self.update(trait_item.id, item_level); } @@ -204,7 +205,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> { hir::ItemUse(..) => {} // Visit everything hir::ItemConst(..) | hir::ItemStatic(..) | hir::ItemFn(..) | - hir::ItemTrait(..) | hir::ItemTy(..) | hir::ItemImpl(_, _, _, Some(..), _, _) => { + hir::ItemTrait(..) | hir::ItemTy(..) | hir::ItemImpl(.., Some(..), _, _) => { if item_level.is_some() { self.reach().visit_item(item); } diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 8e97870c21a5b..98ddff70462c9 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -232,7 +232,7 @@ impl<'b> Resolver<'b> { let def = Def::Const(self.definitions.local_def_id(item.id)); self.define(parent, name, ValueNS, (def, sp, vis)); } - ItemKind::Fn(_, _, _, _, _, _) => { + ItemKind::Fn(..) => { let def = Def::Fn(self.definitions.local_def_id(item.id)); self.define(parent, name, ValueNS, (def, sp, vis)); } @@ -294,7 +294,7 @@ impl<'b> Resolver<'b> { ItemKind::DefaultImpl(_, _) | ItemKind::Impl(..) => {} - ItemKind::Trait(_, _, _, ref items) => { + ItemKind::Trait(.., ref items) => { let def_id = self.definitions.local_def_id(item.id); // Add all the items within to a new module. diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index db0704db33fd5..0a86eeef7c45b 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -19,6 +19,7 @@ #![feature(associated_consts)] #![feature(borrow_state)] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] @@ -599,7 +600,7 @@ impl<'a> Visitor for Resolver<'a> { _: Span, node_id: NodeId) { let rib_kind = match function_kind { - FnKind::ItemFn(_, generics, _, _, _, _) => { + FnKind::ItemFn(_, generics, ..) => { self.visit_generics(generics); ItemRibKind } @@ -1634,7 +1635,7 @@ impl<'a> Resolver<'a> { ItemKind::Ty(_, ref generics) | ItemKind::Struct(_, ref generics) | ItemKind::Union(_, ref generics) | - ItemKind::Fn(_, _, _, _, ref generics, _) => { + ItemKind::Fn(.., ref generics, _) => { self.with_type_parameter_rib(HasTypeParameters(generics, ItemRibKind), |this| visit::walk_item(this, item)); } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index f9a20cec42d14..329527b304e3e 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1137,7 +1137,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D> }.lower(self.tcx)); } } - Fn(ref decl, _, _, _, ref ty_params, ref body) => + Fn(ref decl, .., ref ty_params, ref body) => self.process_fn(item, &decl, ty_params, &body), Static(ref typ, _, ref expr) => self.process_static_or_const_item(item, typ, expr), diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 47f3a06de1bd1..559893b26facc 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -18,6 +18,7 @@ #![cfg_attr(not(stage0), deny(warnings))] #![feature(custom_attribute)] +#![feature(dotdot_in_tuple_patterns)] #![allow(unused_attributes)] #![feature(rustc_private)] #![feature(staged_api)] @@ -124,7 +125,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { pub fn get_item_data(&self, item: &ast::Item) -> Option { match item.node { - ast::ItemKind::Fn(ref decl, _, _, _, ref generics, _) => { + ast::ItemKind::Fn(ref decl, .., ref generics, _) => { let qualname = format!("::{}", self.tcx.node_path_str(item.id)); let sub_span = self.span_utils.sub_span_after_keyword(item.span, keywords::Fn); filter!(self.span_utils, sub_span, item.span, None); @@ -217,7 +218,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { variants: def.variants.iter().map(|v| v.node.data.id()).collect(), })) } - ast::ItemKind::Impl(_, _, _, ref trait_ref, ref typ, _) => { + ast::ItemKind::Impl(.., ref trait_ref, ref typ, _) => { let mut type_data = None; let sub_span; @@ -295,7 +296,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { Some(impl_id) => match self.tcx.map.get_if_local(impl_id) { Some(NodeItem(item)) => { match item.node { - hir::ItemImpl(_, _, _, _, ref ty, _) => { + hir::ItemImpl(.., ref ty, _) => { let mut result = String::from("<"); result.push_str(&rustc::hir::print::ty_to_string(&ty)); diff --git a/src/librustc_trans/collector.rs b/src/librustc_trans/collector.rs index 4bea5d7e87fc9..b5c922d7fda4b 100644 --- a/src/librustc_trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -1152,7 +1152,7 @@ impl<'b, 'a, 'v> hir_visit::Visitor<'v> for RootCollector<'b, 'a, 'v> { // const items only generate translation items if they are // actually used somewhere. Just declaring them is insufficient. } - hir::ItemFn(_, _, _, _, ref generics, _) => { + hir::ItemFn(.., ref generics, _) => { if !generics.is_type_parameterized() { let def_id = self.scx.tcx().map.local_def_id(item.id); @@ -1179,7 +1179,7 @@ impl<'b, 'a, 'v> hir_visit::Visitor<'v> for RootCollector<'b, 'a, 'v> { let parent_node_id = hir_map.get_parent_node(ii.id); let is_impl_generic = match hir_map.expect_item(parent_node_id) { &hir::Item { - node: hir::ItemImpl(_, _, ref generics, _, _, _), + node: hir::ItemImpl(_, _, ref generics, ..), .. } => { generics.is_type_parameterized() diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 6ede55d5ff49a..6f5bac840a1dc 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -27,6 +27,7 @@ #![feature(box_syntax)] #![feature(const_fn)] #![feature(custom_attribute)] +#![feature(dotdot_in_tuple_patterns)] #![allow(unused_attributes)] #![feature(libc)] #![feature(quote)] diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index c445455ef2bc5..5925d222b4466 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1358,7 +1358,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { // `ty::trait_items` used below requires information generated // by type collection, which may be in progress at this point. match tcx.map.expect_item(trait_id).node { - hir::ItemTrait(_, _, _, ref trait_items) => { + hir::ItemTrait(.., ref trait_items) => { let item = trait_items.iter() .find(|i| i.name == assoc_name) .expect("missing associated type"); diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index f4fea5542b3de..36c2494a00656 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -741,7 +741,7 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) { it.id); } hir::ItemFn(..) => {} // entirely within check_item_body - hir::ItemImpl(_, _, _, _, _, ref impl_items) => { + hir::ItemImpl(.., ref impl_items) => { debug!("ItemImpl {} with id {}", it.name, it.id); let impl_def_id = ccx.tcx.map.local_def_id(it.id); match ccx.tcx.impl_trait_ref(impl_def_id) { @@ -808,10 +808,10 @@ pub fn check_item_body<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) { ccx.tcx.item_path_str(ccx.tcx.map.local_def_id(it.id))); let _indenter = indenter(); match it.node { - hir::ItemFn(ref decl, _, _, _, _, ref body) => { + hir::ItemFn(ref decl, .., ref body) => { check_bare_fn(ccx, &decl, &body, it.id); } - hir::ItemImpl(_, _, _, _, _, ref impl_items) => { + hir::ItemImpl(.., ref impl_items) => { debug!("ItemImpl {} with id {}", it.name, it.id); for impl_item in impl_items { @@ -828,7 +828,7 @@ pub fn check_item_body<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) { } } } - hir::ItemTrait(_, _, _, ref trait_items) => { + hir::ItemTrait(.., ref trait_items) => { for trait_item in trait_items { match trait_item.node { hir::ConstTraitItem(_, Some(ref expr)) => { diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 7dff30d03c332..8eb7d34568762 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -126,7 +126,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> { } } } - hir::ItemFn(_, _, _, _, _, ref body) => { + hir::ItemFn(.., ref body) => { self.check_item_fn(item, body); } hir::ItemStatic(..) => { @@ -156,7 +156,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> { self.check_variances_for_type_defn(item, ast_generics); } - hir::ItemTrait(_, _, _, ref items) => { + hir::ItemTrait(.., ref items) => { self.check_trait(item, items); } _ => {} diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index fba145efa9507..70682bb8c8f35 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -195,7 +195,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { // Converts an implementation in the AST to a vector of items. fn create_impl_from_item(&self, item: &Item) -> Vec { match item.node { - ItemImpl(_, _, _, _, _, ref impl_items) => { + ItemImpl(.., ref impl_items) => { impl_items.iter().map(|impl_item| { let impl_def_id = self.crate_context.tcx.map.local_def_id(impl_item.id); match impl_item.node { @@ -252,7 +252,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { match tcx.map.find(impl_node_id) { Some(hir_map::NodeItem(item)) => { let span = match item.node { - ItemImpl(_, _, _, _, ref ty, _) => { + ItemImpl(.., ref ty, _) => { ty.span }, _ => item.span @@ -324,7 +324,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { } Err(CopyImplementationError::InfrigingVariant(name)) => { let item = tcx.map.expect_item(impl_node_id); - let span = if let ItemImpl(_, _, _, Some(ref tr), _, _) = item.node { + let span = if let ItemImpl(.., Some(ref tr), _, _) = item.node { tr.path.span } else { span @@ -338,7 +338,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { } Err(CopyImplementationError::NotAnAdt) => { let item = tcx.map.expect_item(impl_node_id); - let span = if let ItemImpl(_, _, _, _, ref ty, _) = item.node { + let span = if let ItemImpl(.., ref ty, _) = item.node { ty.span } else { span @@ -463,7 +463,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { return; } else if diff_fields.len() > 1 { let item = tcx.map.expect_item(impl_node_id); - let span = if let ItemImpl(_, _, _, Some(ref t), _, _) = item.node { + let span = if let ItemImpl(.., Some(ref t), _, _) = item.node { t.path.span } else { tcx.map.span(impl_node_id) diff --git a/src/librustc_typeck/coherence/orphan.rs b/src/librustc_typeck/coherence/orphan.rs index 4c38475335ce8..cb424eb48e932 100644 --- a/src/librustc_typeck/coherence/orphan.rs +++ b/src/librustc_typeck/coherence/orphan.rs @@ -68,7 +68,7 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> { fn check_item(&self, item: &hir::Item) { let def_id = self.tcx.map.local_def_id(item.id); match item.node { - hir::ItemImpl(_, _, _, None, ref ty, _) => { + hir::ItemImpl(.., None, ref ty, _) => { // For inherent impls, self type must be a nominal type // defined in this crate. debug!("coherence2::orphan check: inherent impl {}", @@ -222,7 +222,7 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> { } } } - hir::ItemImpl(_, _, _, Some(_), _, _) => { + hir::ItemImpl(.., Some(_), _, _) => { // "Trait" impl debug!("coherence2::orphan check: trait impl {}", self.tcx.map.node_to_string(item.id)); diff --git a/src/librustc_typeck/coherence/overlap.rs b/src/librustc_typeck/coherence/overlap.rs index c4d925372f18d..890b6c72e6fee 100644 --- a/src/librustc_typeck/coherence/overlap.rs +++ b/src/librustc_typeck/coherence/overlap.rs @@ -122,7 +122,7 @@ impl<'cx, 'tcx,'v> intravisit::Visitor<'v> for OverlapChecker<'cx, 'tcx> { err.emit(); } } - hir::ItemImpl(_, _, _, Some(_), _, _) => { + hir::ItemImpl(.., Some(_), _, _) => { let impl_def_id = self.tcx.map.local_def_id(item.id); let trait_ref = self.tcx.impl_trait_ref(impl_def_id).unwrap(); let trait_def_id = trait_ref.def_id; diff --git a/src/librustc_typeck/coherence/unsafety.rs b/src/librustc_typeck/coherence/unsafety.rs index 53ec72abac05f..cdf5478e692b2 100644 --- a/src/librustc_typeck/coherence/unsafety.rs +++ b/src/librustc_typeck/coherence/unsafety.rs @@ -81,7 +81,7 @@ impl<'cx, 'tcx,'v> intravisit::Visitor<'v> for UnsafetyChecker<'cx, 'tcx> { hir::ItemDefaultImpl(unsafety, _) => { self.check_unsafety_coherence(item, unsafety, hir::ImplPolarity::Positive); } - hir::ItemImpl(unsafety, polarity, _, _, _, _) => { + hir::ItemImpl(unsafety, polarity, ..) => { self.check_unsafety_coherence(item, unsafety, polarity); } _ => { } diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 55db44a2c3109..a012fd418cac6 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -850,7 +850,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) { enforce_impl_lifetimes_are_constrained(ccx, generics, def_id, impl_items); }, - hir::ItemTrait(_, _, _, ref trait_items) => { + hir::ItemTrait(.., ref trait_items) => { let trait_def = trait_def_of_item(ccx, it); let def_id = trait_def.trait_ref.def_id; let _: Result<(), ErrorReported> = // any error is already reported, can ignore @@ -1311,7 +1311,7 @@ fn trait_defines_associated_type_named(ccx: &CrateCtxt, }; let trait_items = match item.node { - hir::ItemTrait(_, _, _, ref trait_items) => trait_items, + hir::ItemTrait(.., ref trait_items) => trait_items, _ => bug!("trait_node_id {} is not a trait", trait_node_id) }; @@ -1445,8 +1445,8 @@ fn generics_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, NodeItem(item) => { match item.node { - ItemFn(_, _, _, _, ref generics, _) | - ItemImpl(_, _, ref generics, _, _, _) => generics, + ItemFn(.., ref generics, _) | + ItemImpl(_, _, ref generics, ..) => generics, ItemTy(_, ref generics) | ItemEnum(_, ref generics) | @@ -1651,7 +1651,7 @@ fn predicates_of_item<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, let no_generics = hir::Generics::empty(); let generics = match it.node { - hir::ItemFn(_, _, _, _, ref generics, _) | + hir::ItemFn(.., ref generics, _) | hir::ItemTy(_, ref generics) | hir::ItemEnum(_, ref generics) | hir::ItemStruct(_, ref generics) | diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index a5445b18e77f8..d2e2d578fcedb 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -76,6 +76,7 @@ This API is completely unstable and subject to change. #![feature(box_patterns)] #![feature(box_syntax)] +#![feature(dotdot_in_tuple_patterns)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] @@ -215,7 +216,7 @@ fn check_main_fn_ty(ccx: &CrateCtxt, match tcx.map.find(main_id) { Some(hir_map::NodeItem(it)) => { match it.node { - hir::ItemFn(_, _, _, _, ref generics, _) => { + hir::ItemFn(.., ref generics, _) => { if generics.is_parameterized() { struct_span_err!(ccx.tcx.sess, generics.span, E0131, "main function is not allowed to have type parameters") @@ -267,7 +268,7 @@ fn check_start_fn_ty(ccx: &CrateCtxt, match tcx.map.find(start_id) { Some(hir_map::NodeItem(it)) => { match it.node { - hir::ItemFn(_,_,_,_,ref ps,_) + hir::ItemFn(..,ref ps,_) if ps.is_parameterized() => { struct_span_err!(tcx.sess, ps.span, E0132, "start function is not allowed to have type parameters") diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 44d1fbfdb70b3..4a637b5cfcff7 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -227,6 +227,7 @@ #![feature(const_fn)] #![feature(core_float)] #![feature(core_intrinsics)] +#![feature(dotdot_in_tuple_patterns)] #![feature(dropck_parametricity)] #![feature(float_extras)] #![feature(float_from_str_radix)] diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index fe448cdd78feb..90a16853d56dd 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -200,7 +200,7 @@ impl OpenOptions { const ERROR_INVALID_PARAMETER: i32 = 87; match (self.read, self.write, self.append, self.access_mode) { - (_, _, _, Some(mode)) => Ok(mode), + (.., Some(mode)) => Ok(mode), (true, false, false, None) => Ok(c::GENERIC_READ), (false, true, false, None) => Ok(c::GENERIC_WRITE), (true, true, false, None) => Ok(c::GENERIC_READ | c::GENERIC_WRITE), diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 4394fb0e14312..bbd3345144585 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -562,7 +562,7 @@ impl Pat { PatKind::Wild | PatKind::Lit(_) | PatKind::Range(_, _) | - PatKind::Ident(_, _, _) | + PatKind::Ident(..) | PatKind::Path(..) | PatKind::Mac(_) => { true diff --git a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs b/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs index 5a3412b7ed9f9..5b1ecfed24278 100644 --- a/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs +++ b/src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs @@ -10,6 +10,7 @@ // force-host +#![feature(dotdot_in_tuple_patterns)] #![feature(plugin_registrar, quote, rustc_private)] extern crate syntax; @@ -75,7 +76,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, Annotatable::ImplItem(_) => { quote_item!(cx, impl X { fn foo(&self) -> i32 { 42 } }).unwrap().and_then(|i| { match i.node { - ItemKind::Impl(_, _, _, _, _, mut items) => { + ItemKind::Impl(.., mut items) => { Annotatable::ImplItem(P(items.pop().expect("impl method not found"))) } _ => unreachable!("impl parsed to something other than impl") @@ -85,7 +86,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, Annotatable::TraitItem(_) => { quote_item!(cx, trait X { fn foo(&self) -> i32 { 0 } }).unwrap().and_then(|i| { match i.node { - ItemKind::Trait(_, _, _, mut items) => { + ItemKind::Trait(.., mut items) => { Annotatable::TraitItem(P(items.pop().expect("trait method not found"))) } _ => unreachable!("trait parsed to something other than trait") diff --git a/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs b/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs index 46fdf91125845..4885863122c3b 100644 --- a/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs +++ b/src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs @@ -10,6 +10,7 @@ // force-host +#![feature(dotdot_in_tuple_patterns)] #![feature(plugin_registrar, quote, rustc_private)] extern crate syntax; @@ -81,7 +82,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, Annotatable::ImplItem(_it) => vec![ quote_item!(cx, impl X { fn foo(&self) -> i32 { 42 } }).unwrap().and_then(|i| { match i.node { - ItemKind::Impl(_, _, _, _, _, mut items) => { + ItemKind::Impl(.., mut items) => { Annotatable::ImplItem(P(items.pop().expect("impl method not found"))) } _ => unreachable!("impl parsed to something other than impl") @@ -91,7 +92,7 @@ fn expand_into_foo_multi(cx: &mut ExtCtxt, Annotatable::TraitItem(_it) => vec![ quote_item!(cx, trait X { fn foo(&self) -> i32 { 0 } }).unwrap().and_then(|i| { match i.node { - ItemKind::Trait(_, _, _, mut items) => { + ItemKind::Trait(.., mut items) => { Annotatable::TraitItem(P(items.pop().expect("trait method not found"))) } _ => unreachable!("trait parsed to something other than trait") @@ -165,7 +166,7 @@ fn expand_caller(cx: &mut ExtCtxt, push: &mut FnMut(Annotatable)) { let (orig_fn_name, ret_type) = match *it { Annotatable::Item(ref item) => match item.node { - ItemKind::Fn(ref decl, _, _, _, _, _) => { + ItemKind::Fn(ref decl, ..) => { (item.ident, &decl.output) } _ => cx.span_fatal(item.span, "Only functions with return types can be annotated.") From e05e74ac831bc8438f5daeb98432a29285ed9514 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 26 Aug 2016 19:23:42 +0300 Subject: [PATCH 2/2] Replace `_, _` with `..` --- src/libgetopts/lib.rs | 2 +- src/librustc/cfg/construct.rs | 6 ++--- src/librustc/hir/def.rs | 2 +- src/librustc/hir/intravisit.rs | 4 +-- src/librustc/hir/map/collector.rs | 2 +- src/librustc/hir/mod.rs | 4 +-- src/librustc/hir/pat_util.rs | 2 +- src/librustc/infer/error_reporting.rs | 6 ++--- src/librustc/infer/higher_ranked/mod.rs | 2 +- src/librustc/infer/mod.rs | 6 ++--- src/librustc/infer/region_inference/mod.rs | 6 ++--- src/librustc/infer/type_variable.rs | 2 +- src/librustc/middle/effect.rs | 4 +-- src/librustc/middle/expr_use_visitor.rs | 8 +++--- src/librustc/middle/intrinsicck.rs | 4 +-- src/librustc/middle/liveness.rs | 6 ++--- src/librustc/middle/mem_categorization.rs | 26 +++++++++---------- src/librustc/middle/region.rs | 2 +- src/librustc/middle/resolve_lifetime.rs | 10 +++---- src/librustc/middle/stability.rs | 2 +- src/librustc/mir/tcx.rs | 2 +- src/librustc/session/config.rs | 4 +-- src/librustc/traits/select.rs | 4 +-- src/librustc/ty/adjustment.rs | 2 +- src/librustc/ty/contents.rs | 2 +- src/librustc/ty/fast_reject.rs | 2 +- src/librustc/ty/item_path.rs | 2 +- src/librustc/ty/mod.rs | 6 ++--- src/librustc/ty/sty.rs | 6 ++--- src/librustc/ty/util.rs | 2 +- src/librustc_borrowck/borrowck/check_loans.rs | 8 +++--- src/librustc_borrowck/borrowck/fragments.rs | 8 +++--- .../borrowck/gather_loans/gather_moves.rs | 6 ++--- .../borrowck/gather_loans/lifetime.rs | 12 ++++----- .../borrowck/gather_loans/mod.rs | 2 +- .../borrowck/gather_loans/move_error.rs | 6 ++--- src/librustc_borrowck/borrowck/mod.rs | 10 +++---- src/librustc_borrowck/borrowck/move_data.rs | 8 +++--- src/librustc_const_eval/check_match.rs | 12 ++++----- src/librustc_const_eval/eval.rs | 6 ++--- src/librustc_driver/lib.rs | 5 ++-- src/librustc_incremental/assert_dep_graph.rs | 2 +- .../calculate_svh/svh_visitor.rs | 6 ++--- src/librustc_incremental/lib.rs | 1 + src/librustc_incremental/persist/fs.rs | 4 +-- src/librustc_lint/builtin.rs | 8 +++--- src/librustc_lint/unused.rs | 14 +++++----- src/librustc_metadata/astencode.rs | 2 +- src/librustc_metadata/creader.rs | 16 ++++++------ src/librustc_metadata/decoder.rs | 4 +-- src/librustc_metadata/encoder.rs | 2 +- src/librustc_mir/hair/cx/expr.rs | 6 ++--- src/librustc_mir/hair/cx/mod.rs | 2 +- src/librustc_mir/transform/qualify_consts.rs | 10 +++---- src/librustc_mir/transform/type_check.rs | 2 +- src/librustc_passes/ast_validation.rs | 2 +- src/librustc_passes/consts.rs | 12 ++++----- src/librustc_passes/loops.rs | 2 +- src/librustc_privacy/lib.rs | 12 ++++----- src/librustc_resolve/build_reduced_graph.rs | 4 +-- src/librustc_resolve/check_unused.rs | 2 +- src/librustc_resolve/lib.rs | 16 ++++++------ src/librustc_save_analysis/dump_visitor.rs | 12 ++++----- src/librustc_save_analysis/lib.rs | 6 ++--- src/librustc_trans/adt.rs | 6 ++--- src/librustc_trans/back/write.rs | 12 ++++----- src/librustc_trans/base.rs | 2 +- src/librustc_trans/cabi_x86_64.rs | 2 +- src/librustc_trans/callee.rs | 6 ++--- src/librustc_trans/collector.rs | 5 ++-- src/librustc_trans/debuginfo/metadata.rs | 8 +++--- src/librustc_trans/debuginfo/type_names.rs | 2 +- src/librustc_trans/intrinsic.rs | 2 +- src/librustc_trans/mir/block.rs | 4 +-- src/librustc_trans/trans_item.rs | 2 +- src/librustc_typeck/check/callee.rs | 2 +- src/librustc_typeck/check/cast.rs | 2 +- src/librustc_typeck/check/coercion.rs | 2 +- src/librustc_typeck/check/intrinsic.rs | 2 +- src/librustc_typeck/check/method/confirm.rs | 2 +- src/librustc_typeck/check/method/probe.rs | 8 +++--- src/librustc_typeck/check/mod.rs | 12 ++++----- src/librustc_typeck/check/regionck.rs | 10 +++---- src/librustc_typeck/check/upvar.rs | 8 +++--- src/librustc_typeck/check/wfcheck.rs | 4 +-- src/librustc_typeck/check/writeback.rs | 4 +-- src/librustc_typeck/coherence/mod.rs | 2 +- src/librustc_typeck/collect.rs | 6 ++--- src/librustc_typeck/variance/constraints.rs | 2 +- src/librustc_typeck/variance/terms.rs | 2 +- src/librustdoc/clean/inline.rs | 2 +- src/librustdoc/clean/mod.rs | 8 +++--- src/librustdoc/html/render.rs | 2 +- src/librustdoc/lib.rs | 3 ++- src/libserialize/hex.rs | 2 +- src/libstd/path.rs | 2 +- src/libsyntax/ast.rs | 2 +- src/libsyntax/ext/tt/macro_parser.rs | 4 +-- src/libsyntax/parse/token.rs | 6 ++--- src/libsyntax_ext/asm.rs | 2 +- src/libsyntax_ext/deriving/debug.rs | 2 +- src/libsyntax_ext/deriving/generic/mod.rs | 8 +++--- src/libsyntax_ext/deriving/hash.rs | 2 +- src/libsyntax_ext/lib.rs | 1 + src/libterm/terminfo/parm.rs | 2 +- src/test/run-make/save-analysis/foo.rs | 8 +++--- .../auxiliary/custom_derive_plugin_attr.rs | 3 ++- 107 files changed, 275 insertions(+), 271 deletions(-) diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index eda20699755a1..42200795bb3a5 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -279,7 +279,7 @@ impl OptGroup { }], } } - (_, _) => panic!("something is wrong with the long-form opt"), + _ => panic!("something is wrong with the long-form opt"), } } } diff --git a/src/librustc/cfg/construct.rs b/src/librustc/cfg/construct.rs index 232db76a6d175..25a73226473b7 100644 --- a/src/librustc/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -99,7 +99,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { fn pat(&mut self, pat: &hir::Pat, pred: CFGIndex) -> CFGIndex { match pat.node { - PatKind::Binding(_, _, None) | + PatKind::Binding(.., None) | PatKind::Path(..) | PatKind::Lit(..) | PatKind::Range(..) | @@ -109,7 +109,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { PatKind::Box(ref subpat) | PatKind::Ref(ref subpat, _) | - PatKind::Binding(_, _, Some(ref subpat)) => { + PatKind::Binding(.., Some(ref subpat)) => { let subpat_exit = self.pat(&subpat, pred); 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)) } - hir::ExprMethodCall(_, _, ref args) => { + hir::ExprMethodCall(.., ref args) => { self.call(expr, pred, &args[0], args[1..].iter().map(|e| &**e)) } diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs index 71bc2693abd27..a270be4f1dfda 100644 --- a/src/librustc/hir/def.rs +++ b/src/librustc/hir/def.rs @@ -104,7 +104,7 @@ impl Def { pub fn var_id(&self) -> ast::NodeId { match *self { Def::Local(_, id) | - Def::Upvar(_, id, _, _) => { + Def::Upvar(_, id, ..) => { id } diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 81b1be53615d6..f0caa971d9699 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -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_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_generics(type_parameters); 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, ..) => { visitor.visit_generics(generics); } - FnKind::Method(_, sig, _, _) => { + FnKind::Method(_, sig, ..) => { visitor.visit_generics(&sig.generics); } FnKind::Closure(_) => {} diff --git a/src/librustc/hir/map/collector.rs b/src/librustc/hir/map/collector.rs index 280c0f3048569..d4e1eb70ae8f9 100644 --- a/src/librustc/hir/map/collector.rs +++ b/src/librustc/hir/map/collector.rs @@ -109,7 +109,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> { this.insert(struct_def.id(), NodeStructCtor(struct_def)); } } - ItemTrait(_, _, ref bounds, _) => { + ItemTrait(.., ref bounds, _) => { for b in bounds.iter() { if let TraitTyParamBound(ref t, TraitBoundModifier::None) = *b { this.insert(t.trait_ref.ref_id, NodeItem(i)); diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index e16005558f82b..e22c9869ab176 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -469,7 +469,7 @@ impl Pat { } match self.node { - PatKind::Binding(_, _, Some(ref p)) => p.walk_(it), + PatKind::Binding(.., Some(ref p)) => p.walk_(it), PatKind::Struct(_, ref fields, _) => { fields.iter().all(|field| field.node.pat.walk_(it)) } @@ -486,7 +486,7 @@ impl Pat { } PatKind::Wild | PatKind::Lit(_) | - PatKind::Range(_, _) | + PatKind::Range(..) | PatKind::Binding(..) | PatKind::Path(..) => { true diff --git a/src/librustc/hir/pat_util.rs b/src/librustc/hir/pat_util.rs index abb6084002448..a63bf14cb0238 100644 --- a/src/librustc/hir/pat_util.rs +++ b/src/librustc/hir/pat_util.rs @@ -53,7 +53,7 @@ impl EnumerateAndAdjustIterator for T { pub fn pat_is_refutable(dm: &DefMap, pat: &hir::Pat) -> bool { match pat.node { - PatKind::Lit(_) | PatKind::Range(_, _) | PatKind::Path(Some(..), _) => true, + PatKind::Lit(_) | PatKind::Range(..) | PatKind::Path(Some(..), _) => true, PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) => { diff --git a/src/librustc/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs index 753dd01d87eea..38f3f055cbb24 100644 --- a/src/librustc/infer/error_reporting.rs +++ b/src/librustc/infer/error_reporting.rs @@ -140,9 +140,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { Some(ast_map::NodeExpr(expr)) => match expr.node { hir::ExprCall(..) => "call", hir::ExprMethodCall(..) => "method call", - hir::ExprMatch(_, _, hir::MatchSource::IfLetDesugar { .. }) => "if let", - hir::ExprMatch(_, _, hir::MatchSource::WhileLetDesugar) => "while let", - hir::ExprMatch(_, _, hir::MatchSource::ForLoopDesugar) => "for", + hir::ExprMatch(.., hir::MatchSource::IfLetDesugar { .. }) => "if let", + hir::ExprMatch(.., hir::MatchSource::WhileLetDesugar) => "while let", + hir::ExprMatch(.., hir::MatchSource::ForLoopDesugar) => "for", hir::ExprMatch(..) => "match", _ => "expression", }, diff --git a/src/librustc/infer/higher_ranked/mod.rs b/src/librustc/infer/higher_ranked/mod.rs index 90be5e935baf1..322752ccea3e5 100644 --- a/src/librustc/infer/higher_ranked/mod.rs +++ b/src/librustc/infer/higher_ranked/mod.rs @@ -684,7 +684,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { warnings.extend( match self.region_vars.var_origin(vid) { LateBoundRegion(_, - ty::BrNamed(_, _, wc), + ty::BrNamed(.., wc), _) => Some(wc), _ => None, }); diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index bc5ca76c3f857..59431f3f02dce 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -225,7 +225,7 @@ impl TypeOrigin { &TypeOrigin::RelateOutputImplTypes(_) | &TypeOrigin::ExprAssignable(_) => "mismatched types", &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", _ => "match arms have incompatible types", }, @@ -1712,7 +1712,7 @@ impl TypeOrigin { TypeOrigin::ExprAssignable(span) => span, TypeOrigin::Misc(span) => span, TypeOrigin::RelateOutputImplTypes(span) => span, - TypeOrigin::MatchExpressionArm(match_span, _, _) => match_span, + TypeOrigin::MatchExpressionArm(match_span, ..) => match_span, TypeOrigin::IfExpression(span) => span, TypeOrigin::IfExpressionWithNoElse(span) => span, TypeOrigin::RangeExpression(span) => span, @@ -1765,7 +1765,7 @@ impl RegionVariableOrigin { Autoref(a) => a, Coercion(a) => a, EarlyBoundRegion(a, _) => a, - LateBoundRegion(a, _, _) => a, + LateBoundRegion(a, ..) => a, BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP, UpvarRegion(_, a) => a } diff --git a/src/librustc/infer/region_inference/mod.rs b/src/librustc/infer/region_inference/mod.rs index b3693ae1e21ad..ef36ffa831921 100644 --- a/src/librustc/infer/region_inference/mod.rs +++ b/src/librustc/infer/region_inference/mod.rs @@ -605,7 +605,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> { undo_entry: &UndoLogEntry<'tcx>) -> bool { match undo_entry { - &AddConstraint(ConstrainVarSubVar(_, _)) => + &AddConstraint(ConstrainVarSubVar(..)) => false, &AddConstraint(ConstrainRegSubVar(a, _)) => skols.contains(&a), @@ -613,7 +613,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> { skols.contains(&b), &AddConstraint(ConstrainRegSubReg(a, b)) => skols.contains(&a) || skols.contains(&b), - &AddGiven(_, _) => + &AddGiven(..) => false, &AddVerify(_) => false, @@ -1372,7 +1372,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> { (&ReFree(..), &ReFree(..)) => Equal, (&ReFree(..), _) => Less, (_, &ReFree(..)) => Greater, - (_, _) => Equal, + (..) => Equal, } } lower_bounds.sort_by(|a, b| free_regions_first(a, b)); diff --git a/src/librustc/infer/type_variable.rs b/src/librustc/infer/type_variable.rs index 09ae16540c4f1..da9fd1cff2b46 100644 --- a/src/librustc/infer/type_variable.rs +++ b/src/librustc/infer/type_variable.rs @@ -267,7 +267,7 @@ impl<'tcx> TypeVariableTable<'tcx> { 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 { // quick check to see if this variable was // created since the snapshot started or not. diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index 66c55eb1f3e5f..a7af0b50b8494 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -43,7 +43,7 @@ enum RootUnsafeContext { fn type_is_unsafe_function(ty: Ty) -> bool { match ty.sty { - ty::TyFnDef(_, _, ref f) | + ty::TyFnDef(.., ref f) | ty::TyFnPtr(ref f) => f.unsafety == hir::Unsafety::Unsafe, _ => 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 { FnKind::ItemFn(_, _, unsafety, ..) => (true, unsafety == hir::Unsafety::Unsafe), - FnKind::Method(_, sig, _, _) => + FnKind::Method(_, sig, ..) => (true, sig.unsafety == hir::Unsafety::Unsafe), _ => (false, false), }; diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 66c8a8ac0d37b..d32954d3800ad 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -409,7 +409,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> { self.consume_exprs(args); } - hir::ExprMethodCall(_, _, ref args) => { // callee.m(args) + hir::ExprMethodCall(.., ref args) => { // callee.m(args) self.consume_exprs(args); } @@ -940,9 +940,9 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> { pat); return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| { match pat.node { - PatKind::Binding(hir::BindByRef(..), _, _) => + PatKind::Binding(hir::BindByRef(..), ..) => mode.lub(BorrowingMatch), - PatKind::Binding(hir::BindByValue(..), _, _) => { + PatKind::Binding(hir::BindByValue(..), ..) => { match copy_or_move(self.mc.infcx, &cmt_pat, PatBindingMove) { Copy => mode.lub(CopyingMatch), Move(..) => mode.lub(MovingMatch), @@ -964,7 +964,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> { let infcx = self.mc.infcx; let delegate = &mut self.delegate; 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); // pat_ty: the type of the binding being produced. diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index a1a4f15b9f78e..61bcc05bbb4f4 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -52,7 +52,7 @@ struct ExprVisitor<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> { fn def_id_is_transmute(&self, def_id: DefId) -> bool { 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 }; 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) => { let typ = self.infcx.tcx.node_id_to_type(expr.id); 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 to = bare_fn_ty.sig.0.output; self.check_transmute(expr.span, from, to, expr.id); diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index b83826de26dd6..b579c69cd05c0 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -482,7 +482,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) { ir.add_live_node_for_node(expr.id, ExprNode(expr.span)); 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)); intravisit::walk_expr(ir, expr); } @@ -943,7 +943,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { self.propagate_through_expr(&e, succ) } - hir::ExprClosure(_, _, ref blk, _) => { + hir::ExprClosure(.., ref blk, _) => { debug!("{} is an ExprClosure", expr_to_string(expr)); @@ -1123,7 +1123,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { self.propagate_through_expr(&f, succ) } - hir::ExprMethodCall(_, _, ref args) => { + hir::ExprMethodCall(.., ref args) => { let method_call = ty::MethodCall::expr(expr.id); let method_ty = self.ir.tcx.tables.borrow().method_map[&method_call].ty; // FIXME(canndrew): This is_never should really be an is_uninhabited diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index b17411ced57fb..f8eb0d4a0ece8 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -228,7 +228,7 @@ fn deref_kind(t: Ty, context: DerefKindContext) -> McResult { Ok(deref_interior(InteriorField(PositionalField(0)))) } - ty::TyArray(_, _) | ty::TySlice(_) => { + ty::TyArray(..) | ty::TySlice(_) => { // no deref of indexed content without supplying InteriorOffsetKind if let Some(context) = context { Ok(deref_interior(InteriorElement(context, ElementKind::VecElement))) @@ -318,7 +318,7 @@ impl MutabilityCategory { fn from_local(tcx: TyCtxt, id: ast::NodeId) -> MutabilityCategory { let ret = match tcx.map.get(id) { ast_map::NodeLocal(p) => match p.node { - PatKind::Binding(bind_mode, _, _) => { + PatKind::Binding(bind_mode, ..) => { if bind_mode == hir::BindByValue(hir::MutMutable) { McDeclared } else { @@ -419,7 +419,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> { // *being borrowed* is. But ideally we would put in a more // fundamental fix to this conflated use of the node id. 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, // but what we want here is the type of the underlying value being borrowed. // 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 { - hir::ExprClosure(_, _, ref body, _) => body.id, + hir::ExprClosure(.., ref body, _) => body.id, _ => 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)?; } @@ -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 => { // always ok } @@ -1275,9 +1275,9 @@ impl<'tcx> cmt_<'tcx> { Categorization::Rvalue(..) | Categorization::StaticItem | Categorization::Local(..) | - Categorization::Deref(_, _, UnsafePtr(..)) | - Categorization::Deref(_, _, BorrowedPtr(..)) | - Categorization::Deref(_, _, Implicit(..)) | + Categorization::Deref(.., UnsafePtr(..)) | + Categorization::Deref(.., BorrowedPtr(..)) | + Categorization::Deref(.., Implicit(..)) | Categorization::Upvar(..) => { Rc::new((*self).clone()) } @@ -1320,7 +1320,7 @@ impl<'tcx> cmt_<'tcx> { Categorization::Rvalue(..) | Categorization::Local(..) | Categorization::Upvar(..) | - Categorization::Deref(_, _, UnsafePtr(..)) => { // yes, it's aliasable, but... + Categorization::Deref(.., UnsafePtr(..)) => { // yes, it's aliasable, but... NonAliasable } @@ -1349,9 +1349,9 @@ impl<'tcx> cmt_<'tcx> { match self.note { NoteClosureEnv(..) | NoteUpvarRef(..) => { Some(match self.cat { - Categorization::Deref(ref inner, _, _) => { + Categorization::Deref(ref inner, ..) => { match inner.cat { - Categorization::Deref(ref inner, _, _) => inner.clone(), + Categorization::Deref(ref inner, ..) => inner.clone(), Categorization::Upvar(..) => inner.clone(), _ => bug!() } @@ -1379,7 +1379,7 @@ impl<'tcx> cmt_<'tcx> { "local variable".to_string() } } - Categorization::Deref(_, _, pk) => { + Categorization::Deref(.., pk) => { let upvar = self.upvar(); match upvar.as_ref().map(|i| &i.cat) { Some(&Categorization::Upvar(ref var)) => { diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index ef905b51edfb2..fb99820f7c855 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -956,7 +956,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor, local: &hir::Local) { /// | box P& fn is_binding_pat(pat: &hir::Pat) -> bool { match pat.node { - PatKind::Binding(hir::BindByRef(_), _, _) => true, + PatKind::Binding(hir::BindByRef(_), ..) => true, PatKind::Struct(_, ref field_pats, _) => { field_pats.iter().any(|fp| is_binding_pat(&fp.node.pat)) diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index b6faf834b26f7..e897b16efab5a 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -157,7 +157,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> { hir::ItemEnum(_, ref generics) | hir::ItemStruct(_, ref generics) | hir::ItemUnion(_, ref generics) | - hir::ItemTrait(_, ref generics, _, _) | + hir::ItemTrait(_, ref generics, ..) | hir::ItemImpl(_, _, ref generics, ..) => { // These kinds of items have only early bound lifetime parameters. 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) }) } - FnKind::Method(_, sig, _, _) => { + FnKind::Method(_, sig, ..) => { self.visit_early_late( fn_id, decl, @@ -455,7 +455,7 @@ fn extract_labels(ctxt: &mut LifetimeContext, b: &hir::Block) { fn expression_label(ex: &hir::Expr) -> Option<(ast::Name, Span)> { match ex.node { - hir::ExprWhile(_, _, Some(label)) | + hir::ExprWhile(.., Some(label)) | hir::ExprLoop(_, Some(label)) => Some((label.node, label.span)), _ => None, } @@ -503,7 +503,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { intravisit::walk_fn_decl(self, fd); self.visit_generics(generics); } - FnKind::Method(_, sig, _, _) => { + FnKind::Method(_, sig, ..) => { intravisit::walk_fn_decl(self, fd); self.visit_generics(&sig.generics); } @@ -583,7 +583,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { start += 1; // Self comes first. } match parent.node { - hir::ItemTrait(_, ref generics, _, _) | + hir::ItemTrait(_, ref generics, ..) | hir::ItemImpl(_, _, ref generics, ..) => { start += generics.lifetimes.len() + generics.ty_params.len(); } diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 9fc83557fa44b..c62c99c3b7062 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -553,7 +553,7 @@ pub fn check_expr<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, e: &hir::Expr, &Option)) { let span; let id = match e.node { - hir::ExprMethodCall(i, _, _) => { + hir::ExprMethodCall(i, ..) => { span = i.span; let method_call = ty::MethodCall::expr(e.id); tcx.tables.borrow().method_map[&method_call].def_id diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index a0ccc72aa1fce..c82e723525b45 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -153,7 +153,7 @@ impl<'tcx> Rvalue<'tcx> { )) } &Rvalue::Len(..) => Some(tcx.types.usize), - &Rvalue::Cast(_, _, ty) => Some(ty), + &Rvalue::Cast(.., ty) => Some(ty), &Rvalue::BinaryOp(op, ref lhs, ref rhs) => { let lhs_ty = lhs.ty(mir, tcx); let rhs_ty = rhs.ty(mir, tcx); diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index a2f926aa92c52..5917c8f90e037 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1535,8 +1535,8 @@ pub fn get_unstable_features_setting() -> UnstableFeatures { let bootstrap_provided_key = env::var("RUSTC_BOOTSTRAP_KEY").ok(); match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) { (_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat, - (true, _, _) => UnstableFeatures::Disallow, - (false, _, _) => UnstableFeatures::Allow + (true, ..) => UnstableFeatures::Disallow, + (false, ..) => UnstableFeatures::Allow } } diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index f8f10d9c26541..3f2bc8cbd13c5 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -1379,7 +1379,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { } // provide an impl, but only for suitable `fn` pointers - ty::TyFnDef(_, _, &ty::BareFnTy { + ty::TyFnDef(.., &ty::BareFnTy { unsafety: hir::Unsafety::Normal, abi: Abi::Rust, sig: ty::Binder(ty::FnSig { @@ -1635,7 +1635,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> { } // [T; n] -> [T]. - (&ty::TyArray(_, _), &ty::TySlice(_)) => true, + (&ty::TyArray(..), &ty::TySlice(_)) => true, // Struct -> Struct. (&ty::TyStruct(def_id_a, _), &ty::TyStruct(def_id_b, _)) => { diff --git a/src/librustc/ty/adjustment.rs b/src/librustc/ty/adjustment.rs index ae9fd5ab5bc87..3386d894196fa 100644 --- a/src/librustc/ty/adjustment.rs +++ b/src/librustc/ty/adjustment.rs @@ -160,7 +160,7 @@ impl<'a, 'gcx, 'tcx> ty::TyS<'tcx> { AdjustReifyFnPointer => { 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: {:?}", self); diff --git a/src/librustc/ty/contents.rs b/src/librustc/ty/contents.rs index d7d4693c1165f..e0e8a329e6e1d 100644 --- a/src/librustc/ty/contents.rs +++ b/src/librustc/ty/contents.rs @@ -202,7 +202,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> { TC::None } - ty::TyRef(_, _) => { + ty::TyRef(..) => { TC::None } diff --git a/src/librustc/ty/fast_reject.rs b/src/librustc/ty/fast_reject.rs index f9ca2484d7efc..84f34a640dd8e 100644 --- a/src/librustc/ty/fast_reject.rs +++ b/src/librustc/ty/fast_reject.rs @@ -90,7 +90,7 @@ pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>, ty::TyTuple(ref tys) => { 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())) } ty::TyProjection(_) | ty::TyParam(_) => { diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index ba8d332850925..ddb0a6970cba5 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -337,7 +337,7 @@ pub fn characteristic_def_id_of_type(ty: Ty) -> Option { .filter_map(|ty| characteristic_def_id_of_type(ty)) .next(), - ty::TyFnDef(def_id, _, _) | + ty::TyFnDef(def_id, ..) | ty::TyClosure(def_id, _) => Some(def_id), ty::TyBool | diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index a9b3833b40175..dfe24d5627bf1 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1269,7 +1269,7 @@ impl<'a, 'tcx> ParameterEnvironment<'tcx> { match tcx.map.find(id) { Some(ast_map::NodeImplItem(ref impl_item)) => { 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), // so for now just grab environment for the impl 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 { ItemTrait(.., ref tis) => { 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)) { ConstTraitItem(ac) => Some(ac), _ => { @@ -2306,7 +2306,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } ItemImpl(.., ref iis) => { 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)) { ConstTraitItem(ac) => Some(ac), _ => { diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index d45fde925c511..7ded2b05f3b5b 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -1171,7 +1171,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> { pub fn fn_sig(&self) -> &'tcx PolyFnSig<'tcx> { 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) } } @@ -1179,7 +1179,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> { /// Returns the ABI of the given function. pub fn fn_abi(&self) -> abi::Abi { 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"), } } @@ -1252,7 +1252,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> { TyFloat(_) | TyBox(_) | TyStr | - TyArray(_, _) | + TyArray(..) | TySlice(_) | TyRawPtr(_) | TyNever | diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index ad209094600ae..51ca6bfeb5aff 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -439,7 +439,7 @@ impl<'a, 'gcx, 'tcx> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx> { TyRef(_, m) => self.hash(m.mutbl), TyClosure(def_id, _) | TyAnon(def_id, _) | - TyFnDef(def_id, _, _) => self.def_id(def_id), + TyFnDef(def_id, ..) => self.def_id(def_id), TyFnPtr(f) => { self.hash(f.unsafety); self.hash(f.abi); diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index b4c6689c24b9e..6f4c48d632a7a 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -56,7 +56,7 @@ fn owned_ptr_base_path<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> &'a LoanPath< } } 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>) -> Rc helper(lp_base) + LpExtend(ref lp_base, ..) => helper(lp_base) } } } @@ -312,7 +312,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> { break; } LpDowncast(ref lp_base, _) | - LpExtend(ref lp_base, _, _) => { + LpExtend(ref lp_base, ..) => { loan_path = &lp_base; } } @@ -542,7 +542,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> { err } - (_, _) => { + (..) => { let mut err = struct_span_err!(self.bccx, new_loan.span, E0502, "cannot borrow `{}`{} as {} because \ {} is also borrowed as {}{}", diff --git a/src/librustc_borrowck/borrowck/fragments.rs b/src/librustc_borrowck/borrowck/fragments.rs index 86f396d8982b0..45f5c3288a6d0 100644 --- a/src/librustc_borrowck/borrowck/fragments.rs +++ b/src/librustc_borrowck/borrowck/fragments.rs @@ -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. - LpExtend(_, _, LpDeref(mc::UnsafePtr(..))) | - LpExtend(_, _, LpDeref(mc::Implicit(..))) | - LpExtend(_, _, LpDeref(mc::BorrowedPtr(..))) => {} + LpExtend(.., LpDeref(mc::UnsafePtr(..))) | + LpExtend(.., LpDeref(mc::Implicit(..))) | + LpExtend(.., LpDeref(mc::BorrowedPtr(..))) => {} // FIXME (pnkfelix): LV[j] should be tracked, at least in 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. // // Anyway, for now: LV[j] is not tracked precisely - LpExtend(_, _, LpInterior(_, InteriorElement(..))) => { + LpExtend(.., LpInterior(_, InteriorElement(..))) => { let mp = this.move_path(tcx, lp.clone()); gathered_fragments.push(AllButOneFrom(mp)); } diff --git a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs index 3cf02fc85a463..5f2d6c406c4b9 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs @@ -161,9 +161,9 @@ fn check_and_get_illegal_move_origin<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, cmt: &mc::cmt<'tcx>) -> Option> { match cmt.cat { - Categorization::Deref(_, _, mc::BorrowedPtr(..)) | - Categorization::Deref(_, _, mc::Implicit(..)) | - Categorization::Deref(_, _, mc::UnsafePtr(..)) | + Categorization::Deref(.., mc::BorrowedPtr(..)) | + Categorization::Deref(.., mc::Implicit(..)) | + Categorization::Deref(.., mc::UnsafePtr(..)) | Categorization::StaticItem => { Some(cmt.clone()) } diff --git a/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs b/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs index 9f95175d59d43..5970d6e4f2f65 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/lifetime.rs @@ -74,9 +74,9 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> { Categorization::Rvalue(..) | Categorization::Local(..) | // L-Local Categorization::Upvar(..) | - Categorization::Deref(_, _, mc::BorrowedPtr(..)) | // L-Deref-Borrowed - Categorization::Deref(_, _, mc::Implicit(..)) | - Categorization::Deref(_, _, mc::UnsafePtr(..)) => { + Categorization::Deref(.., mc::BorrowedPtr(..)) | // L-Deref-Borrowed + Categorization::Deref(.., mc::Implicit(..)) | + Categorization::Deref(.., mc::UnsafePtr(..)) => { 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))) } Categorization::StaticItem | - Categorization::Deref(_, _, mc::UnsafePtr(..)) => { + Categorization::Deref(.., mc::UnsafePtr(..)) => { self.bccx.tcx.mk_region(ty::ReStatic) } - Categorization::Deref(_, _, mc::BorrowedPtr(_, r)) | - Categorization::Deref(_, _, mc::Implicit(_, r)) => { + Categorization::Deref(.., mc::BorrowedPtr(_, r)) | + Categorization::Deref(.., mc::Implicit(_, r)) => { r } Categorization::Downcast(ref cmt, _) | diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index a255564f01e25..763c012a8f8ab 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -205,7 +205,7 @@ fn check_aliasability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, alias_cause); Err(()) } - (_, _) => { + (..) => { Ok(()) } } diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs index 61c85e393d2dd..bda68a1cd1ceb 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs @@ -117,9 +117,9 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, move_from: mc::cmt<'tcx>) -> DiagnosticBuilder<'a> { match move_from.cat { - Categorization::Deref(_, _, mc::BorrowedPtr(..)) | - Categorization::Deref(_, _, mc::Implicit(..)) | - Categorization::Deref(_, _, mc::UnsafePtr(..)) | + Categorization::Deref(.., mc::BorrowedPtr(..)) | + Categorization::Deref(.., mc::Implicit(..)) | + Categorization::Deref(.., mc::UnsafePtr(..)) | Categorization::StaticItem => { let mut err = struct_span_err!(bccx, move_from.span, E0507, "cannot move out of {}", diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index e25adadbb2443..5d62629b64810 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -142,7 +142,7 @@ fn borrowck_item(this: &mut BorrowckCtxt, item: &hir::Item) { // loan step is intended for things that have a data // flow dependent conditions. match item.node { - hir::ItemStatic(_, _, ref ex) | + hir::ItemStatic(.., ref ex) | hir::ItemConst(_, ref 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 { match tcx.map.get(closure_id) { hir_map::NodeExpr(expr) => match expr.node { - hir::ExprClosure(_, _, ref block, _) => { + hir::ExprClosure(.., ref block, _) => { block.id } _ => { @@ -442,7 +442,7 @@ impl<'a, 'tcx> LoanPath<'tcx> { tcx.region_maps.node_extent(block_id) } 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 { match self.kind { LpExtend(ref base, _, LpDeref(_)) => base.depth(), - LpExtend(ref base, _, LpInterior(_, _)) => base.depth() + 1, + LpExtend(ref base, _, LpInterior(..)) => base.depth() + 1, _ => 0, } } @@ -1177,7 +1177,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { out.push(')'); } - LpVar(..) | LpUpvar(..) | LpExtend(_, _, LpInterior(..)) => { + LpVar(..) | LpUpvar(..) | LpExtend(.., LpInterior(..)) => { self.append_loan_path_to_string(loan_path, out) } } diff --git a/src/librustc_borrowck/borrowck/move_data.rs b/src/librustc_borrowck/borrowck/move_data.rs index 236a1a2835c2a..0c9261df54870 100644 --- a/src/librustc_borrowck/borrowck/move_data.rs +++ b/src/librustc_borrowck/borrowck/move_data.rs @@ -197,7 +197,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool { LpVar(_) | LpUpvar(_) => { true } - LpExtend(_, _, LpInterior(_, InteriorKind::InteriorElement(..))) => { + LpExtend(.., LpInterior(_, InteriorKind::InteriorElement(..))) => { // Paths involving element accesses a[i] do not refer to a unique // location, as there is no accurate tracking of the indices. // @@ -207,7 +207,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool { false } LpDowncast(ref lp_base, _) | - LpExtend(ref lp_base, _, _) => { + LpExtend(ref lp_base, ..) => { loan_path_is_precise(&lp_base) } } @@ -295,7 +295,7 @@ impl<'a, 'tcx> MoveData<'tcx> { } LpDowncast(ref base, _) | - LpExtend(ref base, _, _) => { + LpExtend(ref base, ..) => { let parent_index = self.move_path(tcx, base.clone()); let index = MovePathIndex(self.paths.borrow().len()); @@ -351,7 +351,7 @@ impl<'a, 'tcx> MoveData<'tcx> { match lp.kind { LpVar(..) | LpUpvar(..) => { } LpDowncast(ref b, _) | - LpExtend(ref b, _, _) => { + LpExtend(ref b, ..) => { self.add_existing_base_paths(b, result); } } diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index de28cbb7c9c96..e49011d887370 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -372,8 +372,8 @@ fn check_arms(cx: &MatchCheckCtxt, /// Checks for common cases of "catchall" patterns that may not be intended as such. fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool { match p.node { - PatKind::Binding(_, _, None) => true, - PatKind::Binding(_, _, Some(ref s)) => pat_is_catchall(dm, &s), + PatKind::Binding(.., None) => true, + PatKind::Binding(.., Some(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)), _ => false @@ -382,7 +382,7 @@ fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool { fn raw_pat(p: &Pat) -> &Pat { match p.node { - PatKind::Binding(_, _, Some(ref s)) => raw_pat(&s), + PatKind::Binding(.., Some(ref s)) => raw_pat(&s), _ => 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))], PatKind::Vec(ref before, ref slice, ref after) => match left_ty.sty { - ty::TyArray(_, _) => vec![Single], + ty::TyArray(..) => vec![Single], ty::TySlice(_) if slice.is_some() => { (before.len() + after.len()..max_slice_length+1) .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); (pat, Some(match pat.node { - PatKind::Binding(hir::BindByRef(..), _, _) => { + PatKind::Binding(hir::BindByRef(..), ..) => { pat_ty.builtin_deref(false, NoPreference).unwrap().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> { fn visit_pat(&mut self, pat: &Pat) { match pat.node { - PatKind::Binding(_, _, ref subpat) => { + PatKind::Binding(.., ref subpat) => { if !self.bindings_allowed { span_err!(self.cx.tcx.sess, pat.span, E0303, "pattern bindings are not allowed after an `@`"); diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs index a74b8848c4d6b..30e5a0cacf551 100644 --- a/src/librustc_const_eval/eval.rs +++ b/src/librustc_const_eval/eval.rs @@ -106,7 +106,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, _ => None }, Some(ast_map::NodeTraitItem(ti)) => match ti.node { - hir::ConstTraitItem(_, _) => { + hir::ConstTraitItem(..) => { if let Some(substs) = substs { // If we have a trait item and the substitutions for it, // `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 }, Some((&InlinedItem::TraitItem(trait_id, ref ti), _)) => match ti.node { - hir::ConstTraitItem(_, _) => { + hir::ConstTraitItem(..) => { used_substs = true; if let Some(substs) = substs { // 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, ..) => { Some(fn_like) } - FnKind::Method(_, m, _, _) => { + FnKind::Method(_, m, ..) => { if m.constness == hir::Constness::Const { Some(fn_like) } else { diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 6616e9579e818..3fc24bf6c54ec 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -24,6 +24,7 @@ #![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] +#![feature(dotdot_in_tuple_patterns)] #![feature(libc)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] @@ -802,7 +803,7 @@ Available lint options: let (plugin_groups, builtin_groups): (Vec<_>, _) = lint_store.get_lint_groups() .iter() .cloned() - .partition(|&(_, _, p)| p); + .partition(|&(.., p)| p); let plugin_groups = sort_lint_groups(plugin_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 \ 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, l, g) => { if l > 0 { diff --git a/src/librustc_incremental/assert_dep_graph.rs b/src/librustc_incremental/assert_dep_graph.rs index 8df8f50037118..bd96ae69ffbc8 100644 --- a/src/librustc_incremental/assert_dep_graph.rs +++ b/src/librustc_incremental/assert_dep_graph.rs @@ -196,7 +196,7 @@ fn check_paths<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let targets = match then_this_would_need.get(id) { Some(targets) => targets, None => { - for &(source_span, _, _) in sources.iter().take(1) { + for &(source_span, ..) in sources.iter().take(1) { tcx.sess.span_err( source_span, &format!("no targets for id `{}`", id)); diff --git a/src/librustc_incremental/calculate_svh/svh_visitor.rs b/src/librustc_incremental/calculate_svh/svh_visitor.rs index d4a3ab59f9cb3..3b7a97dd763d6 100644 --- a/src/librustc_incremental/calculate_svh/svh_visitor.rs +++ b/src/librustc_incremental/calculate_svh/svh_visitor.rs @@ -158,7 +158,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> { ExprCall(..) => SawExprCall, ExprMethodCall(..) => SawExprMethodCall, ExprTup(..) => SawExprTup, - ExprBinary(op, _, _) => SawExprBinary(op.node), + ExprBinary(op, ..) => SawExprBinary(op.node), ExprUnary(op, _) => SawExprUnary(op), ExprLit(ref lit) => SawExprLit(lit.node.clone()), ExprCast(..) => SawExprCast, @@ -170,7 +170,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> { ExprClosure(..) => SawExprClosure, ExprBlock(..) => SawExprBlock, ExprAssign(..) => SawExprAssign, - ExprAssignOp(op, _, _) => SawExprAssignOp(op.node), + ExprAssignOp(op, ..) => SawExprAssignOp(op.node), ExprField(_, name) => SawExprField(name.node.as_str()), ExprTupField(_, id) => SawExprTupField(id.node), 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())), ExprAgain(id) => SawExprAgain(id.map(|id| id.node.as_str())), ExprRet(..) => SawExprRet, - ExprInlineAsm(ref a,_,_) => SawExprInlineAsm(a), + ExprInlineAsm(ref a,..) => SawExprInlineAsm(a), ExprStruct(..) => SawExprStruct, ExprRepeat(..) => SawExprRepeat, } diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index 511ba8ec19cc7..c866014c76728 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -19,6 +19,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] +#![feature(dotdot_in_tuple_patterns)] #![feature(question_mark)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc_incremental/persist/fs.rs b/src/librustc_incremental/persist/fs.rs index 4ad4b115759c4..8166045be5f6f 100644 --- a/src/librustc_incremental/persist/fs.rs +++ b/src/librustc_incremental/persist/fs.rs @@ -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)>) -> FnvHashMap> { let most_recent = deletion_candidates.iter() - .map(|&(timestamp, _, _)| timestamp) + .map(|&(timestamp, ..)| timestamp) .max(); if let Some(most_recent) = most_recent { deletion_candidates.into_iter() - .filter(|&(timestamp, _, _)| timestamp != most_recent) + .filter(|&(timestamp, ..)| timestamp != most_recent) .map(|(_, path, lock)| (path, lock)) .collect() } else { diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index eb2ded45c04c5..a73930fa52517 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -72,7 +72,7 @@ impl LintPass for WhileTrue { impl LateLintPass for WhileTrue { 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 ast::LitKind::Bool(true) = lit.node { cx.span_lint(WHILE_TRUE, e.span, @@ -219,7 +219,7 @@ impl LateLintPass for UnsafeCode { FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, ..) => cx.span_lint(UNSAFE_CODE, span, "declaration of an `unsafe` function"), - FnKind::Method(_, sig, _, _) => { + FnKind::Method(_, sig, ..) => { if sig.unsafety == hir::Unsafety::Unsafe { 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); 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 to = bare_fn.sig.0.output; 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 { 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 } cx.tcx.item_name(def_id).as_str() == "transmute" diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 44f1cf7b53356..f07720f5202bd 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -334,7 +334,7 @@ impl UnusedParens { contains_exterior_struct_lit(&x) } - ast::ExprKind::MethodCall(_, _, ref exprs) => { + ast::ExprKind::MethodCall(.., ref exprs) => { // X { y: 1 }.bar(...) contains_exterior_struct_lit(&exprs[0]) } @@ -355,15 +355,15 @@ impl EarlyLintPass for UnusedParens { fn check_expr(&mut self, cx: &EarlyContext, e: &ast::Expr) { use syntax::ast::ExprKind::*; let (value, msg, struct_lit_needs_parens) = match e.node { - If(ref cond, _, _) => (cond, "`if` condition", true), - While(ref cond, _, _) => (cond, "`while` condition", true), - IfLet(_, ref cond, _, _) => (cond, "`if let` head expression", true), - WhileLet(_, ref cond, _, _) => (cond, "`while let` head expression", true), - ForLoop(_, ref cond, _, _) => (cond, "`for` head expression", true), + If(ref cond, ..) => (cond, "`if` condition", true), + While(ref cond, ..) => (cond, "`while` condition", true), + IfLet(_, ref cond, ..) => (cond, "`if let` head expression", true), + WhileLet(_, ref cond, ..) => (cond, "`while let` head expression", true), + ForLoop(_, ref cond, ..) => (cond, "`for` head expression", true), Match(ref head, _) => (head, "`match` head expression", true), Ret(Some(ref value)) => (value, "`return` 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), _ => return }; diff --git a/src/librustc_metadata/astencode.rs b/src/librustc_metadata/astencode.rs index 9d9c6f033a960..fb7e1c0f7895e 100644 --- a/src/librustc_metadata/astencode.rs +++ b/src/librustc_metadata/astencode.rs @@ -303,7 +303,7 @@ impl Folder for NestedItemsDropper { blk.and_then(|hir::Block {id, stmts, expr, rules, span, ..}| { let stmts_sans_items = stmts.into_iter().filter_map(|stmt| { let use_stmt = match stmt.node { - hir::StmtExpr(_, _) | hir::StmtSemi(_, _) => true, + hir::StmtExpr(..) | hir::StmtSemi(..) => true, hir::StmtDecl(ref decl, _) => { match decl.node { hir::DeclLocal(_) => true, diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 2524348dc1a96..7eb452ddbab11 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -490,7 +490,7 @@ impl<'a> CrateReader<'a> { // numbers let map: FnvHashMap<_, _> = decoder::get_crate_deps(cdata).iter().map(|dep| { 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, Some(&dep.hash), @@ -1003,13 +1003,13 @@ impl<'a> LocalCrateReader<'a> { if !info.should_link { return; } - let (cnum, _, _) = self.creader.resolve_crate(&None, - &info.ident, - &info.name, - None, - i.span, - PathKind::Crate, - true); + let (cnum, ..) = self.creader.resolve_crate(&None, + &info.ident, + &info.name, + None, + i.span, + PathKind::Crate, + true); let def_id = self.definitions.opt_local_def_id(i.id).unwrap(); let len = self.definitions.def_path(def_id.index).data.len(); diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index aeb95e5670d6a..6b48b4dfabcfd 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -492,7 +492,7 @@ pub fn get_adt_def<'a, 'tcx>(cdata: Cmd, variant.name, ctor_ty); 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, .. }), ..}) => { // 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 ity = tcx.lookup_item_type(def_id).ty; let fty = match ity.sty { - ty::TyFnDef(_, _, fty) => fty, + ty::TyFnDef(.., fty) => fty, _ => bug!( "the type {:?} of the method {:?} is not a function?", ity, name) diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 583631d2e0ab5..23398a0400c51 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -915,7 +915,7 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> { encode_deprecation(self.rbml_w, depr); encode_attributes(self.rbml_w, &item.attrs); } - hir::ItemConst(_, _) => { + hir::ItemConst(..) => { encode_def_id_and_key(ecx, self.rbml_w, def_id); encode_family(self.rbml_w, 'C'); self.encode_bounds_and_type_for_item(item.id); diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index c8f660a2d9c7c..8812287c34294 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -217,7 +217,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>, let kind = match expr.node { // 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) let expr = method_callee(cx, expr, ty::MethodCall::expr(expr.id)); 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 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") }; @@ -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) { Some(map::NodeExpr(expr)) => { 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"); } diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index 919b23ffda540..8dd33ad2f9c7a 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -54,7 +54,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> { let fn_like = FnLikeNode::from_node(infcx.tcx.map.get(id)); match fn_like.map(|f| f.kind()) { Some(FnKind::ItemFn(_, _, _, c, ..)) => c, - Some(FnKind::Method(_, m, _, _)) => m.constness, + Some(FnKind::Method(_, m, ..)) => m.constness, _ => hir::Constness::NotConst } } diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 751f25b279401..0bcd3e6d4ebb3 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -122,7 +122,7 @@ fn is_const_fn(tcx: TyCtxt, def_id: DefId) -> bool { Some(FnKind::ItemFn(_, _, _, c, ..)) => { c == hir::Constness::Const } - Some(FnKind::Method(_, m, _, _)) => { + Some(FnKind::Method(_, m, ..)) => { m.constness == hir::Constness::Const } _ => false @@ -576,9 +576,9 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> { Rvalue::Repeat(..) | Rvalue::UnaryOp(..) | Rvalue::CheckedBinaryOp(..) | - Rvalue::Cast(CastKind::ReifyFnPointer, _, _) | - Rvalue::Cast(CastKind::UnsafeFnPointer, _, _) | - Rvalue::Cast(CastKind::Unsize, _, _) => {} + Rvalue::Cast(CastKind::ReifyFnPointer, ..) | + Rvalue::Cast(CastKind::UnsafeFnPointer, ..) | + Rvalue::Cast(CastKind::Unsize, ..) => {} Rvalue::Len(_) => { // 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, _) => { - if let AggregateKind::Adt(def, _, _, _) = *kind { + if let AggregateKind::Adt(def, ..) = *kind { if def.has_dtor() { self.add(Qualif::NEEDS_DROP); self.deny_drop(); diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index 55bd51cd75ba9..e260b1d262aed 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -457,7 +457,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { let func_ty = func.ty(mir, tcx); debug!("check_terminator: call, func_ty={:?}", func_ty); 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); return; diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs index 6a24742426ab0..6275639a9adff 100644 --- a/src/librustc_passes/ast_validation.rs +++ b/src/librustc_passes/ast_validation.rs @@ -98,7 +98,7 @@ impl<'a> Visitor for AstValidator<'a> { fn visit_expr(&mut self, expr: &Expr) { match expr.node { - ExprKind::While(_, _, Some(ident)) | + ExprKind::While(.., Some(ident)) | ExprKind::Loop(_, Some(ident)) | ExprKind::WhileLet(.., Some(ident)) | ExprKind::ForLoop(.., Some(ident)) | diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index 3094ff49f1f59..d4e8eb51cde27 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -149,7 +149,7 @@ impl<'a, 'gcx> CheckCrateVisitor<'a, 'gcx> { let mode = match fk { FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) => Mode::ConstFn, - FnKind::Method(_, m, _, _) => { + FnKind::Method(_, m, ..) => { if m.constness == hir::Constness::Const { Mode::ConstFn } else { @@ -307,8 +307,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> { hir::DeclItem(_) => continue, } } - hir::StmtExpr(_, _) => {} - hir::StmtSemi(_, _) => {} + hir::StmtExpr(..) => {} + hir::StmtSemi(..) => {} } self.add_qualif(ConstQualif::NOT_CONST); } @@ -671,7 +671,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> { Categorization::StaticItem => { break; } - Categorization::Deref(ref cmt, _, _) | + Categorization::Deref(ref cmt, ..) | Categorization::Downcast(ref 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 // same representation as &mut 1. match cmt.ty.sty { - ty::TyArray(_, _) | + ty::TyArray(..) | ty::TySlice(_) => break, _ => {} } @@ -727,7 +727,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> { Categorization::StaticItem => { break; } - Categorization::Deref(ref cmt, _, _) | + Categorization::Deref(ref cmt, ..) | Categorization::Downcast(ref cmt, _) | Categorization::Interior(ref cmt, _) => { cur = cmt; diff --git a/src/librustc_passes/loops.rs b/src/librustc_passes/loops.rs index eab16bd5bd1b5..e942707acd56b 100644 --- a/src/librustc_passes/loops.rs +++ b/src/librustc_passes/loops.rs @@ -53,7 +53,7 @@ impl<'a, 'v> Visitor<'v> for CheckLoopVisitor<'a> { hir::ExprLoop(ref 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)); } hir::ExprBreak(_) => self.require_loop("break", e.span), diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 5e374ce7c5803..8c72933c4ce46 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -249,7 +249,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> { // The interface is empty hir::ItemDefaultImpl(..) => {} // 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() { self.reach().visit_generics(generics); 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) { let expr_ty = self.tcx.expr_ty(expr); 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, .. }), ..}) => ty, _ => expr_ty @@ -644,7 +644,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> // namespace (the contents have their own privacies). hir::ItemForeignMod(_) => {} - hir::ItemTrait(_, _, ref bounds, _) => { + hir::ItemTrait(.., ref bounds, _) => { if !self.trait_is_public(item.id) { 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 // all, or some worse estimation of whether an impl is // 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. let self_contains_private; // impl [... for] Public<...>, but not `impl [... for] @@ -1091,7 +1091,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivateItemsInPublicInterfacesVisitor<'a, 'tc hir::ItemDefaultImpl(..) => {} // An inherent impl is public when its type is public // 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); check.required_visibility = ty_vis; 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 // 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)); check.required_visibility = vis; check.visit_generics(generics); diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 98ddff70462c9..ad750ccc01299 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -228,7 +228,7 @@ impl<'b> Resolver<'b> { let def = Def::Static(self.definitions.local_def_id(item.id), mutbl); self.define(parent, name, ValueNS, (def, sp, vis)); } - ItemKind::Const(_, _) => { + ItemKind::Const(..) => { let def = Def::Const(self.definitions.local_def_id(item.id)); self.define(parent, name, ValueNS, (def, sp, vis)); } @@ -292,7 +292,7 @@ impl<'b> Resolver<'b> { self.structs.insert(item_def_id, field_names); } - ItemKind::DefaultImpl(_, _) | ItemKind::Impl(..) => {} + ItemKind::DefaultImpl(..) | ItemKind::Impl(..) => {} ItemKind::Trait(.., ref items) => { let def_id = self.definitions.local_def_id(item.id); diff --git a/src/librustc_resolve/check_unused.rs b/src/librustc_resolve/check_unused.rs index bc923ba29ca47..93abe07128fa1 100644 --- a/src/librustc_resolve/check_unused.rs +++ b/src/librustc_resolve/check_unused.rs @@ -95,7 +95,7 @@ impl<'a, 'b> Visitor for UnusedImportCheckVisitor<'a, 'b> { } ast::ItemKind::Use(ref p) => { match p.node { - ViewPathSimple(_, _) => { + ViewPathSimple(..) => { self.check_import(item.id, p.span) } diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 0a86eeef7c45b..0420fa8026884 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -381,7 +381,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>, module = path, ident = ident.node) } - Some(&ExprKind::MethodCall(ident, _, _)) => { + Some(&ExprKind::MethodCall(ident, ..)) => { format!("to call a function from the `{module}` module, \ use `{module}::{ident}(..)`", module = path, @@ -1643,7 +1643,7 @@ impl<'a> Resolver<'a> { ItemKind::DefaultImpl(_, ref 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, opt_trait_ref, &self_type, @@ -2369,7 +2369,7 @@ impl<'a> Resolver<'a> { self.record_def(pat.id, resolution); } - PatKind::TupleStruct(ref path, _, _) => { + PatKind::TupleStruct(ref path, ..) => { self.resolve_pattern_path(pat.id, None, path, ValueNS, |def| { match def { Def::Struct(..) | Def::Variant(..) => true, @@ -2388,7 +2388,7 @@ impl<'a> Resolver<'a> { }, "variant, struct or constant"); } - PatKind::Struct(ref path, _, _) => { + PatKind::Struct(ref path, ..) => { self.resolve_pattern_path(pat.id, None, path, TypeNS, |def| { match def { Def::Struct(..) | Def::Union(..) | Def::Variant(..) | @@ -2963,7 +2963,7 @@ impl<'a> Resolver<'a> { 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 // check to ensure that the path is actually a structure; that // is checked later during typeck. @@ -2985,7 +2985,7 @@ impl<'a> Resolver<'a> { 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| { let def = Def::Label(expr.id); @@ -3077,7 +3077,7 @@ impl<'a> Resolver<'a> { let traits = self.get_traits_containing_item(name.node.name); self.trait_map.insert(expr.id, traits); } - ExprKind::MethodCall(name, _, _) => { + ExprKind::MethodCall(name, ..) => { debug!("(recording candidate traits for expr) recording traits for {}", expr.id); 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 { // add the module to the lookup 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)); } } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 329527b304e3e..eaf2a8f5e7817 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -312,7 +312,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> { qualname: String::new() }.lower(self.tcx)); } - Def::Static(_, _) | + Def::Static(..) | Def::Const(_) | Def::AssociatedConst(..) | Def::Local(..) | @@ -351,7 +351,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> { let mut collector = PathCollector::new(); collector.visit_pat(&arg.pat); 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(); // get the span only for the name of the variable (I hope the path is only ever a // 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::Static(_,_) | + Def::Static(..) | Def::Const(..) | Def::AssociatedConst(..) | 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), 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), - Impl(_, _, + Impl(.., ref ty_params, ref trait_ref, 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); 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, _) => { 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))) } // FIXME(nrc) what are these doing here? - Def::Static(_, _) | + Def::Static(..) | Def::Const(..) | Def::AssociatedConst(..) => {} def => error!("unexpected definition kind when processing collected paths: {:?}", diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 559893b26facc..f69edea047e31 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -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 { ty::TyStruct(def, _) | ty::TyUnion(def, _) => { let sub_span = self.span_utils.span_for_last_ident(path.span); @@ -694,11 +694,11 @@ impl PathCollector { impl Visitor for PathCollector { fn visit_pat(&mut self, p: &ast::Pat) { match p.node { - PatKind::Struct(ref path, _, _) => { + PatKind::Struct(ref path, ..) => { self.collected_paths.push((p.id, path.clone(), ast::Mutability::Mutable, recorder::TypeRef)); } - PatKind::TupleStruct(ref path, _, _) | + PatKind::TupleStruct(ref path, ..) | PatKind::Path(_, ref path) => { self.collected_paths.push((p.id, path.clone(), ast::Mutability::Mutable, recorder::VarRef)); diff --git a/src/librustc_trans/adt.rs b/src/librustc_trans/adt.rs index 15a9d58c9b574..9eeefa079fb63 100644 --- a/src/librustc_trans/adt.rs +++ b/src/librustc_trans/adt.rs @@ -701,7 +701,7 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, debug!("adt::generic_type_of r: {:?} name: {:?} sizing: {} dst: {}", r, name, sizing, dst); match *r { - CEnum(ity, _, _) => ll_inttype(cx, ity), + CEnum(ity, ..) => ll_inttype(cx, ity), RawNullablePointer { nnty, .. } => type_of::sizing_type_of(cx, nnty), 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 { match *r { - CEnum(ity, _, _) => ity.is_signed(), + CEnum(ity, ..) => ity.is_signed(), General(ity, _) => ity.is_signed(), Univariant(..) | UntaggedUnion(..) => 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) -> ValueRef { match *r { - CEnum(ity, _, _) => { + CEnum(ity, ..) => { C_integral(ll_inttype(bcx.ccx(), ity), discr.0, true) } General(ity, _) => { diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 081b4431bd7b8..04b814e2b9772 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -1130,10 +1130,10 @@ pub unsafe fn with_llvm_pmb(llmod: ModuleRef, // inline with lifetime intrinsics, and O2+ we add an inliner with a // thresholds copied from clang. match (opt_level, opt_size, inline_threshold) { - (_, _, Some(t)) => { + (.., Some(t)) => { llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, t as u32); } - (llvm::CodeGenOptLevel::Aggressive, _, _) => { + (llvm::CodeGenOptLevel::Aggressive, ..) => { llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 275); } (_, llvm::CodeGenOptSizeDefault, _) => { @@ -1142,16 +1142,16 @@ pub unsafe fn with_llvm_pmb(llmod: ModuleRef, (_, llvm::CodeGenOptSizeAggressive, _) => { llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 25); } - (llvm::CodeGenOptLevel::None, _, _) => { + (llvm::CodeGenOptLevel::None, ..) => { llvm::LLVMRustAddAlwaysInlinePass(builder, false); } - (llvm::CodeGenOptLevel::Less, _, _) => { + (llvm::CodeGenOptLevel::Less, ..) => { llvm::LLVMRustAddAlwaysInlinePass(builder, true); } - (llvm::CodeGenOptLevel::Default, _, _) => { + (llvm::CodeGenOptLevel::Default, ..) => { llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 225); } - (llvm::CodeGenOptLevel::Other, _, _) => { + (llvm::CodeGenOptLevel::Other, ..) => { bug!("CodeGenOptLevel::Other selected") } } diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index 99126095ede3e..c94de08118089 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -924,7 +924,7 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> { block_arena: &'blk TypedArena>) -> FunctionContext<'blk, 'tcx> { let (param_substs, def_id) = match definition { - Some((instance, _, _)) => { + Some((instance, ..)) => { common::validate_substs(instance.substs); (instance.substs, Some(instance.def)) } diff --git a/src/librustc_trans/cabi_x86_64.rs b/src/librustc_trans/cabi_x86_64.rs index 805c7d345a0e7..eb67f4ca6185a 100644 --- a/src/librustc_trans/cabi_x86_64.rs +++ b/src/librustc_trans/cabi_x86_64.rs @@ -182,7 +182,7 @@ fn classify_ty(ty: Type) -> Vec { (SSEDs, SSEUp) | (SSEInt(_), SSEUp) => return, - (_, _) => newv + (..) => newv }; cls[i] = to_write; } diff --git a/src/librustc_trans/callee.rs b/src/librustc_trans/callee.rs index 33cacbe194bb0..a6b92b949e0fc 100644 --- a/src/librustc_trans/callee.rs +++ b/src/librustc_trans/callee.rs @@ -98,7 +98,7 @@ impl<'tcx> Callee<'tcx> { } 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 { return Callee { 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`, // which is the fn pointer, and `args`, which is the arguments tuple. let sig = match bare_fn_ty.sty { - ty::TyFnDef(_, _, + ty::TyFnDef(.., &ty::BareFnTy { unsafety: hir::Unsafety::Normal, abi: Abi::Rust, ref sig }) | @@ -442,7 +442,7 @@ fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, // other weird situations. Annoying. let fn_ptr_ty = match fn_ty.sty { - ty::TyFnDef(_, _, fty) => { + ty::TyFnDef(.., fty) => { // Create a fn pointer with the substituted signature. tcx.mk_fn_ptr(fty) } diff --git a/src/librustc_trans/collector.rs b/src/librustc_trans/collector.rs index b5c922d7fda4b..704fac5ce7e53 100644 --- a/src/librustc_trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -628,7 +628,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> { def_id: DefId) -> bool { 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 // always instantiated inline and don't result in // translation item. Same for FFI functions. @@ -1214,8 +1214,7 @@ fn create_trans_items_for_default_impls<'a, 'tcx>(scx: &SharedCrateContext<'a, ' hir::ItemImpl(_, _, ref generics, - _, - _, + .., ref items) => { if generics.is_type_parameterized() { return diff --git a/src/librustc_trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs index bdfeee37625e8..1bf1023dcd895 100644 --- a/src/librustc_trans/debuginfo/metadata.rs +++ b/src/librustc_trans/debuginfo/metadata.rs @@ -252,7 +252,7 @@ impl<'tcx> TypeMap<'tcx> { principal.substs, &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 } ) => { if unsafety == hir::Unsafety::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, unique_type_id, &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 discriminant_type_metadata = match *type_rep { - adt::CEnum(inttype, _, _) => { + adt::CEnum(inttype, ..) => { return FinalMetadata(discriminant_type_metadata(inttype)) }, adt::RawNullablePointer { .. } | @@ -1962,4 +1962,4 @@ pub fn extend_scope_to_file(ccx: &CrateContext, scope_metadata, file_metadata) } -} \ No newline at end of file +} diff --git a/src/librustc_trans/debuginfo/type_names.rs b/src/librustc_trans/debuginfo/type_names.rs index bd839243e201f..8291f84054d0c 100644 --- a/src/librustc_trans/debuginfo/type_names.rs +++ b/src/librustc_trans/debuginfo/type_names.rs @@ -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_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 } ) => { if unsafety == hir::Unsafety::Unsafe { output.push_str("unsafe "); diff --git a/src/librustc_trans/intrinsic.rs b/src/librustc_trans/intrinsic.rs index 8bef7584db9e2..c0ff6c508bf3e 100644 --- a/src/librustc_trans/intrinsic.rs +++ b/src/librustc_trans/intrinsic.rs @@ -544,7 +544,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, } - (_, _) => { + (..) => { let intr = match Intrinsic::find(&name) { Some(intr) => intr, None => bug!("unknown intrinsic '{}'", name), diff --git a/src/librustc_trans/mir/block.rs b/src/librustc_trans/mir/block.rs index 3ab4290e7b9b9..fbd04d7b38029 100644 --- a/src/librustc_trans/mir/block.rs +++ b/src/librustc_trans/mir/block.rs @@ -406,7 +406,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> { // Handle intrinsics old trans wants Expr's for, ourselves. 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()) } _ => None @@ -880,7 +880,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> { // FIXME #19925 Remove this hack after a release cycle. let f = Callee::def(bcx.ccx(), def_id, substs); 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 }; val = OperandRef { diff --git a/src/librustc_trans/trans_item.rs b/src/librustc_trans/trans_item.rs index deef0b09a17b0..3d85da42a6dc6 100644 --- a/src/librustc_trans/trans_item.rs +++ b/src/librustc_trans/trans_item.rs @@ -454,7 +454,7 @@ pub fn push_unique_type_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, &trait_data.projection_bounds, 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 } ) => { if unsafety == hir::Unsafety::Unsafe { output.push_str("unsafe "); diff --git a/src/librustc_typeck/check/callee.rs b/src/librustc_typeck/check/callee.rs index acb6653214dcb..49db56d2dabd9 100644 --- a/src/librustc_typeck/check/callee.rs +++ b/src/librustc_typeck/check/callee.rs @@ -186,7 +186,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let error_fn_sig; 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, ..}) => { sig } diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 54e63497e6202..1fda38d8a3305 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -319,7 +319,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { (Some(t_from), Some(t_cast)) => (t_from, t_cast), // Function item types may need to be reified before casts. (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. let res = fcx.try_coerce(self.expr, fcx.tcx.mk_fn_ptr(f)); if !res.is_ok() { diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index 365c18d5e6661..60ca9309eea00 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -195,7 +195,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> { } match a.sty { - ty::TyFnDef(_, _, a_f) => { + ty::TyFnDef(.., a_f) => { // Function items are coercible to any closure // type; function pointers are not (that would // require double indirection). diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index bde7f20f5e6e6..eb87c230b74ad 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -53,7 +53,7 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, if i_n_tps != n_tps { let span = match it.node { hir::ForeignItemFn(_, ref generics) => generics.span, - hir::ForeignItemStatic(_, _) => it.span + hir::ForeignItemStatic(..) => it.span }; struct_span_err!(tcx.sess, span, E0094, diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index be77ca435a18c..dbf74e371df45 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -501,7 +501,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> { assert!(adr.unsize.is_none()); (adr.autoderefs, None) } - Some(AutoPtr(_, _)) => { + Some(AutoPtr(..)) => { (adr.autoderefs, adr.unsize.map(|target| { target.builtin_deref(false, NoPreference) .expect("fixup: AutoPtr is not &T").ty diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index edee730086871..058049992dc00 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -1314,8 +1314,8 @@ impl<'tcx> Candidate<'tcx> { Pick { item: self.item.clone(), kind: match self.kind { - InherentImplCandidate(_, _) => InherentImplPick, - ExtensionImplCandidate(def_id, _, _) => { + InherentImplCandidate(..) => InherentImplPick, + ExtensionImplCandidate(def_id, ..) => { ExtensionImplPick(def_id) } ObjectCandidate => ObjectPick, @@ -1340,10 +1340,10 @@ impl<'tcx> Candidate<'tcx> { fn to_source(&self) -> CandidateSource { match self.kind { - InherentImplCandidate(_, _) => { + InherentImplCandidate(..) => { ImplSource(self.item.container().id()) } - ExtensionImplCandidate(def_id, _, _) => ImplSource(def_id), + ExtensionImplCandidate(def_id, ..) => ImplSource(def_id), ObjectCandidate | TraitCandidate | WhereClauseCandidate(_) => TraitSource(self.item.container().id()), diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 36c2494a00656..0aa523e9d5e47 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -536,7 +536,7 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, fn_id: ast::NodeId) { let raw_fty = ccx.tcx.lookup_item_type(ccx.tcx.map.local_def_id(fn_id)).ty; 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") }; @@ -732,7 +732,7 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) { let _indenter = indenter(); match it.node { // 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::ItemEnum(ref enum_definition, _) => { check_enum_variants(ccx, @@ -2410,7 +2410,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.tcx.types.err } else { match method_fn_ty.sty { - ty::TyFnDef(_, _, ref fty) => { + ty::TyFnDef(.., ref fty) => { // HACK(eddyb) ignore self in the definition (see above). let expected_arg_tys = self.expected_types_for_fn_args(sp, expected, fty.sig.0.output, @@ -2647,7 +2647,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { t) }, arg_ty); } - ty::TyFnDef(_, _, f) => { + ty::TyFnDef(.., f) => { let ptr_ty = self.tcx.mk_fn_ptr(f); let ptr_ty = self.resolve_type_vars_if_possible(&ptr_ty); self.type_error_message(arg.span, @@ -3983,7 +3983,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { _ => false, } } - hir::StmtExpr(_, _) | hir::StmtSemi(_, _) => true, + hir::StmtExpr(..) | hir::StmtSemi(..) => true, } { self.tcx .sess @@ -4209,7 +4209,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.tcx.prohibit_type_params(&segments[..segments.len() - poly_segments]); match def { - Def::Local(_, nid) | Def::Upvar(_, nid, _, _) => { + Def::Local(_, nid) | Def::Upvar(_, nid, ..) => { let ty = self.local_ty(span, nid); let ty = self.normalize_associated_types_in(span, &ty); self.write_ty(node_id, ty); diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index cef2bb07e35ca..939deee27c602 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -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 // instance. If so, we have to be sure that the type // 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); } - hir::ExprMethodCall(_, _, ref args) => { + hir::ExprMethodCall(.., ref args) => { self.constrain_call(expr, Some(&args[0]), 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); } - hir::ExprClosure(_, _, ref body, _) => { + hir::ExprClosure(.., ref 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| { match sub_pat.node { // `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, mutbl, sub_cmt); } @@ -1269,7 +1269,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { borrow_kind = borrow_kind; } - Categorization::Deref(_, _, mc::UnsafePtr(..)) | + Categorization::Deref(.., mc::UnsafePtr(..)) | Categorization::StaticItem | Categorization::Upvar(..) | Categorization::Local(..) | diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index a85e295784e97..f4a0df4611d33 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -283,8 +283,8 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> { debug!("adjust_upvar_borrow_kind_for_consume: guarantor={:?}", guarantor); match guarantor.cat { - Categorization::Deref(_, _, mc::BorrowedPtr(..)) | - Categorization::Deref(_, _, mc::Implicit(..)) => { + Categorization::Deref(.., mc::BorrowedPtr(..)) | + Categorization::Deref(.., mc::Implicit(..)) => { match cmt.note { mc::NoteUpvarRef(upvar_id) => { 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::Rvalue(_) | 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::Rvalue(_) | Categorization::Local(_) | diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 8eb7d34568762..6e87c29c4b363 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -112,7 +112,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> { ref trait_ref, ref self_ty, _) => { 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? 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 item_ty = fcx.instantiate_type_scheme(item.span, free_substs, &type_scheme.ty); 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"); } diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 3bd0e890bb811..4be032c6f7f09 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -201,7 +201,7 @@ impl<'cx, 'gcx, 'tcx, 'v> Visitor<'v> for WritebackCx<'cx, 'gcx, 'tcx> { self.visit_method_map_entry(ResolvingExpr(e.span), 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 { 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. 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) => { self.free_to_bound_regions[&def_id] } diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index 70682bb8c8f35..d2b7f07b9ce6c 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -86,7 +86,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> { TyBool | TyChar | TyInt(..) | TyUint(..) | TyFloat(..) | TyStr | TyArray(..) | TySlice(..) | TyFnDef(..) | TyFnPtr(_) | TyTuple(..) | TyParam(..) | TyError | TyNever | - TyRawPtr(_) | TyRef(_, _) | TyProjection(..) => { + TyRawPtr(_) | TyRef(..) | TyProjection(..) => { None } diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index a012fd418cac6..fcc0b09e31acf 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -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), Some(trait_ref)); } - hir::ItemImpl(_, _, + hir::ItemImpl(.., ref generics, ref opt_trait_ref, ref selfty, @@ -1456,7 +1456,7 @@ fn generics_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, generics } - ItemTrait(_, ref generics, _, _) => { + ItemTrait(_, ref generics, ..) => { // Add in the self type parameter. // // 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) { NodeItem(item) => { match item.node { - ItemStatic(ref t, _, _) | ItemConst(ref t, _) => { + ItemStatic(ref t, ..) | ItemConst(ref t, _) => { ccx.icx(&()).to_ty(&ElidableRscope::new(ty::ReStatic), &t) } ItemFn(ref decl, unsafety, _, abi, ref generics, _) => { diff --git a/src/librustc_typeck/variance/constraints.rs b/src/librustc_typeck/variance/constraints.rs index 24eb29f45a5e5..1e38f464651b9 100644 --- a/src/librustc_typeck/variance/constraints.rs +++ b/src/librustc_typeck/variance/constraints.rs @@ -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, .. }) => { self.add_constraints_from_sig(generics, sig, variance); } diff --git a/src/librustc_typeck/variance/terms.rs b/src/librustc_typeck/variance/terms.rs index 1238f7cbcb335..577a47a35e125 100644 --- a/src/librustc_typeck/variance/terms.rs +++ b/src/librustc_typeck/variance/terms.rs @@ -238,7 +238,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> { hir::ItemUnion(_, ref 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 // constrained to be invariant. See `visit_item` in // the impl for `ConstraintContext` in `constraints.rs`. diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index b7e371e23f323..18c12f98fb428 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -180,7 +180,7 @@ fn build_external_function<'a, 'tcx>(cx: &DocContext, tcx: TyCtxt<'a, 'tcx, 'tcx did: DefId) -> clean::Function { let t = tcx.lookup_item_type(did); 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"), }; diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index f8ec5a55e7d4c..4bab79ea8a99b 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -642,7 +642,7 @@ fn external_path_params(cx: &DocContext, trait_did: Option, has_self: boo output: output } }, - (_, _) => { + (..) => { PathParameters::AngleBracketed { lifetimes: lifetimes, types: types.clean(cx), @@ -717,7 +717,7 @@ impl<'tcx> Clean for ty::TraitRef<'tcx> { if let ty::TyTuple(ts) = ty_s.sty { for &ty_s in ts { 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); if let Some(lt) = reg.clean(cx) { late_bounds.push(lt); @@ -1794,7 +1794,7 @@ impl<'tcx> Clean for ty::Ty<'tcx> { mutability: mt.mutbl.clean(cx), type_: box mt.ty.clean(cx), }, - ty::TyFnDef(_, _, ref fty) | + ty::TyFnDef(.., ref fty) | ty::TyFnPtr(ref fty) => BareFunction(box BareFunctionDecl { unsafety: fty.unsafety, generics: Generics { @@ -2699,7 +2699,7 @@ fn name_from_pat(p: &hir::Pat) -> String { match p.node { PatKind::Wild => "_".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, \ which is not allowed in function arguments"), PatKind::Struct(ref name, ref fields, etc) => { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 6f66ce88df7a5..61b80be969980 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1891,7 +1891,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec 0 => format!(" (#{})", Escape(&tracker_url), issue_no, issue_no), - (true, _, _) => + (true, ..) => format!(" ({})", Escape(&stab.feature)), _ => String::new(), } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 0e685f063bd7b..cc5cdf9f4e74c 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -20,6 +20,7 @@ #![feature(box_patterns)] #![feature(box_syntax)] +#![feature(dotdot_in_tuple_patterns)] #![feature(libc)] #![feature(rustc_private)] #![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)); for pass in &passes { let plugin = match PASSES.iter() - .position(|&(p, _, _)| { + .position(|&(p, ..)| { p == *pass }) { Some(i) => PASSES[i].1, diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs index 31b71dbc80b62..b5b344e8d5f24 100644 --- a/src/libserialize/hex.rs +++ b/src/libserialize/hex.rs @@ -82,7 +82,7 @@ impl fmt::Display for FromHexError { impl error::Error for FromHexError { fn description(&self) -> &str { match *self { - InvalidHexCharacter(_, _) => "invalid character", + InvalidHexCharacter(..) => "invalid character", InvalidHexLength => "invalid length", } } diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 9a5b1da0f08f4..0a9c77f253848 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -332,7 +332,7 @@ impl<'a> Prefix<'a> { pub fn is_verbatim(&self) -> bool { use self::Prefix::*; match *self { - Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(_, _) => true, + Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(..) => true, _ => false, } } diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index bbd3345144585..105f911dd575c 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -561,7 +561,7 @@ impl Pat { } PatKind::Wild | PatKind::Lit(_) | - PatKind::Range(_, _) | + PatKind::Range(..) | PatKind::Ident(..) | PatKind::Path(..) | PatKind::Mac(_) => { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 7db03e9a8634a..b0696a986e3c0 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -156,7 +156,7 @@ pub fn count_names(ms: &[TokenTree]) -> usize { TokenTree::Token(_, MatchNt(..)) => { 1 } - TokenTree::Token(_, _) => 0, + TokenTree::Token(..) => 0, } }) } @@ -231,7 +231,7 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc]) TokenTree::Token(sp, SubstNt(..)) => { return Err((sp, "missing fragment specifier".to_string())) } - TokenTree::Token(_, _) => (), + TokenTree::Token(..) => (), } Ok(()) diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index dc0fb02ea45d9..ff01d37581544 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -180,7 +180,7 @@ impl Token { Ident(..) => true, Underscore => true, Tilde => true, - Literal(_, _) => true, + Literal(..) => true, Not => true, BinOp(Minus) => true, BinOp(Star) => true, @@ -202,8 +202,8 @@ impl Token { /// Returns `true` if the token is any literal pub fn is_lit(&self) -> bool { match *self { - Literal(_, _) => true, - _ => false, + Literal(..) => true, + _ => false, } } diff --git a/src/libsyntax_ext/asm.rs b/src/libsyntax_ext/asm.rs index 6f368e1bc6f06..77425b809de1d 100644 --- a/src/libsyntax_ext/asm.rs +++ b/src/libsyntax_ext/asm.rs @@ -233,7 +233,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, p.bump(); state = st; } - (&token::Eof, _, _) => break 'statement, + (&token::Eof, ..) => break 'statement, _ => break, } } diff --git a/src/libsyntax_ext/deriving/debug.rs b/src/libsyntax_ext/deriving/debug.rs index b974699003b97..f367fed9cc2ce 100644 --- a/src/libsyntax_ext/deriving/debug.rs +++ b/src/libsyntax_ext/deriving/debug.rs @@ -78,7 +78,7 @@ fn show_substructure(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P { + EnumMatching(.., ref fields) => { let mut stmts = vec![]; if !is_struct { // tuple struct/"normal" variant diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index b37d533298399..600f5d335c472 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -976,7 +976,7 @@ impl<'a> MethodDef<'a> { other: other_fields.iter_mut() .map(|l| { match l.next().unwrap() { - (_, _, ex, _) => ex, + (.., ex, _) => ex, } }) .collect(), @@ -1527,7 +1527,7 @@ impl<'a> TraitDef<'a> { VariantData::Struct(..) => { let field_pats = subpats.into_iter() .zip(&ident_exprs) - .map(|(pat, &(sp, ident, _, _))| { + .map(|(pat, &(sp, ident, ..))| { if ident.is_none() { cx.span_bug(sp, "a braced struct with unnamed fields in `derive`"); } @@ -1583,7 +1583,7 @@ pub fn cs_fold(use_foldl: bool, where F: FnMut(&mut ExtCtxt, Span, P, P, &[P]) -> P { match *substructure.fields { - EnumMatching(_, _, ref all_fields) | + EnumMatching(.., ref all_fields) | Struct(_, ref all_fields) => { if use_foldl { all_fields.iter().fold(base, |old, field| { @@ -1623,7 +1623,7 @@ pub fn cs_same_method(f: F, where F: FnOnce(&mut ExtCtxt, Span, Vec>) -> P { match *substructure.fields { - EnumMatching(_, _, ref all_fields) | + EnumMatching(.., ref all_fields) | Struct(_, ref all_fields) => { // call self_n.method(other_1_n, other_2_n, ...) let called = all_fields.iter() diff --git a/src/libsyntax_ext/deriving/hash.rs b/src/libsyntax_ext/deriving/hash.rs index 0941ebca868e3..97d7f2ce8003e 100644 --- a/src/libsyntax_ext/deriving/hash.rs +++ b/src/libsyntax_ext/deriving/hash.rs @@ -82,7 +82,7 @@ fn hash_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) let fields = match *substr.fields { Struct(_, ref fs) => fs, - EnumMatching(_, _, ref fs) => { + EnumMatching(.., ref fs) => { let variant_value = deriving::call_intrinsic(cx, trait_span, "discriminant_value", diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 4bae9ec5a1a1f..2065d92fd6ed7 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -19,6 +19,7 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_macro_lib)] #![feature(rustc_macro_internals)] #![feature(rustc_private)] diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs index fbc6bfb6c8d9f..bd5ab92e8b078 100644 --- a/src/libterm/terminfo/parm.rs +++ b/src/libterm/terminfo/parm.rs @@ -199,7 +199,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) -> Result { + _ => { return Err("first two params not numbers with %i".to_string()) } } diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs index 7a1c200ba20e8..3f36ebe649234 100644 --- a/src/test/run-make/save-analysis/foo.rs +++ b/src/test/run-make/save-analysis/foo.rs @@ -10,9 +10,9 @@ #![ crate_name = "test" ] #![feature(box_syntax)] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_private)] - extern crate graphviz; // A simple rust project @@ -206,7 +206,7 @@ fn matchSomeEnum(val: SomeEnum) { match val { SomeEnum::Ints(int1, int2) => { println(&(int1+int2).to_string()); } SomeEnum::Floats(float1, float2) => { println(&(float2*float1).to_string()); } - SomeEnum::Strings(_, _, s3) => { println(s3); } + SomeEnum::Strings(.., s3) => { println(s3); } SomeEnum::MyTypes(mt1, mt2) => { println(&(mt1.field1 - mt2.field1).to_string()); } } } @@ -225,7 +225,7 @@ fn matchSomeStructEnum2(se: SomeStructEnum) { match se { EnumStruct{a: ref aaa, ..} => println(&aaa.to_string()), EnumStruct2{f1, f2: f2} => println(&f1.field1.to_string()), - EnumStruct3{f1, f3: SomeEnum::Ints(_, _), f2} => println(&f1.field1.to_string()), + EnumStruct3{f1, f3: SomeEnum::Ints(..), f2} => println(&f1.field1.to_string()), _ => {}, } } @@ -435,4 +435,4 @@ fn test_format_args() { print!("Hello {0}", name); print!("{0} + {} = {}", x, y); print!("x is {}, y is {1}, name is {n}", x, y, n = name); -} \ No newline at end of file +} diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs index c6174745bfc06..5df95ba5facbf 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs @@ -12,6 +12,7 @@ #![feature(plugin_registrar)] #![feature(box_syntax)] +#![feature(dotdot_in_tuple_patterns)] #![feature(rustc_private)] extern crate syntax; @@ -75,7 +76,7 @@ fn expand(cx: &mut ExtCtxt, fn totalsum_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> P { let fields = match *substr.fields { - Struct(_, ref fs) | EnumMatching(_, _, ref fs) => fs, + Struct(_, ref fs) | EnumMatching(.., ref fs) => fs, _ => cx.span_bug(trait_span, "impossible substructure") };