diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-11-28 12:22:53 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-11-28 20:27:56 -0800 |
| commit | ab387a68388974a432951e806851936898907fd0 (patch) | |
| tree | 0fbc659520f9575f934dd952318cb4b6e85fb911 /src/libsyntax | |
| parent | 859c3baf64c167730f4214a736f72a5e2e86d7d9 (diff) | |
| download | rust-ab387a68388974a432951e806851936898907fd0.tar.gz rust-ab387a68388974a432951e806851936898907fd0.zip | |
Register new snapshots
Diffstat (limited to 'src/libsyntax')
28 files changed, 138 insertions, 143 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 6e73c6abd0b..7bde8083b50 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -618,7 +618,7 @@ pub enum token_tree { // a kleene-style repetition sequence with a span, a tt_forest, // an optional separator, and a boolean where true indicates - // zero or more (*), and false indicates one or more (+). + // zero or more (..), and false indicates one or more (+). tt_seq(Span, @~[token_tree], Option<::parse::token::Token>, bool), // a syntactic variable that will be filled in by macro expansion. diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 32b270643af..aed6af3d7ed 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -226,7 +226,7 @@ impl Ctx { } visit::walk_fn(self, fk, decl, body, sp, id, ()); match *fk { - visit::fk_method(*) => { self.path.pop(); } + visit::fk_method(..) => { self.path.pop(); } _ => {} } } @@ -338,7 +338,7 @@ impl Visitor<()> for Ctx { item_mod(_) | item_foreign_mod(_) => { self.path.push(path_mod(i.ident)); } - item_impl(*) => {} // this was guessed above. + item_impl(..) => {} // this was guessed above. _ => self.path.push(path_name(i.ident)) } visit::walk_item(self, i, ()); @@ -407,7 +407,7 @@ pub fn map_decoded_item(diag: @mut span_handler, // don't decode and instantiate the impl, but just the method, we have to // add it to the table now. Likewise with foreign items. match *ii { - ii_item(*) => {} // fallthrough + ii_item(..) => {} // fallthrough ii_foreign(i) => { cx.map.insert(i.id, node_foreign_item(i, AbiSet::Intrinsic(), @@ -431,16 +431,16 @@ pub fn node_id_to_str(map: map, id: NodeId, itr: @ident_interner) -> ~str { Some(&node_item(item, path)) => { let path_str = path_ident_to_str(path, item.ident, itr); let item_str = match item.node { - item_static(*) => ~"static", - item_fn(*) => ~"fn", - item_mod(*) => ~"mod", - item_foreign_mod(*) => ~"foreign mod", - item_ty(*) => ~"ty", - item_enum(*) => ~"enum", - item_struct(*) => ~"struct", - item_trait(*) => ~"trait", - item_impl(*) => ~"impl", - item_mac(*) => ~"macro" + item_static(..) => ~"static", + item_fn(..) => ~"fn", + item_mod(..) => ~"mod", + item_foreign_mod(..) => ~"foreign mod", + item_ty(..) => ~"ty", + item_enum(..) => ~"enum", + item_struct(..) => ~"struct", + item_trait(..) => ~"trait", + item_impl(..) => ~"impl", + item_mac(..) => ~"macro" }; format!("{} {} (id={})", item_str, path_str, id) } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 07380de9381..dcb15ad85df 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -45,7 +45,7 @@ pub fn stmt_id(s: &Stmt) -> NodeId { StmtDecl(_, id) => id, StmtExpr(_, id) => id, StmtSemi(_, id) => id, - StmtMac(*) => fail!("attempted to analyze unexpanded stmt") + StmtMac(..) => fail!("attempted to analyze unexpanded stmt") } } @@ -194,7 +194,7 @@ pub fn float_ty_to_str(t: float_ty) -> ~str { } pub fn is_call_expr(e: @Expr) -> bool { - match e.node { ExprCall(*) => true, _ => false } + match e.node { ExprCall(..) => true, _ => false } } pub fn block_from_expr(e: @Expr) -> Block { @@ -338,7 +338,7 @@ impl inlined_item_utils for inlined_item { referring to a def_self */ pub fn is_self(d: ast::Def) -> bool { match d { - DefSelf(*) => true, + DefSelf(..) => true, DefUpvar(_, d, _, _) => is_self(*d), _ => false } @@ -537,8 +537,8 @@ impl<'self, O: IdVisitingOperation> Visitor<()> for IdVisitor<'self, O> { env: ()) { if !self.pass_through_items { match *function_kind { - visit::fk_method(*) if self.visited_outermost => return, - visit::fk_method(*) => self.visited_outermost = true, + visit::fk_method(..) if self.visited_outermost => return, + visit::fk_method(..) => self.visited_outermost = true, _ => {} } } @@ -570,7 +570,7 @@ impl<'self, O: IdVisitingOperation> Visitor<()> for IdVisitor<'self, O> { if !self.pass_through_items { match *function_kind { - visit::fk_method(*) => self.visited_outermost = false, + visit::fk_method(..) => self.visited_outermost = false, _ => {} } } @@ -631,7 +631,7 @@ pub fn compute_id_range_for_inlined_item(item: &inlined_item) -> id_range { pub fn is_item_impl(item: @ast::item) -> bool { match item.node { - item_impl(*) => true, + item_impl(..) => true, _ => false } } @@ -706,7 +706,7 @@ pub fn struct_def_is_tuple_like(struct_def: &ast::struct_def) -> bool { /// and false otherwise. pub fn pat_is_ident(pat: @ast::Pat) -> bool { match pat.node { - ast::PatIdent(*) => true, + ast::PatIdent(..) => true, _ => false, } } diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index ecde00aa302..05a65de16b8 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -459,8 +459,8 @@ impl IntType { #[inline] pub fn is_signed(self) -> bool { match self { - SignedInt(*) => true, - UnsignedInt(*) => false + SignedInt(..) => true, + UnsignedInt(..) => false } } fn is_ffi_safe(self) -> bool { diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index deaa821cd45..a773fe8497c 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -340,7 +340,7 @@ impl ExtCtxt { pub fn expand_expr(@self, mut e: @ast::Expr) -> @ast::Expr { loop { match e.node { - ast::ExprMac(*) => { + ast::ExprMac(..) => { let extsbox = @mut syntax_expander_table(); let expander = expand::MacroExpander { extsbox: extsbox, @@ -358,7 +358,7 @@ impl ExtCtxt { pub fn cfg(&self) -> ast::CrateConfig { self.cfg.clone() } pub fn call_site(&self) -> Span { match *self.backtrace { - Some(@ExpnInfo {call_site: cs, _}) => cs, + Some(@ExpnInfo {call_site: cs, ..}) => cs, None => self.bug("missing top span") } } @@ -381,7 +381,7 @@ impl ExtCtxt { pub fn bt_pop(&self) { match *self.backtrace { Some(@ExpnInfo { - call_site: Span {expn_info: prev, _}, _}) => { + call_site: Span {expn_info: prev, ..}, ..}) => { *self.backtrace = prev } _ => self.bug("tried to pop without a push") diff --git a/src/libsyntax/ext/concat.rs b/src/libsyntax/ext/concat.rs index a89e8d261fe..11e316e3e6b 100644 --- a/src/libsyntax/ext/concat.rs +++ b/src/libsyntax/ext/concat.rs @@ -44,7 +44,7 @@ pub fn expand_syntax_ext(cx: @base::ExtCtxt, ast::lit_bool(b) => { accumulator.push_str(format!("{}", b)); } - ast::lit_binary(*) => { + ast::lit_binary(..) => { cx.span_err(e.span, "cannot concatenate a binary literal"); } } diff --git a/src/libsyntax/ext/deriving/clone.rs b/src/libsyntax/ext/deriving/clone.rs index 6dd358144a4..0f83f725223 100644 --- a/src/libsyntax/ext/deriving/clone.rs +++ b/src/libsyntax/ext/deriving/clone.rs @@ -87,16 +87,16 @@ fn cs_clone( ctor_ident = variant.node.name; all_fields = af; }, - EnumNonMatching(*) => cx.span_bug(span, + EnumNonMatching(..) => cx.span_bug(span, format!("Non-matching enum variants in `deriving({})`", name)), - StaticEnum(*) | StaticStruct(*) => cx.span_bug(span, + StaticEnum(..) | StaticStruct(..) => cx.span_bug(span, format!("Static method in `deriving({})`", name)) } match *all_fields { - [FieldInfo { name: None, _ }, .. _] => { + [FieldInfo { name: None, .. }, ..] => { // enum-like let subcalls = all_fields.map(|field| subcall(field.self_)); cx.expr_call_ident(span, ctor_ident, subcalls) diff --git a/src/libsyntax/ext/deriving/default.rs b/src/libsyntax/ext/deriving/default.rs index 015083f11d3..3ecdd5e60fe 100644 --- a/src/libsyntax/ext/deriving/default.rs +++ b/src/libsyntax/ext/deriving/default.rs @@ -67,7 +67,7 @@ fn default_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Exp } } } - StaticEnum(*) => { + StaticEnum(..) => { cx.span_fatal(span, "`Default` cannot be derived for enums, \ only structs") } diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 614c719e0a2..e882650f046 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -1087,7 +1087,7 @@ pub fn cs_fold(use_foldl: bool, EnumNonMatching(ref all_enums) => enum_nonmatch_f(cx, trait_span, *all_enums, substructure.nonself_args), - StaticEnum(*) | StaticStruct(*) => { + StaticEnum(..) | StaticStruct(..) => { cx.span_bug(trait_span, "Static function in `deriving`") } } @@ -1125,7 +1125,7 @@ pub fn cs_same_method(f: |@ExtCtxt, Span, ~[@Expr]| -> @Expr, EnumNonMatching(ref all_enums) => enum_nonmatch_f(cx, trait_span, *all_enums, substructure.nonself_args), - StaticEnum(*) | StaticStruct(*) => { + StaticEnum(..) | StaticStruct(..) => { cx.span_bug(trait_span, "Static function in `deriving`") } } diff --git a/src/libsyntax/ext/deriving/iter_bytes.rs b/src/libsyntax/ext/deriving/iter_bytes.rs index 7e3debd7967..f291d2b751d 100644 --- a/src/libsyntax/ext/deriving/iter_bytes.rs +++ b/src/libsyntax/ext/deriving/iter_bytes.rs @@ -82,7 +82,7 @@ fn iter_bytes_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @ _ => cx.span_bug(span, "Impossible substructure in `deriving(IterBytes)`") } - for &FieldInfo { self_, _ } in fields.iter() { + for &FieldInfo { self_, .. } in fields.iter() { exprs.push(call_iterbytes(self_)); } diff --git a/src/libsyntax/ext/deriving/primitive.rs b/src/libsyntax/ext/deriving/primitive.rs index 77b0d913dcd..b26a3a09f04 100644 --- a/src/libsyntax/ext/deriving/primitive.rs +++ b/src/libsyntax/ext/deriving/primitive.rs @@ -69,7 +69,7 @@ fn cs_from(name: &str, cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr }; match *substr.fields { - StaticStruct(*) => { + StaticStruct(..) => { cx.span_err(span, "`FromPrimitive` cannot be derived for structs"); return cx.expr_fail(span, @""); } diff --git a/src/libsyntax/ext/deriving/to_str.rs b/src/libsyntax/ext/deriving/to_str.rs index 26f4668ccfd..193dc4965fc 100644 --- a/src/libsyntax/ext/deriving/to_str.rs +++ b/src/libsyntax/ext/deriving/to_str.rs @@ -66,7 +66,7 @@ fn to_str_substructure(cx: @ExtCtxt, span: Span, stmts.push(cx.stmt_expr(call)); }; - for (i, &FieldInfo {name, span, self_, _}) in fields.iter().enumerate() { + for (i, &FieldInfo {name, span, self_, .. }) in fields.iter().enumerate() { if i > 0 { push(cx.expr_str(span, @", ")); } @@ -96,9 +96,9 @@ fn to_str_substructure(cx: @ExtCtxt, span: Span, EnumMatching(_, variant, ref fields) => { match variant.node.kind { - ast::tuple_variant_kind(*) => + ast::tuple_variant_kind(..) => doit("(", @")", variant.node.name, *fields), - ast::struct_variant_kind(*) => + ast::struct_variant_kind(..) => doit("{", @"}", variant.node.name, *fields), } } diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs index eb957e80835..af6379d476e 100644 --- a/src/libsyntax/ext/deriving/ty.rs +++ b/src/libsyntax/ext/deriving/ty.rs @@ -182,8 +182,8 @@ impl<'self> Ty<'self> { Literal(ref p) => { p.to_path(cx, span, self_ty, self_generics) } - Ptr(*) => { cx.span_bug(span, "Pointer in a path in generic `deriving`") } - Tuple(*) => { cx.span_bug(span, "Tuple in a path in generic `deriving`") } + Ptr(..) => { cx.span_bug(span, "Pointer in a path in generic `deriving`") } + Tuple(..) => { cx.span_bug(span, "Tuple in a path in generic `deriving`") } } } } diff --git a/src/libsyntax/ext/deriving/zero.rs b/src/libsyntax/ext/deriving/zero.rs index a37cb586f59..1fdb4131689 100644 --- a/src/libsyntax/ext/deriving/zero.rs +++ b/src/libsyntax/ext/deriving/zero.rs @@ -83,7 +83,7 @@ fn zero_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr { } } } - StaticEnum(*) => { + StaticEnum(..) => { cx.span_fatal(span, "`Zero` cannot be derived for enums, \ only structs") } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 45f82d9b3a9..85839691b48 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -313,7 +313,7 @@ pub fn expand_item(extsbox: @mut SyntaxEnv, fld: &MacroExpander) -> SmallVector<@ast::item> { match it.node { - ast::item_mac(*) => expand_item_mac(extsbox, cx, it, fld), + ast::item_mac(..) => expand_item_mac(extsbox, cx, it, fld), ast::item_mod(_) | ast::item_foreign_mod(_) => { cx.mod_push(it.ident); let macro_escape = contains_macro_escape(it.attrs); @@ -342,7 +342,7 @@ pub fn expand_item_mac(extsbox: @mut SyntaxEnv, let (pth, tts, ctxt) = match it.node { item_mac(codemap::Spanned { node: mac_invoc_tt(ref pth, ref tts, ctxt), - _ + .. }) => { (pth, (*tts).clone(), ctxt) } @@ -430,8 +430,8 @@ fn insert_macro(exts: SyntaxEnv, name: ast::Name, transformer: @Transformer) { let is_non_escaping_block = |t : &@Transformer| -> bool{ match t { - &@BlockInfo(BlockInfo {macros_escape:false,_}) => true, - &@BlockInfo(BlockInfo {_}) => false, + &@BlockInfo(BlockInfo {macros_escape:false,..}) => true, + &@BlockInfo(BlockInfo {..}) => false, _ => fail!("special identifier {:?} was bound to a non-BlockInfo", special_block_name) } @@ -1400,7 +1400,7 @@ mod test { visit::walk_crate(&mut path_finder, &renamed_ast, ()); match path_finder.path_accumulator { - [ast::Path{segments:[ref seg],_}] => + [ast::Path{segments:[ref seg],..}] => assert_eq!(mtwt_resolve(seg.identifier),a2_name), _ => assert_eq!(0,1) } @@ -1415,7 +1415,7 @@ mod test { let mut path_finder = new_path_finder(~[]); visit::walk_crate(&mut path_finder, &double_renamed, ()); match path_finder.path_accumulator { - [ast::Path{segments:[ref seg],_}] => + [ast::Path{segments:[ref seg],..}] => assert_eq!(mtwt_resolve(seg.identifier),a3_name), _ => assert_eq!(0,1) } diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 1c0930f984a..c7354b0601c 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -125,7 +125,7 @@ impl Context { /// format strings. fn verify_piece(&mut self, p: &parse::Piece) { match *p { - parse::String(*) => {} + parse::String(..) => {} parse::CurrentArgument => { if self.nest_level == 0 { self.ecx.span_err(self.fmtsp, @@ -173,7 +173,7 @@ impl Context { fn verify_count(&mut self, c: parse::Count) { match c { - parse::CountImplied | parse::CountIs(*) => {} + parse::CountImplied | parse::CountIs(..) => {} parse::CountIsParam(i) => { self.verify_arg_type(Left(i), Unsigned); } diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index d10ec422987..fe7699f36bb 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -553,7 +553,7 @@ fn mk_tt(cx: @ExtCtxt, sp: Span, tt: &ast::token_tree) } ast::tt_delim(ref tts) => mk_tts(cx, sp, **tts), - ast::tt_seq(*) => fail!("tt_seq in quote!"), + ast::tt_seq(..) => fail!("tt_seq in quote!"), ast::tt_nonterminal(sp, ident) => { diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 5a37e0a5ab3..c0c5c6c6c07 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -128,13 +128,13 @@ pub fn expand_include_bin(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree]) // recur along an ExpnInfo chain to find the original expression fn topmost_expn_info(expn_info: @codemap::ExpnInfo) -> @codemap::ExpnInfo { match *expn_info { - ExpnInfo { call_site: ref call_site, _ } => { + ExpnInfo { call_site: ref call_site, .. } => { match call_site.expn_info { Some(next_expn_info) => { match *next_expn_info { ExpnInfo { - callee: NameAndSpan { name: ref name, _ }, - _ + callee: NameAndSpan { name: ref name, .. }, + .. } => { // Don't recurse into file using "include!" if "include" == *name { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 3e877d29300..3da2eac1a3d 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -193,8 +193,8 @@ pub fn nameize(p_s: @mut ParseSess, ms: &[matcher], res: &[@named_match]) fn n_rec(p_s: @mut ParseSess, m: &matcher, res: &[@named_match], ret_val: &mut HashMap<Ident, @named_match>) { match *m { - codemap::Spanned {node: match_tok(_), _} => (), - codemap::Spanned {node: match_seq(ref more_ms, _, _, _, _), _} => { + codemap::Spanned {node: match_tok(_), .. } => (), + codemap::Spanned {node: match_seq(ref more_ms, _, _, _, _), .. } => { for next_m in more_ms.iter() { n_rec(p_s, next_m, res, ret_val) }; diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 1bcfbcf7ab2..58a114a2de0 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -156,7 +156,7 @@ fn lockstep_iter_size(t: &token_tree, r: &mut TtReader) -> lis { lis_merge(lis, lis2) }) } - tt_tok(*) => lis_unconstrained, + tt_tok(..) => lis_unconstrained, tt_nonterminal(_, name) => match *lookup_cur_matched(r, name) { matched_nonterminal(_) => lis_unconstrained, matched_seq(ref ads, _) => lis_constraint(ads.len(), name) @@ -290,7 +290,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { r.stack.idx += 1u; return ret_val; } - matched_seq(*) => { + matched_seq(..) => { r.sp_diag.span_fatal( r.cur_span, /* blame the macro writer */ format!("variable '{}' is still repeating at this depth", diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 5b12e8b8eb1..351eab35a77 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -22,8 +22,6 @@ #[crate_type = "lib"]; #[feature(macro_rules, globs, managed_boxes)]; -#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot -#[allow(cstack)]; // NOTE: remove after the next snapshot. extern mod extra; diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 9030b4394e4..18e45a20fed 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -35,7 +35,7 @@ impl parser_attr for Parser { debug!("parse_outer_attributes: self.token={:?}", self.token); match *self.token { - token::INTERPOLATED(token::nt_attr(*)) => { + token::INTERPOLATED(token::nt_attr(..)) => { attrs.push(self.parse_attribute(false)); } token::POUND => { @@ -121,7 +121,7 @@ impl parser_attr for Parser { let mut next_outer_attrs: ~[ast::Attribute] = ~[]; loop { let attr = match *self.token { - token::INTERPOLATED(token::nt_attr(*)) => { + token::INTERPOLATED(token::nt_attr(..)) => { self.parse_attribute(true) } token::POUND => { @@ -164,7 +164,7 @@ impl parser_attr for Parser { // FIXME #623 Non-string meta items are not serialized correctly; // just forbid them for now match lit.node { - ast::lit_str(*) => (), + ast::lit_str(..) => (), _ => { self.span_err( lit.span, diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index a4df5f4a5fc..81b98e537f4 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -23,12 +23,12 @@ use ast; // isn't parsed as (if true {...} else {...} | x) | 5 pub fn expr_requires_semi_to_be_stmt(e: @ast::Expr) -> bool { match e.node { - ast::ExprIf(*) - | ast::ExprMatch(*) + ast::ExprIf(..) + | ast::ExprMatch(..) | ast::ExprBlock(_) - | ast::ExprWhile(*) - | ast::ExprLoop(*) - | ast::ExprForLoop(*) + | ast::ExprWhile(..) + | ast::ExprLoop(..) + | ast::ExprForLoop(..) | ast::ExprCall(_, _, ast::DoSugar) | ast::ExprCall(_, _, ast::ForSugar) | ast::ExprMethodCall(_, _, _, _, _, ast::DoSugar) @@ -40,7 +40,7 @@ pub fn expr_requires_semi_to_be_stmt(e: @ast::Expr) -> bool { pub fn expr_is_simple_block(e: @ast::Expr) -> bool { match e.node { ast::ExprBlock( - ast::Block { rules: ast::DefaultBlock, _ } + ast::Block { rules: ast::DefaultBlock, .. } ) => true, _ => false } @@ -58,7 +58,7 @@ pub fn stmt_ends_with_semi(stmt: &ast::Stmt) -> bool { } } ast::StmtExpr(e, _) => { expr_requires_semi_to_be_stmt(e) } - ast::StmtSemi(*) => { false } - ast::StmtMac(*) => { false } + ast::StmtSemi(..) => { false } + ast::StmtMac(..) => { false } } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index fab0de4179e..3e4a421cfba 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -447,7 +447,7 @@ impl Parser { pub fn commit_expr(&self, e: @Expr, edible: &[token::Token], inedible: &[token::Token]) { debug!("commit_expr {:?}", e); match e.node { - ExprPath(*) => { + ExprPath(..) => { // might be unit-struct construction; check for recoverableinput error. let expected = vec::append(edible.to_owned(), inedible); self.check_for_erroneous_unit_struct_expecting(expected); @@ -486,7 +486,7 @@ impl Parser { self.bump(); i } - token::INTERPOLATED(token::nt_ident(*)) => { + token::INTERPOLATED(token::nt_ident(..)) => { self.bug("ident interpolation not converted to real token"); } _ => { @@ -835,7 +835,7 @@ impl Parser { pub fn token_is_lifetime(&self, tok: &token::Token) -> bool { match *tok { - token::LIFETIME(*) => true, + token::LIFETIME(..) => true, _ => false, } } @@ -1280,13 +1280,13 @@ impl Parser { -> ty_ { // ~'foo fn() or ~fn() are parsed directly as obsolete fn types: match *self.token { - token::LIFETIME(*) => { + token::LIFETIME(..) => { let lifetime = self.parse_lifetime(); self.obsolete(*self.last_span, ObsoleteBoxedClosure); return self.parse_ty_closure(Some(sigil), Some(lifetime)); } - token::IDENT(*) => { + token::IDENT(..) => { if self.token_is_old_style_closure_keyword() { self.obsolete(*self.last_span, ObsoleteBoxedClosure); return self.parse_ty_closure(Some(sigil), None); @@ -1574,7 +1574,7 @@ impl Parser { /// parses 0 or 1 lifetime pub fn parse_opt_lifetime(&self) -> Option<ast::Lifetime> { match *self.token { - token::LIFETIME(*) => { + token::LIFETIME(..) => { Some(self.parse_lifetime()) } _ => { @@ -2108,7 +2108,7 @@ impl Parser { ); let (s, z) = p.parse_sep_and_zerok(); let seq = match seq { - Spanned { node, _ } => node, + Spanned { node, .. } => node, }; tt_seq( mk_sp(sp.lo, p.span.hi), @@ -2274,13 +2274,13 @@ impl Parser { hi = e.span.hi; // HACK: turn &[...] into a &-evec ex = match e.node { - ExprVec(*) | ExprLit(@codemap::Spanned { - node: lit_str(*), span: _ + ExprVec(..) | ExprLit(@codemap::Spanned { + node: lit_str(..), span: _ }) if m == MutImmutable => { ExprVstore(e, ExprVstoreSlice) } - ExprVec(*) if m == MutMutable => { + ExprVec(..) if m == MutMutable => { ExprVstore(e, ExprVstoreMutSlice) } _ => ExprAddrOf(m, e) @@ -2296,11 +2296,11 @@ impl Parser { hi = e.span.hi; // HACK: turn @[...] into a @-evec ex = match e.node { - ExprVec(*) | ExprRepeat(*) if m == MutMutable => + ExprVec(..) | ExprRepeat(..) if m == MutMutable => ExprVstore(e, ExprVstoreMutBox), - ExprVec(*) | - ExprLit(@codemap::Spanned { node: lit_str(*), span: _}) | - ExprRepeat(*) if m == MutImmutable => ExprVstore(e, ExprVstoreBox), + ExprVec(..) | + ExprLit(@codemap::Spanned { node: lit_str(..), span: _}) | + ExprRepeat(..) if m == MutImmutable => ExprVstore(e, ExprVstoreBox), _ => self.mk_unary(UnBox(m), e) }; } @@ -2311,9 +2311,9 @@ impl Parser { hi = e.span.hi; // HACK: turn ~[...] into a ~-evec ex = match e.node { - ExprVec(*) | - ExprLit(@codemap::Spanned { node: lit_str(*), span: _}) | - ExprRepeat(*) => ExprVstore(e, ExprVstoreUniq), + ExprVec(..) | + ExprLit(@codemap::Spanned { node: lit_str(..), span: _}) | + ExprRepeat(..) => ExprVstore(e, ExprVstoreUniq), _ => self.mk_unary(UnUniq, e) }; } @@ -2564,8 +2564,8 @@ impl Parser { ~[last_arg], sugar)) } - ExprPath(*) | ExprCall(*) | ExprMethodCall(*) | - ExprParen(*) => { + ExprPath(..) | ExprCall(..) | ExprMethodCall(..) | + ExprParen(..) => { let block = self.parse_lambda_block_expr(); let last_arg = self.mk_expr(block.span.lo, block.span.hi, ctor(block)); @@ -2742,18 +2742,17 @@ impl Parser { let subpat = self.parse_pat(); match subpat { @ast::Pat { id, node: PatWild, span } => { - // NOTE #5830 activate after snapshot - // self.obsolete(*self.span, ObsoleteVecDotDotWildcard); + self.obsolete(*self.span, ObsoleteVecDotDotWildcard); slice = Some(@ast::Pat { id: id, node: PatWildMulti, span: span }) }, - @ast::Pat { node: PatIdent(_, _, _), _ } => { + @ast::Pat { node: PatIdent(_, _, _), .. } => { slice = Some(subpat); } - @ast::Pat { span, _ } => self.span_fatal( + @ast::Pat { span, .. } => self.span_fatal( span, "expected an identifier or nothing" ) } @@ -2782,8 +2781,7 @@ impl Parser { etc = *self.token == token::UNDERSCORE || *self.token == token::DOTDOT; if *self.token == token::UNDERSCORE { - // NOTE #5830 activate after snapshot - // self.obsolete(*self.span, ObsoleteStructWildcard); + self.obsolete(*self.span, ObsoleteStructWildcard); } if etc { self.bump(); @@ -2848,8 +2846,8 @@ impl Parser { pat = match sub.node { PatLit(e@@Expr { node: ExprLit(@codemap::Spanned { - node: lit_str(*), - span: _}), _ + node: lit_str(..), + span: _}), .. }) => { let vst = @Expr { id: ast::DUMMY_NODE_ID, @@ -2876,8 +2874,8 @@ impl Parser { pat = match sub.node { PatLit(e@@Expr { node: ExprLit(@codemap::Spanned { - node: lit_str(*), - span: _}), _ + node: lit_str(..), + span: _}), .. }) => { let vst = @Expr { id: ast::DUMMY_NODE_ID, @@ -2904,8 +2902,8 @@ impl Parser { // HACK: parse &"..." as a literal of a borrowed str pat = match sub.node { PatLit(e@@Expr { - node: ExprLit(@codemap::Spanned { - node: lit_str(*), span: _}), _ + node: ExprLit(@codemap::Spanned{ node: lit_str(..), .. }), + .. }) => { let vst = @Expr { id: ast::DUMMY_NODE_ID, @@ -3056,8 +3054,7 @@ impl Parser { // This is a "top constructor only" pat self.bump(); if is_star { - // NOTE #5830 activate after snapshot - // self.obsolete(*self.span, ObsoleteEnumWildcard); + self.obsolete(*self.span, ObsoleteEnumWildcard); } self.bump(); self.expect(&token::RPAREN); @@ -3330,7 +3327,7 @@ impl Parser { attrs_remaining: attrs_remaining, view_items: view_items, items: items, - _ + .. } = self.parse_items_and_view_items(first_item_attrs, false, false); @@ -3478,7 +3475,7 @@ impl Parser { } self.bump(); } - token::MOD_SEP | token::IDENT(*) => { + token::MOD_SEP | token::IDENT(..) => { let tref = self.parse_trait_ref(); result.push(TraitTyParamBound(tref)); } @@ -3702,7 +3699,7 @@ impl Parser { sty_uniq(MutImmutable) }, self) } - token::IDENT(*) if self.is_self_ident() => { + token::IDENT(..) if self.is_self_ident() => { self.bump(); sty_value(MutImmutable) } @@ -3952,7 +3949,7 @@ impl Parser { ref_id: node_id }) } - ty_path(*) => { + ty_path(..) => { self.span_err(ty.span, "bounded traits are only valid in type position"); None @@ -4129,7 +4126,7 @@ impl Parser { attrs_remaining: attrs_remaining, view_items: view_items, items: starting_items, - _ + .. } = self.parse_items_and_view_items(first_item_attrs, true, true); let mut items: ~[@item] = starting_items; let attrs_remaining_len = attrs_remaining.len(); @@ -4386,7 +4383,7 @@ impl Parser { } let (named, maybe_path, ident) = match *self.token { - token::IDENT(*) => { + token::IDENT(..) => { let the_ident = self.parse_ident(); let path = if *self.token == token::EQ { self.bump(); @@ -5046,16 +5043,16 @@ impl Parser { } iovi_view_item(view_item) => { match view_item.node { - view_item_use(*) => { + view_item_use(..) => { // `extern mod` must precede `use`. extern_mod_allowed = false; } - view_item_extern_mod(*) + view_item_extern_mod(..) if !extern_mod_allowed => { self.span_err(view_item.span, "\"extern mod\" declarations are not allowed here"); } - view_item_extern_mod(*) => {} + view_item_extern_mod(..) => {} } view_items.push(view_item); } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 4ad2c9a32c9..8f8b956315f 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -217,17 +217,17 @@ pub fn to_str(input: @ident_interner, t: &Token) -> ~str { _ => { ~"an interpolated " + match (*nt) { - nt_item(*) => ~"item", - nt_block(*) => ~"block", - nt_stmt(*) => ~"statement", - nt_pat(*) => ~"pattern", - nt_attr(*) => fail!("should have been handled"), - nt_expr(*) => fail!("should have been handled above"), - nt_ty(*) => ~"type", - nt_ident(*) => ~"identifier", - nt_path(*) => ~"path", - nt_tt(*) => ~"tt", - nt_matchers(*) => ~"matcher sequence" + nt_item(..) => ~"item", + nt_block(..) => ~"block", + nt_stmt(..) => ~"statement", + nt_pat(..) => ~"pattern", + nt_attr(..) => fail!("should have been handled"), + nt_expr(..) => fail!("should have been handled above"), + nt_ty(..) => ~"type", + nt_ident(..) => ~"identifier", + nt_path(..) => ~"path", + nt_tt(..) => ~"tt", + nt_matchers(..) => ~"matcher sequence" } } } @@ -260,10 +260,10 @@ pub fn can_begin_expr(t: &Token) -> bool { BINOP(OR) => true, // in lambda syntax OROR => true, // in lambda syntax MOD_SEP => true, - INTERPOLATED(nt_expr(*)) - | INTERPOLATED(nt_ident(*)) - | INTERPOLATED(nt_block(*)) - | INTERPOLATED(nt_path(*)) => true, + INTERPOLATED(nt_expr(..)) + | INTERPOLATED(nt_ident(..)) + | INTERPOLATED(nt_block(..)) + | INTERPOLATED(nt_path(..)) => true, _ => false } } @@ -303,7 +303,7 @@ pub fn is_ident(t: &Token) -> bool { pub fn is_ident_or_path(t: &Token) -> bool { match *t { - IDENT(_, _) | INTERPOLATED(nt_path(*)) => true, + IDENT(_, _) | INTERPOLATED(nt_path(..)) => true, _ => false } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index a8f82221fa1..9c1023c6cb8 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -625,7 +625,7 @@ pub fn print_item(s: @ps, item: &ast::item) { } // I think it's reasonable to hide the context here: ast::item_mac(codemap::Spanned { node: ast::mac_invoc_tt(ref pth, ref tts, _), - _}) => { + ..}) => { print_visibility(s, item.vis); print_path(s, pth, false); word(s.s, "! "); @@ -706,7 +706,7 @@ pub fn print_struct(s: @ps, popen(s); commasep(s, inconsistent, struct_def.fields, |s, field| { match field.node.kind { - ast::named_field(*) => fail!("unexpected named field"), + ast::named_field(..) => fail!("unexpected named field"), ast::unnamed_field => { maybe_print_comment(s, field.span.lo); print_type(s, &field.node.ty); @@ -955,7 +955,7 @@ pub fn print_possibly_embedded_block_(s: @ps, attrs: &[ast::Attribute], close_box: bool) { match blk.rules { - ast::UnsafeBlock(*) => word_space(s, "unsafe"), + ast::UnsafeBlock(..) => word_space(s, "unsafe"), ast::DefaultBlock => () } maybe_print_comment(s, blk.span.lo); @@ -1215,7 +1215,7 @@ pub fn print_expr(s: @ps, expr: &ast::Expr) { print_mutability(s, m); // Avoid `& &e` => `&&e`. match (m, &expr.node) { - (ast::MutImmutable, &ast::ExprAddrOf(*)) => space(s.s), + (ast::MutImmutable, &ast::ExprAddrOf(..)) => space(s.s), _ => { } } print_expr(s, expr); @@ -1639,7 +1639,7 @@ pub fn print_pat(s: @ps, pat: &ast::Pat) { ast::PatEnum(ref path, ref args_) => { print_path(s, path, true); match *args_ { - None => word(s.s, "(*)"), + None => word(s.s, "(..)"), Some(ref args) => { if !args.is_empty() { popen(s); @@ -1666,7 +1666,7 @@ pub fn print_pat(s: @ps, pat: &ast::Pat) { get_span); if etc { if fields.len() != 0u { word_space(s, ","); } - word(s.s, "_"); + word(s.s, ".."); } word(s.s, "}"); } @@ -1703,7 +1703,7 @@ pub fn print_pat(s: @ps, pat: &ast::Pat) { for &p in slice.iter() { if !before.is_empty() { word_space(s, ","); } match p { - @ast::Pat { node: ast::PatWildMulti, _ } => { + @ast::Pat { node: ast::PatWildMulti, .. } => { // this case is handled by print_pat } _ => word(s.s, ".."), diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 71eee8b7ccc..0e07ee23b67 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -21,7 +21,7 @@ impl<T> Container for SmallVector<T> { fn len(&self) -> uint { match *self { Zero => 0, - One(*) => 1, + One(..) => 1, Many(ref vals) => vals.len() } } @@ -53,7 +53,7 @@ impl<T> SmallVector<T> { pub fn push(&mut self, v: T) { match *self { Zero => *self = One(v), - One(*) => { + One(..) => { let one = util::replace(self, Zero); match one { One(v1) => util::replace(self, Many(~[v1, v])), @@ -99,7 +99,7 @@ impl<T> Iterator<T> for SmallVectorMoveIterator<T> { fn next(&mut self) -> Option<T> { match *self { ZeroIterator => None, - OneIterator(*) => { + OneIterator(..) => { let mut replacement = ZeroIterator; util::swap(self, &mut replacement); match replacement { @@ -114,7 +114,7 @@ impl<T> Iterator<T> for SmallVectorMoveIterator<T> { fn size_hint(&self) -> (uint, Option<uint>) { match *self { ZeroIterator => (0, Some(0)), - OneIterator(*) => (1, Some(1)), + OneIterator(..) => (1, Some(1)), ManyIterator(ref inner) => inner.size_hint() } } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 4691d8f5912..4100104dd61 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -47,7 +47,7 @@ pub fn name_of_fn(fk: &fn_kind) -> Ident { fk_item_fn(name, _, _, _) | fk_method(name, _, _) => { name } - fk_anon(*) | fk_fn_block(*) => parse::token::special_idents::anon, + fk_anon(..) | fk_fn_block(..) => parse::token::special_idents::anon, } } @@ -57,7 +57,7 @@ pub fn generics_of_fn(fk: &fn_kind) -> Generics { fk_method(_, generics, _) => { (*generics).clone() } - fk_anon(*) | fk_fn_block(*) => { + fk_anon(..) | fk_fn_block(..) => { Generics { lifetimes: opt_vec::Empty, ty_params: opt_vec::Empty, @@ -501,7 +501,7 @@ pub fn walk_fn<E:Clone, V:Visitor<E>>(visitor: &mut V, visitor.visit_explicit_self(&method.explicit_self, env.clone()); } - fk_anon(*) | fk_fn_block(*) => { + fk_anon(..) | fk_fn_block(..) => { } } |
