From ab387a68388974a432951e806851936898907fd0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 28 Nov 2013 12:22:53 -0800 Subject: [PATCH] Register new snapshots --- doc/rust.md | 6 +- doc/tutorial.md | 12 +- src/compiletest/runtest.rs | 2 +- src/libextra/arc.rs | 6 +- src/libextra/bitv.rs | 4 +- src/libextra/btree.rs | 6 +- src/libextra/dlist.rs | 4 +- src/libextra/getopts.rs | 4 +- src/libextra/glob.rs | 2 +- src/libextra/json.rs | 10 +- src/libextra/lib.rs | 2 - src/libextra/tempfile.rs | 2 +- src/libextra/test.rs | 12 +- src/libextra/time.rs | 6 +- src/libextra/treemap.rs | 8 +- src/libextra/url.rs | 10 +- src/librustc/back/link.rs | 2 +- src/librustc/front/feature_gate.rs | 7 +- src/librustc/lib.rs | 2 - src/librustc/lib/llvm.rs | 37 ---- src/librustc/metadata/decoder.rs | 2 +- src/librustc/metadata/encoder.rs | 10 +- src/librustc/metadata/filesearch.rs | 2 +- src/librustc/middle/astencode.rs | 4 +- src/librustc/middle/borrowck/check_loans.rs | 32 ++-- .../borrowck/gather_loans/gather_moves.rs | 20 +-- .../middle/borrowck/gather_loans/lifetime.rs | 34 ++-- .../middle/borrowck/gather_loans/mod.rs | 16 +- .../borrowck/gather_loans/restrictions.rs | 8 +- src/librustc/middle/borrowck/mod.rs | 20 +-- src/librustc/middle/borrowck/move_data.rs | 8 +- src/librustc/middle/cfg/construct.rs | 22 +-- src/librustc/middle/check_const.rs | 30 ++-- src/librustc/middle/check_match.rs | 32 ++-- src/librustc/middle/const_eval.rs | 4 +- src/librustc/middle/dataflow.rs | 10 +- src/librustc/middle/effect.rs | 8 +- src/librustc/middle/entry.rs | 2 +- src/librustc/middle/freevars.rs | 4 +- src/librustc/middle/kind.rs | 16 +- src/librustc/middle/lang_items.rs | 4 +- src/librustc/middle/lint.rs | 54 +++--- src/librustc/middle/liveness.rs | 58 +++---- src/librustc/middle/mem_categorization.rs | 126 +++++++------- src/librustc/middle/moves.rs | 18 +- src/librustc/middle/pat_util.rs | 12 +- src/librustc/middle/privacy.rs | 70 ++++---- src/librustc/middle/reachable.rs | 24 +-- src/librustc/middle/region.rs | 18 +- src/librustc/middle/resolve.rs | 82 ++++----- src/librustc/middle/resolve_lifetime.rs | 16 +- src/librustc/middle/trans/_match.rs | 40 ++--- src/librustc/middle/trans/adt.rs | 58 ++++--- src/librustc/middle/trans/base.rs | 24 +-- src/librustc/middle/trans/callee.rs | 28 +-- src/librustc/middle/trans/common.rs | 10 +- src/librustc/middle/trans/consts.rs | 10 +- src/librustc/middle/trans/controlflow.rs | 2 +- src/librustc/middle/trans/debuginfo.rs | 52 +++--- src/librustc/middle/trans/expr.rs | 40 ++--- src/librustc/middle/trans/foreign.rs | 4 +- src/librustc/middle/trans/glue.rs | 20 +-- src/librustc/middle/trans/inline.rs | 2 +- src/librustc/middle/trans/meth.rs | 6 +- src/librustc/middle/trans/monomorphize.rs | 32 ++-- src/librustc/middle/trans/reflect.rs | 2 +- src/librustc/middle/trans/tvec.rs | 4 +- src/librustc/middle/trans/type_.rs | 2 +- src/librustc/middle/trans/type_of.rs | 36 ++-- src/librustc/middle/ty.rs | 136 +++++++-------- src/librustc/middle/ty_fold.rs | 2 +- src/librustc/middle/typeck/astconv.rs | 6 +- src/librustc/middle/typeck/check/_match.rs | 8 +- src/librustc/middle/typeck/check/method.rs | 28 +-- src/librustc/middle/typeck/check/mod.rs | 52 +++--- src/librustc/middle/typeck/check/regionck.rs | 90 +++++----- src/librustc/middle/typeck/check/vtable.rs | 8 +- src/librustc/middle/typeck/coherence.rs | 12 +- src/librustc/middle/typeck/collect.rs | 10 +- src/librustc/middle/typeck/infer/coercion.rs | 4 +- .../middle/typeck/infer/error_reporting.rs | 2 +- .../typeck/infer/region_inference/doc.rs | 6 +- .../typeck/infer/region_inference/mod.rs | 52 +++--- src/librustc/middle/typeck/infer/test.rs | 10 +- src/librustc/middle/typeck/mod.rs | 2 +- src/librustc/middle/typeck/variance.rs | 52 +++--- src/librustc/util/common.rs | 2 +- src/librustc/util/ppaux.rs | 38 ++-- src/librustdoc/clean.rs | 24 +-- src/librustdoc/core.rs | 2 +- src/librustdoc/html/format.rs | 2 +- src/librustdoc/html/render.rs | 162 +++++++++--------- src/librustdoc/lib.rs | 4 +- src/librustdoc/passes.rs | 24 +-- src/librustpkg/lib.rs | 4 +- src/librustpkg/package_source.rs | 2 +- src/librustpkg/tests.rs | 28 +-- src/librustpkg/util.rs | 2 +- src/librustuv/lib.rs | 2 - src/librustuv/net.rs | 16 +- src/librustuv/pipe.rs | 10 +- src/librustuv/process.rs | 2 +- src/libstd/fmt/mod.rs | 2 +- src/libstd/fmt/parse.rs | 18 +- src/libstd/hashmap.rs | 2 +- src/libstd/io/fs.rs | 36 ++-- src/libstd/io/mod.rs | 2 +- src/libstd/io/native/file.rs | 2 +- src/libstd/io/native/process.rs | 2 +- src/libstd/io/net/ip.rs | 4 +- src/libstd/io/stdio.rs | 8 +- src/libstd/lib.rs | 4 +- src/libstd/os.rs | 2 +- src/libstd/repr.rs | 2 +- src/libstd/result.rs | 4 +- src/libstd/rt/context.rs | 4 +- src/libstd/rt/local_ptr.rs | 3 +- src/libstd/rt/mod.rs | 2 +- src/libstd/rt/sched.rs | 2 +- src/libstd/rt/task.rs | 8 +- src/libstd/trie.rs | 4 +- src/libstd/unstable/intrinsics.rs | 1 - src/libstd/unstable/sync.rs | 2 +- src/libstd/util.rs | 2 +- src/libsyntax/ast.rs | 2 +- src/libsyntax/ast_map.rs | 26 +-- src/libsyntax/ast_util.rs | 16 +- src/libsyntax/attr.rs | 4 +- src/libsyntax/ext/base.rs | 6 +- src/libsyntax/ext/concat.rs | 2 +- src/libsyntax/ext/deriving/clone.rs | 6 +- src/libsyntax/ext/deriving/default.rs | 2 +- src/libsyntax/ext/deriving/generic.rs | 4 +- src/libsyntax/ext/deriving/iter_bytes.rs | 2 +- src/libsyntax/ext/deriving/primitive.rs | 2 +- src/libsyntax/ext/deriving/to_str.rs | 6 +- src/libsyntax/ext/deriving/ty.rs | 4 +- src/libsyntax/ext/deriving/zero.rs | 2 +- src/libsyntax/ext/expand.rs | 12 +- src/libsyntax/ext/format.rs | 4 +- src/libsyntax/ext/quote.rs | 2 +- src/libsyntax/ext/source_util.rs | 6 +- src/libsyntax/ext/tt/macro_parser.rs | 4 +- src/libsyntax/ext/tt/transcribe.rs | 4 +- src/libsyntax/lib.rs | 2 - src/libsyntax/parse/attr.rs | 6 +- src/libsyntax/parse/classify.rs | 16 +- src/libsyntax/parse/parser.rs | 81 +++++---- src/libsyntax/parse/token.rs | 32 ++-- src/libsyntax/print/pprust.rs | 14 +- src/libsyntax/util/small_vector.rs | 8 +- src/libsyntax/visit.rs | 6 +- src/snapshots.txt | 8 + src/test/compile-fail/match-vec-mismatch.rs | 2 +- .../compile-fail/match-vec-unreachable.rs | 2 +- src/test/compile-fail/non-exhaustive-match.rs | 10 +- .../compile-fail/pattern-error-continue.rs | 2 +- .../debug-info/destructured-fn-argument.rs | 4 +- src/test/debug-info/destructured-local.rs | 4 +- src/test/debug-info/lexical-scope-in-match.rs | 2 +- src/test/run-pass/const-enum-byref-self.rs | 2 +- src/test/run-pass/const-enum-byref.rs | 2 +- src/test/run-pass/const-enum-structlike.rs | 2 +- src/test/run-pass/core-run-destroy.rs | 4 +- .../run-pass/func-arg-incomplete-pattern.rs | 2 +- src/test/run-pass/ignore-all-the-things.rs | 12 +- src/test/run-pass/issue-1701.rs | 8 +- src/test/run-pass/issue-4875.rs | 2 +- src/test/run-pass/issue-8351-1.rs | 2 +- src/test/run-pass/match-enum-struct-1.rs | 2 +- src/test/run-pass/match-struct-0.rs | 2 +- src/test/run-pass/nested-exhaustive-match.rs | 8 +- src/test/run-pass/nested-patterns.rs | 6 +- .../nullable-pointer-iotareduction.rs | 6 +- src/test/run-pass/record-pat.rs | 2 +- .../run-pass/regions-dependent-addr-of.rs | 6 +- src/test/run-pass/rtio-processes.rs | 4 +- src/test/run-pass/tag.rs | 2 +- src/test/run-pass/vec-matching-autoslice.rs | 2 +- src/test/run-pass/vec-matching-fixed.rs | 10 +- src/test/run-pass/vec-matching.rs | 16 +- src/test/run-pass/vec-tail-matching.rs | 2 +- 182 files changed, 1287 insertions(+), 1334 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index 2a4a066c020..a25f19371bd 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -2820,7 +2820,7 @@ expression*, which is the value to compare to the patterns. The type of the patterns must equal the type of the head expression. In a pattern whose head expression has an `enum` type, a placeholder (`_`) stands for a -*single* data field, whereas a wildcard `*` stands for *all* the fields of a particular +*single* data field, whereas a wildcard `..` stands for *all* the fields of a particular variant. For example: ~~~~ @@ -2830,7 +2830,7 @@ let x: List = Cons(10, @Cons(11, @Nil)); match x { Cons(_, @Nil) => fail!("singleton list"), - Cons(*) => return, + Cons(..) => return, Nil => fail!("empty list") } ~~~~ @@ -2838,7 +2838,7 @@ match x { The first pattern matches lists constructed by applying `Cons` to any head value, and a tail value of `@Nil`. The second pattern matches _any_ list constructed with `Cons`, ignoring the values of its arguments. The difference between `_` and `*` is that the pattern `C(_)` is only type-correct if -`C` has exactly one argument, while the pattern `C(*)` is type-correct for any enum variant `C`, regardless of how many arguments `C` has. +`C` has exactly one argument, while the pattern `C(..)` is type-correct for any enum variant `C`, regardless of how many arguments `C` has. To execute an `match` expression, first the head expression is evaluated, then its value is sequentially compared to the patterns in the arms until a match diff --git a/doc/tutorial.md b/doc/tutorial.md index 1559033a582..c82f99772c9 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -606,8 +606,8 @@ match mypoint { In general, the field names of a struct do not have to appear in the same order they appear in the type. When you are not interested in all -the fields of a struct, a struct pattern may end with `, _` (as in -`Name { field1, _ }`) to indicate that you're ignoring all other fields. +the fields of a struct, a struct pattern may end with `, ..` (as in +`Name { field1, .. }`) to indicate that you're ignoring all other fields. Additionally, struct fields have a shorthand matching form that simply reuses the field name as the binding name. @@ -615,7 +615,7 @@ reuses the field name as the binding name. # struct Point { x: f64, y: f64 } # let mypoint = Point { x: 0.0, y: 0.0 }; match mypoint { - Point { x, _ } => { println(x.to_str()) } + Point { x, .. } => { println(x.to_str()) } } ~~~ @@ -696,7 +696,7 @@ fn area(sh: Shape) -> f64 { ~~~~ You can write a lone `_` to ignore an individual field, and can -ignore all fields of a variant like: `Circle(*)`. As in their +ignore all fields of a variant like: `Circle(..)`. As in their introduction form, nullary enum patterns are written without parentheses. @@ -725,7 +725,7 @@ enum Shape { } fn area(sh: Shape) -> f64 { match sh { - Circle { radius: radius, _ } => f64::consts::PI * square(radius), + Circle { radius: radius, .. } => f64::consts::PI * square(radius), Rectangle { top_left: top_left, bottom_right: bottom_right } => { (bottom_right.x - top_left.x) * (top_left.y - bottom_right.y) } @@ -1698,7 +1698,7 @@ a function that returns `Option` instead of `T`. fn radius(shape: Shape) -> Option { match shape { Circle(_, radius) => Some(radius), - Rectangle(*) => None + Rectangle(..) => None } } ~~~~ diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 4c7b212304c..1bf6542903a 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -166,7 +166,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) { &ProcRes); } - let ProcRes{ stdout, _ } = ProcRes; + let ProcRes{ stdout, .. } = ProcRes; srcs.push(stdout); round += 1; } diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs index b9b1e324e5a..770aa6432cf 100644 --- a/src/libextra/arc.rs +++ b/src/libextra/arc.rs @@ -256,7 +256,7 @@ impl MutexArc { pub fn unwrap(self) -> T { let MutexArc { x: x } = self; let inner = x.unwrap(); - let MutexArcInner { failed: failed, data: data, _ } = inner; + let MutexArcInner { failed: failed, data: data, .. } = inner; if failed { fail!("Can't unwrap poisoned MutexArc - another task failed inside!"); } @@ -504,9 +504,9 @@ impl RWArc { * in write mode. */ pub fn unwrap(self) -> T { - let RWArc { x: x, _ } = self; + let RWArc { x: x, .. } = self; let inner = x.unwrap(); - let RWArcInner { failed: failed, data: data, _ } = inner; + let RWArcInner { failed: failed, data: data, .. } = inner; if failed { fail!("Can't unwrap poisoned RWArc - another task failed inside!") } diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 09137d6bb74..015dcc2e1dd 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -663,7 +663,7 @@ impl BitvSet { size += 1; true }); - let Bitv{rep, _} = bitv; + let Bitv{rep, ..} = bitv; match rep { Big(b) => BitvSet{ size: size, bitv: b }, Small(SmallBitv{bits}) => @@ -678,7 +678,7 @@ impl BitvSet { /// Consumes this set to return the underlying bit vector pub fn unwrap(self) -> Bitv { let cap = self.capacity(); - let BitvSet{bitv, _} = self; + let BitvSet{bitv, ..} = self; return Bitv{ nbits:cap, rep: Big(bitv) }; } diff --git a/src/libextra/btree.rs b/src/libextra/btree.rs index d650769d70f..040c814a04a 100644 --- a/src/libextra/btree.rs +++ b/src/libextra/btree.rs @@ -111,8 +111,8 @@ impl Node{ ///Differentiates between leaf and branch nodes. fn is_leaf(&self) -> bool{ match self{ - &LeafNode(*) => true, - &BranchNode(*) => false + &LeafNode(..) => true, + &BranchNode(..) => false } } @@ -208,7 +208,7 @@ impl ToStr for Node{ fn to_str(&self) -> ~str{ match *self{ LeafNode(ref leaf) => leaf.to_str(), - BranchNode(*) => ~"" + BranchNode(..) => ~"" } } } diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs index 3507201b839..ccbaca295ec 100644 --- a/src/libextra/dlist.rs +++ b/src/libextra/dlist.rs @@ -241,7 +241,7 @@ impl Deque for DList { /// /// O(1) fn pop_front(&mut self) -> Option { - self.pop_front_node().map(|~Node{value, _}| value) + self.pop_front_node().map(|~Node{value, ..}| value) } /// Add an element last in the list @@ -255,7 +255,7 @@ impl Deque for DList { /// /// O(1) fn pop_back(&mut self) -> Option { - self.pop_back_node().map(|~Node{value, _}| value) + self.pop_back_node().map(|~Node{value, ..}| value) } } diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index 8cdadca1cc2..ad5df00a2fe 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -549,7 +549,7 @@ pub mod groups { long_name: long_name, hasarg: hasarg, occur: occur, - _ + .. } = (*self).clone(); match (short_name.len(), long_name.len()) { @@ -686,7 +686,7 @@ pub mod groups { hint: hint, desc: desc, hasarg: hasarg, - _} = (*optref).clone(); + ..} = (*optref).clone(); let mut row = " ".repeat(4); diff --git a/src/libextra/glob.rs b/src/libextra/glob.rs index 3ee43ca4a58..e398a10ecf1 100644 --- a/src/libextra/glob.rs +++ b/src/libextra/glob.rs @@ -154,7 +154,7 @@ fn list_dir_sorted(path: &Path) -> ~[Path] { sort::quick_sort(children, |p1, p2| p2.filename() <= p1.filename()); children } - Err(*) => ~[] + Err(..) => ~[] } } diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 8dcf0a919d3..27399651392 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -875,11 +875,11 @@ impl Decoder { fn expected(&self, expected: &str, found: &Json) -> ! { let found_s = match *found { Null => "null", - List(*) => "list", - Object(*) => "object", - Number(*) => "number", - String(*) => "string", - Boolean(*) => "boolean" + List(..) => "list", + Object(..) => "object", + Number(..) => "number", + String(..) => "string", + Boolean(..) => "boolean" }; self.err(format!("expected {expct} but found {fnd}: {val}", expct=expected, fnd=found_s, val=found.to_str())) diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs index 106dc5bf5c9..a74c4993be3 100644 --- a/src/libextra/lib.rs +++ b/src/libextra/lib.rs @@ -38,8 +38,6 @@ Rust extras are part of the standard Rust distribution. #[deny(non_camel_case_types)]; #[deny(missing_doc)]; -#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot -#[allow(cstack)]; // NOTE: remove after the next snapshot. use std::str::{StrSlice, OwnedStr}; diff --git a/src/libextra/tempfile.rs b/src/libextra/tempfile.rs index 5bcba295723..d305b3f3b24 100644 --- a/src/libextra/tempfile.rs +++ b/src/libextra/tempfile.rs @@ -39,7 +39,7 @@ impl TempDir { for _ in range(0u, 1000) { let p = tmpdir.join(r.gen_ascii_str(16) + suffix); match io::result(|| fs::mkdir(&p, io::UserRWX)) { - Err(*) => {} + Err(..) => {} Ok(()) => return Some(TempDir { path: Some(p) }) } } diff --git a/src/libextra/test.rs b/src/libextra/test.rs index 16e9ea8ece4..c16d4aa3e16 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -97,12 +97,12 @@ pub enum TestFn { impl TestFn { fn padding(&self) -> NamePadding { match self { - &StaticTestFn(*) => PadNone, - &StaticBenchFn(*) => PadOnRight, - &StaticMetricFn(*) => PadOnRight, - &DynTestFn(*) => PadNone, - &DynMetricFn(*) => PadOnRight, - &DynBenchFn(*) => PadOnRight, + &StaticTestFn(..) => PadNone, + &StaticBenchFn(..) => PadOnRight, + &StaticMetricFn(..) => PadOnRight, + &DynTestFn(..) => PadNone, + &DynMetricFn(..) => PadOnRight, + &DynBenchFn(..) => PadOnRight, } } } diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 1352bfd424f..3ea7bf0fa56 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -681,13 +681,13 @@ pub fn strptime(s: &str, format: &str) -> Result { let mut buf = [0]; let c = match rdr.read(buf) { - Some(*) => buf[0] as u8 as char, + Some(..) => buf[0] as u8 as char, None => break }; match c { '%' => { let ch = match rdr.read(buf) { - Some(*) => buf[0] as u8 as char, + Some(..) => buf[0] as u8 as char, None => break }; match parse_type(s, pos, ch, &mut tm) { @@ -932,7 +932,7 @@ pub fn strftime(format: &str, tm: &Tm) -> ~str { loop { let mut b = [0]; let ch = match rdr.read(b) { - Some(*) => b[0], + Some(..) => b[0], None => break, }; match ch as char { diff --git a/src/libextra/treemap.rs b/src/libextra/treemap.rs index cf63c63c942..a936ceacc2e 100644 --- a/src/libextra/treemap.rs +++ b/src/libextra/treemap.rs @@ -686,7 +686,7 @@ fn mutate_values<'r, -> bool { match *node { Some(~TreeNode{key: ref key, value: ref mut value, left: ref mut left, - right: ref mut right, _}) => { + right: ref mut right, ..}) => { if !mutate_values(left, |k,v| f(k,v)) { return false } if !f(key, value) { return false } if !mutate_values(right, |k,v| f(k,v)) { return false } @@ -801,13 +801,13 @@ fn remove(node: &mut Option<~TreeNode>, (remove(&mut save.left, key), true) } else { let new = save.left.take_unwrap(); - let ~TreeNode{value, _} = replace(save, new); + let ~TreeNode{value, ..} = replace(save, new); *save = save.left.take_unwrap(); (Some(value), true) } } else if save.right.is_some() { let new = save.right.take_unwrap(); - let ~TreeNode{value, _} = replace(save, new); + let ~TreeNode{value, ..} = replace(save, new); (Some(value), true) } else { (None, false) @@ -843,7 +843,7 @@ fn remove(node: &mut Option<~TreeNode>, } } return match node.take() { - Some(~TreeNode{value, _}) => Some(value), None => fail!() + Some(~TreeNode{value, ..}) => Some(value), None => fail!() }; } diff --git a/src/libextra/url.rs b/src/libextra/url.rs index 71a8774e35c..cfa4680052d 100644 --- a/src/libextra/url.rs +++ b/src/libextra/url.rs @@ -74,7 +74,7 @@ fn encode_inner(s: &str, full_url: bool) -> ~str { let mut buf = [0]; let ch = match rdr.read(buf) { None => break, - Some(*) => buf[0] as char, + Some(..) => buf[0] as char, }; match ch { @@ -138,7 +138,7 @@ fn decode_inner(s: &str, full_url: bool) -> ~str { let mut buf = [0]; let ch = match rdr.read(buf) { None => break, - Some(*) => buf[0] as char + Some(..) => buf[0] as char }; match ch { '%' => { @@ -199,7 +199,7 @@ fn encode_plus(s: &str) -> ~str { loop { let mut buf = [0]; let ch = match rdr.read(buf) { - Some(*) => buf[0] as char, + Some(..) => buf[0] as char, None => break, }; match ch { @@ -253,7 +253,7 @@ pub fn decode_form_urlencoded(s: &[u8]) -> HashMap<~str, ~[~str]> { loop { let mut buf = [0]; let ch = match rdr.read(buf) { - Some(*) => buf[0] as char, + Some(..) => buf[0] as char, None => break, }; match ch { @@ -318,7 +318,7 @@ fn split_char_first(s: &str, c: char) -> (~str, ~str) { loop { let mut buf = [0]; let ch = match rdr.read(buf) { - Some(*) => buf[0] as char, + Some(..) => buf[0] as char, None => break, }; if ch == c { diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index adc3712bf0f..9aba16422d3 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -973,7 +973,7 @@ fn is_writeable(p: &Path) -> bool { !p.exists() || (match io::result(|| p.stat()) { - Err(*) => false, + Err(..) => false, Ok(m) => m.perm & io::UserWrite == io::UserWrite }) } diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs index c175bd3a404..82ddb9c2f97 100644 --- a/src/librustc/front/feature_gate.rs +++ b/src/librustc/front/feature_gate.rs @@ -95,7 +95,7 @@ impl Visitor<()> for Context { ast::view_item_use(ref paths) => { for path in paths.iter() { match path.node { - ast::view_path_glob(*) => { + ast::view_path_glob(..) => { self.gate_feature("globs", path.span, "glob import statements are \ experimental and possibly buggy"); @@ -110,8 +110,6 @@ impl Visitor<()> for Context { } fn visit_item(&mut self, i: @ast::item, _:()) { - // NOTE: uncomment after snapshot - /* for attr in i.attrs.iter() { if "thread_local" == attr.name() { self.gate_feature("thread_local", i.span, @@ -120,12 +118,11 @@ impl Visitor<()> for Context { `#[task_local]` mapping to the task model"); } } - */ match i.node { ast::item_enum(ref def, _) => { for variant in def.variants.iter() { match variant.node.kind { - ast::struct_variant_kind(*) => { + ast::struct_variant_kind(..) => { self.gate_feature("struct_variant", variant.span, "enum struct variants are \ experimental and possibly buggy"); diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index dc1aa1f41cb..c65dc5cc50e 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -19,8 +19,6 @@ #[crate_type = "lib"]; #[feature(macro_rules, globs, struct_variant, managed_boxes)]; -#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot -#[allow(cstack)]; // NOTE: remove after the next snapshot. extern mod extra; extern mod syntax; diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index 6443d8469de..a6a96b25ff5 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -128,7 +128,6 @@ pub enum RealPredicate { // The LLVM TypeKind type - must stay in sync with the def of // LLVMTypeKind in llvm/include/llvm-c/Core.h -#[cfg(not(stage0))] #[deriving(Eq)] #[repr(C)] pub enum TypeKind { @@ -150,42 +149,6 @@ pub enum TypeKind { X86_MMX = 15, } -// NOTE remove these after snapshot. (See also #10308.) -#[cfg(stage0)] -pub type TypeKind = u32; -#[cfg(stage0)] -pub static Void: TypeKind = 0; -#[cfg(stage0)] -pub static Half: TypeKind = 1; -#[cfg(stage0)] -pub static Float: TypeKind = 2; -#[cfg(stage0)] -pub static Double: TypeKind = 3; -#[cfg(stage0)] -pub static X86_FP80: TypeKind = 4; -#[cfg(stage0)] -pub static FP128: TypeKind = 5; -#[cfg(stage0)] -pub static PPC_FP128: TypeKind = 6; -#[cfg(stage0)] -pub static Label: TypeKind = 7; -#[cfg(stage0)] -pub static Integer: TypeKind = 8; -#[cfg(stage0)] -pub static Function: TypeKind = 9; -#[cfg(stage0)] -pub static Struct: TypeKind = 10; -#[cfg(stage0)] -pub static Array: TypeKind = 11; -#[cfg(stage0)] -pub static Pointer: TypeKind = 12; -#[cfg(stage0)] -pub static Vector: TypeKind = 13; -#[cfg(stage0)] -pub static Metadata: TypeKind = 14; -#[cfg(stage0)] -pub static X86_MMX: TypeKind = 15; - #[repr(C)] pub enum AtomicBinOp { Xchg = 0, diff --git a/src/librustc/metadata/decoder.rs b/src/librustc/metadata/decoder.rs index 84795a650cd..48621459228 100644 --- a/src/librustc/metadata/decoder.rs +++ b/src/librustc/metadata/decoder.rs @@ -503,7 +503,7 @@ pub enum DefLike { pub fn def_like_to_def(def_like: DefLike) -> ast::Def { match def_like { DlDef(def) => return def, - DlImpl(*) => fail!("found impl in def_like_to_def"), + DlImpl(..) => fail!("found impl in def_like_to_def"), DlField => fail!("found field in def_like_to_def") } } diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 8f09353796b..6da75397002 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -623,7 +623,7 @@ fn encode_info_for_mod(ecx: &EncodeContext, }); match item.node { - item_impl(*) => { + item_impl(..) => { let (ident, did) = (item.ident, item.id); debug!("(encoding info for module) ... encoding impl {} \ ({:?}/{:?})", @@ -983,7 +983,7 @@ fn encode_info_for_item(ecx: &EncodeContext, encode_visibility(ebml_w, vis); ebml_w.end_tag(); } - item_ty(*) => { + item_ty(..) => { add_to_index(); ebml_w.start_tag(tag_items_data_item); encode_def_id(ebml_w, def_id); @@ -1242,7 +1242,7 @@ fn encode_info_for_item(ecx: &EncodeContext, // Encode inherent implementations for this trait. encode_inherent_implementations(ecx, ebml_w, def_id); } - item_mac(*) => fail!("item macros unimplemented") + item_mac(..) => fail!("item macros unimplemented") } } @@ -1256,7 +1256,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext, ebml_w.start_tag(tag_items_data_item); match nitem.node { - foreign_item_fn(*) => { + foreign_item_fn(..) => { encode_def_id(ebml_w, local_def(nitem.id)); encode_family(ebml_w, purity_fn_family(impure_fn)); encode_bounds_and_type(ebml_w, ecx, @@ -1769,7 +1769,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] { link_meta, reachable, non_inlineable_statics, - _ + .. } = parms; let type_abbrevs = @mut HashMap::new(); let stats = @mut stats; diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index b2e5888eee1..456a08f6d08 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -138,7 +138,7 @@ pub fn search(filesearch: @FileSearch, pick: pick) { } rslt } - Err(*) => FileDoesntMatch, + Err(..) => FileDoesntMatch, } }); } diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 078c417031a..2eb6dcaf49b 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -313,7 +313,7 @@ impl fold::ast_fold for NestedItemsDropper { node: ast::DeclItem(_), span: _ }, _) => None, - ast::StmtMac(*) => fail!("unexpanded macro in astencode") + ast::StmtMac(..) => fail!("unexpanded macro in astencode") } }).collect(); let blk_sans_items = ast::Block { @@ -483,7 +483,7 @@ impl tr for ty::Region { index, ident), ty::ReScope(id) => ty::ReScope(xcx.tr_id(id)), - ty::ReEmpty | ty::ReStatic | ty::ReInfer(*) => *self, + ty::ReEmpty | ty::ReStatic | ty::ReInfer(..) => *self, ty::ReFree(ref fr) => { ty::ReFree(ty::FreeRegion {scope_id: xcx.tr_id(fr.scope_id), bound_region: fr.bound_region.tr(xcx)}) diff --git a/src/librustc/middle/borrowck/check_loans.rs b/src/librustc/middle/borrowck/check_loans.rs index 774509ab0da..6545919e844 100644 --- a/src/librustc/middle/borrowck/check_loans.rs +++ b/src/librustc/middle/borrowck/check_loans.rs @@ -399,12 +399,12 @@ impl<'self> CheckLoanCtxt<'self> { cmt = b; } - mc::cat_rvalue(*) | + mc::cat_rvalue(..) | mc::cat_static_item | - mc::cat_copied_upvar(*) | - mc::cat_deref(_, _, mc::unsafe_ptr(*)) | - mc::cat_deref(_, _, mc::gc_ptr(*)) | - mc::cat_deref(_, _, mc::region_ptr(*)) => { + mc::cat_copied_upvar(..) | + mc::cat_deref(_, _, mc::unsafe_ptr(..)) | + mc::cat_deref(_, _, mc::gc_ptr(..)) | + mc::cat_deref(_, _, mc::region_ptr(..)) => { assert_eq!(cmt.mutbl, mc::McDeclared); return; } @@ -477,12 +477,12 @@ impl<'self> CheckLoanCtxt<'self> { } mc::cat_copied_upvar(_) | - mc::cat_rvalue(*) | - mc::cat_local(*) | + mc::cat_rvalue(..) | + mc::cat_local(..) | mc::cat_arg(_) | - mc::cat_self(*) | - mc::cat_deref(_, _, mc::unsafe_ptr(*)) | - mc::cat_static_item(*) | + mc::cat_self(..) | + mc::cat_deref(_, _, mc::unsafe_ptr(..)) | + mc::cat_static_item(..) | mc::cat_deref(_, _, mc::gc_ptr(_)) | mc::cat_deref(_, _, mc::region_ptr(MutImmutable, _)) => { // Aliasability is independent of base cmt @@ -654,7 +654,7 @@ impl<'self> CheckLoanCtxt<'self> { fn check_move_out_from_expr(&self, expr: @ast::Expr) { match expr.node { - ast::ExprFnBlock(*) | ast::ExprProc(*) => { + ast::ExprFnBlock(..) | ast::ExprProc(..) => { // moves due to capture clauses are checked // in `check_loans_in_fn`, so that we can // give a better error message @@ -728,14 +728,14 @@ fn check_loans_in_fn<'a>(this: &mut CheckLoanCtxt<'a>, sp: Span, id: ast::NodeId) { match *fk { - visit::fk_item_fn(*) | - visit::fk_method(*) => { + visit::fk_item_fn(..) | + visit::fk_method(..) => { // Don't process nested items. return; } - visit::fk_anon(*) | - visit::fk_fn_block(*) => { + visit::fk_anon(..) | + visit::fk_fn_block(..) => { check_captured_variables(this, id, sp); } } @@ -800,7 +800,7 @@ fn check_loans_in_expr<'a>(this: &mut CheckLoanCtxt<'a>, match expr.node { ast::ExprSelf | - ast::ExprPath(*) => { + ast::ExprPath(..) => { if !this.move_data.is_assignee(expr.id) { let cmt = this.bccx.cat_expr_unadjusted(expr); debug!("path cmt={}", cmt.repr(this.tcx())); diff --git a/src/librustc/middle/borrowck/gather_loans/gather_moves.rs b/src/librustc/middle/borrowck/gather_loans/gather_moves.rs index 7fdc2485631..2b8c500b637 100644 --- a/src/librustc/middle/borrowck/gather_loans/gather_moves.rs +++ b/src/librustc/middle/borrowck/gather_loans/gather_moves.rs @@ -100,11 +100,11 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt, cmt0: mc::cmt, cmt: mc::cmt) -> bool { match cmt.cat { - mc::cat_deref(_, _, mc::region_ptr(*)) | - mc::cat_deref(_, _, mc::gc_ptr(*)) | - mc::cat_deref(_, _, mc::unsafe_ptr(*)) | - mc::cat_stack_upvar(*) | - mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Many, _ }) => { + mc::cat_deref(_, _, mc::region_ptr(..)) | + mc::cat_deref(_, _, mc::gc_ptr(..)) | + mc::cat_deref(_, _, mc::unsafe_ptr(..)) | + mc::cat_stack_upvar(..) | + mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Many, .. }) => { bccx.span_err( cmt0.span, format!("cannot move out of {}", @@ -115,7 +115,7 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt, // Can move out of captured upvars only if the destination closure // type is 'once'. 1-shot stack closures emit the copied_upvar form // (see mem_categorization.rs). - mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Once, _ }) => { + mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Once, .. }) => { true } @@ -132,10 +132,10 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt, true } - mc::cat_rvalue(*) | - mc::cat_local(*) | - mc::cat_arg(*) | - mc::cat_self(*) => { + mc::cat_rvalue(..) | + mc::cat_local(..) | + mc::cat_arg(..) | + mc::cat_self(..) => { true } diff --git a/src/librustc/middle/borrowck/gather_loans/lifetime.rs b/src/librustc/middle/borrowck/gather_loans/lifetime.rs index 8cfb47bd04d..0ce36e52262 100644 --- a/src/librustc/middle/borrowck/gather_loans/lifetime.rs +++ b/src/librustc/middle/borrowck/gather_loans/lifetime.rs @@ -70,13 +70,13 @@ impl<'self> GuaranteeLifetimeContext<'self> { //! Main routine. Walks down `cmt` until we find the "guarantor". match cmt.cat { - mc::cat_rvalue(*) | - mc::cat_copied_upvar(*) | // L-Local - mc::cat_local(*) | // L-Local - mc::cat_arg(*) | // L-Local - mc::cat_self(*) | // L-Local - mc::cat_deref(_, _, mc::region_ptr(*)) | // L-Deref-Borrowed - mc::cat_deref(_, _, mc::unsafe_ptr(*)) => { + mc::cat_rvalue(..) | + mc::cat_copied_upvar(..) | // L-Local + mc::cat_local(..) | // L-Local + mc::cat_arg(..) | // L-Local + mc::cat_self(..) | // L-Local + mc::cat_deref(_, _, mc::region_ptr(..)) | // L-Deref-Borrowed + mc::cat_deref(_, _, mc::unsafe_ptr(..)) => { let scope = self.scope(cmt); self.check_scope(scope) } @@ -183,7 +183,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { //! lvalue. cmt.mutbl.is_immutable() || match cmt.guarantor().cat { - mc::cat_rvalue(*) => true, + mc::cat_rvalue(..) => true, _ => false } } @@ -305,16 +305,16 @@ impl<'self> GuaranteeLifetimeContext<'self> { mc::cat_arg(id) => { self.bccx.moved_variables_set.contains(&id) } - mc::cat_rvalue(*) | + mc::cat_rvalue(..) | mc::cat_static_item | - mc::cat_copied_upvar(*) | - mc::cat_deref(*) => { + mc::cat_copied_upvar(..) | + mc::cat_deref(..) => { false } - r @ mc::cat_downcast(*) | - r @ mc::cat_interior(*) | - r @ mc::cat_stack_upvar(*) | - r @ mc::cat_discr(*) => { + r @ mc::cat_downcast(..) | + r @ mc::cat_interior(..) | + r @ mc::cat_stack_upvar(..) | + r @ mc::cat_discr(..) => { self.tcx().sess.span_bug( cmt.span, format!("illegal guarantor category: {:?}", r)); @@ -344,7 +344,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { mc::cat_self(local_id) => { self.bccx.tcx.region_maps.encl_region(local_id) } - mc::cat_deref(_, _, mc::unsafe_ptr(*)) => { + mc::cat_deref(_, _, mc::unsafe_ptr(..)) => { ty::ReStatic } mc::cat_deref(_, _, mc::region_ptr(_, r)) => { @@ -352,7 +352,7 @@ impl<'self> GuaranteeLifetimeContext<'self> { } mc::cat_downcast(cmt) | mc::cat_deref(cmt, _, mc::uniq_ptr) | - mc::cat_deref(cmt, _, mc::gc_ptr(*)) | + mc::cat_deref(cmt, _, mc::gc_ptr(..)) | mc::cat_interior(cmt, _) | mc::cat_stack_upvar(cmt) | mc::cat_discr(cmt, _) => { diff --git a/src/librustc/middle/borrowck/gather_loans/mod.rs b/src/librustc/middle/borrowck/gather_loans/mod.rs index 44a5f6fe49d..7688d4dff73 100644 --- a/src/librustc/middle/borrowck/gather_loans/mod.rs +++ b/src/librustc/middle/borrowck/gather_loans/mod.rs @@ -135,12 +135,12 @@ fn gather_loans_in_fn(this: &mut GatherLoanCtxt, sp: Span, id: ast::NodeId) { match fk { - &visit::fk_item_fn(*) | &visit::fk_method(*) => { + &visit::fk_item_fn(..) | &visit::fk_method(..) => { fail!("cannot occur, due to visit_item override"); } // Visit closures as part of the containing item. - &visit::fk_anon(*) | &visit::fk_fn_block(*) => { + &visit::fk_anon(..) | &visit::fk_fn_block(..) => { this.push_repeating_id(body.id); visit::walk_fn(this, fk, decl, body, sp, id, ()); this.pop_repeating_id(body.id); @@ -305,7 +305,7 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt, this.pop_repeating_id(body.id); } - ast::ExprFnBlock(*) | ast::ExprProc(*) => { + ast::ExprFnBlock(..) | ast::ExprProc(..) => { gather_moves::gather_captures(this.bccx, this.move_data, ex); visit::walk_expr(this, ex, ()); } @@ -353,14 +353,14 @@ impl<'self> GatherLoanCtxt<'self> { let _i = indenter(); match *adjustment { - ty::AutoAddEnv(*) => { + ty::AutoAddEnv(..) => { debug!("autoaddenv -- no autoref"); return; } ty::AutoDerefRef( ty::AutoDerefRef { - autoref: None, _ }) => { + autoref: None, .. }) => { debug!("no autoref"); return; } @@ -489,9 +489,9 @@ impl<'self> GatherLoanCtxt<'self> { } ty::ReEmpty | - ty::ReLateBound(*) | - ty::ReEarlyBound(*) | - ty::ReInfer(*) => { + ty::ReLateBound(..) | + ty::ReEarlyBound(..) | + ty::ReInfer(..) => { self.tcx().sess.span_bug( cmt.span, format!("Invalid borrow lifetime: {:?}", loan_region)); diff --git a/src/librustc/middle/borrowck/gather_loans/restrictions.rs b/src/librustc/middle/borrowck/gather_loans/restrictions.rs index d4fe23e57b4..57f180846e9 100644 --- a/src/librustc/middle/borrowck/gather_loans/restrictions.rs +++ b/src/librustc/middle/borrowck/gather_loans/restrictions.rs @@ -68,7 +68,7 @@ impl<'self> RestrictionsContext<'self> { } match cmt.cat { - mc::cat_rvalue(*) => { + mc::cat_rvalue(..) => { // Effectively, rvalues are stored into a // non-aliasable temporary on the stack. Since they // are inherently non-aliasable, they can only be @@ -117,8 +117,8 @@ impl<'self> RestrictionsContext<'self> { self.extend(result, cmt.mutbl, LpDeref(pk), restrictions) } - mc::cat_copied_upvar(*) | // FIXME(#2152) allow mutation of upvars - mc::cat_static_item(*) | + mc::cat_copied_upvar(..) | // FIXME(#2152) allow mutation of upvars + mc::cat_static_item(..) | mc::cat_deref(_, _, mc::region_ptr(MutImmutable, _)) | mc::cat_deref(_, _, mc::gc_ptr(MutImmutable)) => { // R-Deref-Imm-Borrowed @@ -200,7 +200,7 @@ impl<'self> RestrictionsContext<'self> { } } - mc::cat_deref(_, _, mc::unsafe_ptr(*)) => { + mc::cat_deref(_, _, mc::unsafe_ptr(..)) => { // We are very trusting when working with unsafe pointers. Safe } diff --git a/src/librustc/middle/borrowck/mod.rs b/src/librustc/middle/borrowck/mod.rs index 51002889b2f..c12194ac8bb 100644 --- a/src/librustc/middle/borrowck/mod.rs +++ b/src/librustc/middle/borrowck/mod.rs @@ -127,13 +127,13 @@ fn borrowck_fn(this: &mut BorrowckCtxt, sp: Span, id: ast::NodeId) { match fk { - &visit::fk_anon(*) | - &visit::fk_fn_block(*) => { + &visit::fk_anon(..) | + &visit::fk_fn_block(..) => { // Closures are checked as part of their containing fn item. } - &visit::fk_item_fn(*) | - &visit::fk_method(*) => { + &visit::fk_item_fn(..) | + &visit::fk_method(..) => { debug!("borrowck_fn(id={:?})", id); // Check the body of fn items. @@ -305,7 +305,7 @@ pub fn opt_loan_path(cmt: mc::cmt) -> Option<@LoanPath> { //! traverses the CMT. match cmt.cat { - mc::cat_rvalue(*) | + mc::cat_rvalue(..) | mc::cat_static_item | mc::cat_copied_upvar(_) => { None @@ -497,14 +497,14 @@ impl BorrowckCtxt { adj: @ty::AutoAdjustment) -> mc::cmt { match *adj { - ty::AutoAddEnv(*) => { + ty::AutoAddEnv(..) => { // no autoderefs mc::cat_expr_unadjusted(self.tcx, self.method_map, expr) } ty::AutoDerefRef( ty::AutoDerefRef { - autoderefs: autoderefs, _}) => { + autoderefs: autoderefs, ..}) => { mc::cat_expr_autoderefd(self.tcx, self.method_map, expr, autoderefs) } @@ -657,10 +657,10 @@ impl BorrowckCtxt { self.cmt_to_str(err.cmt), self.mut_to_str(lk)) } - err_out_of_root_scope(*) => { + err_out_of_root_scope(..) => { format!("cannot root managed value long enough") } - err_out_of_scope(*) => { + err_out_of_scope(..) => { format!("borrowed value does not live long enough") } err_freeze_aliasable_const => { @@ -733,7 +733,7 @@ impl BorrowckCtxt { pub fn note_and_explain_bckerr(&self, err: BckError) { let code = err.code; match code { - err_mutbl(*) | err_freeze_aliasable_const(*) => {} + err_mutbl(..) | err_freeze_aliasable_const(..) => {} err_out_of_root_scope(super_scope, sub_scope) => { note_and_explain_region( diff --git a/src/librustc/middle/borrowck/move_data.rs b/src/librustc/middle/borrowck/move_data.rs index 7b060e6ac7d..dc58423a424 100644 --- a/src/librustc/middle/borrowck/move_data.rs +++ b/src/librustc/middle/borrowck/move_data.rs @@ -211,7 +211,7 @@ impl MoveData { } let index = match *lp { - LpVar(*) => { + LpVar(..) => { let index = MovePathIndex(self.paths.len()); self.paths.push(MovePath { @@ -284,7 +284,7 @@ impl MoveData { } None => { match *lp { - LpVar(*) => { } + LpVar(..) => { } LpExtend(b, _, _) => { self.add_existing_base_paths(b, result); } @@ -394,7 +394,7 @@ impl MoveData { let path = *self.path_map.get(&path.loan_path); self.kill_moves(path, kill_id, dfcx_moves); } - LpExtend(*) => {} + LpExtend(..) => {} } } @@ -405,7 +405,7 @@ impl MoveData { let kill_id = tcx.region_maps.encl_scope(id); dfcx_assign.add_kill(kill_id, assignment_index); } - LpExtend(*) => { + LpExtend(..) => { tcx.sess.bug("Var assignment for non var path"); } } diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/middle/cfg/construct.rs index e014f41edcd..028fdd52a26 100644 --- a/src/librustc/middle/cfg/construct.rs +++ b/src/librustc/middle/cfg/construct.rs @@ -43,7 +43,7 @@ pub fn construct(tcx: ty::ctxt, }; let entry = cfg_builder.add_node(0, []); let exit = cfg_builder.block(blk, entry); - let CFGBuilder {exit_map, graph, _} = cfg_builder; + let CFGBuilder {exit_map, graph, ..} = cfg_builder; CFG {exit_map: exit_map, graph: graph, entry: entry, @@ -72,7 +72,7 @@ impl CFGBuilder { self.expr(expr, pred) } - ast::StmtMac(*) => { + ast::StmtMac(..) => { self.tcx.sess.span_bug(stmt.span, "unexpanded macro"); } } @@ -95,8 +95,8 @@ impl CFGBuilder { match pat.node { ast::PatIdent(_, _, None) | ast::PatEnum(_, None) | - ast::PatLit(*) | - ast::PatRange(*) | + ast::PatLit(..) | + ast::PatRange(..) | ast::PatWild | ast::PatWildMulti => { self.add_node(pat.id, [pred]) } @@ -239,7 +239,7 @@ impl CFGBuilder { expr_exit } - ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ast::ExprLoop(ref body, _) => { // @@ -405,13 +405,13 @@ impl CFGBuilder { } ast::ExprLogLevel | - ast::ExprMac(*) | - ast::ExprInlineAsm(*) | + ast::ExprMac(..) | + ast::ExprInlineAsm(..) | ast::ExprSelf | - ast::ExprFnBlock(*) | - ast::ExprProc(*) | - ast::ExprLit(*) | - ast::ExprPath(*) => { + ast::ExprFnBlock(..) | + ast::ExprProc(..) | + ast::ExprLit(..) | + ast::ExprPath(..) => { self.straightline(expr, pred, []) } } diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index 3048bfb1d2c..39cd3356fae 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -86,9 +86,9 @@ pub fn check_pat(v: &mut CheckCrateVisitor, p: &Pat, _is_const: bool) { match e.node { ExprVstore( @Expr { node: ExprLit(@codemap::Spanned { - node: lit_str(*), - _}), - _ }, + node: lit_str(..), + ..}), + .. }, ExprVstoreUniq ) => true, _ => false @@ -120,8 +120,8 @@ pub fn check_expr(v: &mut CheckCrateVisitor, "cannot do allocations in constant expressions"); return; } - ExprLit(@codemap::Spanned {node: lit_str(*), _}) => { } - ExprBinary(*) | ExprUnary(*) => { + ExprLit(@codemap::Spanned {node: lit_str(..), ..}) => { } + ExprBinary(..) | ExprUnary(..) => { if method_map.contains_key(&e.id) { sess.span_err(e.span, "user-defined operators are not \ allowed in constant expressions"); @@ -147,7 +147,7 @@ pub fn check_expr(v: &mut CheckCrateVisitor, items without type parameters"); } match def_map.find(&e.id) { - Some(&DefStatic(*)) | + Some(&DefStatic(..)) | Some(&DefFn(_, _)) | Some(&DefVariant(_, _, _)) | Some(&DefStruct(_)) => { } @@ -166,8 +166,8 @@ pub fn check_expr(v: &mut CheckCrateVisitor, } ExprCall(callee, _, NoSugar) => { match def_map.find(&callee.id) { - Some(&DefStruct(*)) => {} // OK. - Some(&DefVariant(*)) => {} // OK. + Some(&DefStruct(..)) => {} // OK. + Some(&DefVariant(..)) => {} // OK. _ => { sess.span_err( e.span, @@ -181,12 +181,12 @@ pub fn check_expr(v: &mut CheckCrateVisitor, ExprVstore(_, ExprVstoreSlice) | ExprVec(_, MutImmutable) | ExprAddrOf(MutImmutable, _) | - ExprField(*) | - ExprIndex(*) | - ExprTup(*) | - ExprRepeat(*) | - ExprStruct(*) => { } - ExprAddrOf(*) => { + ExprField(..) | + ExprIndex(..) | + ExprTup(..) | + ExprRepeat(..) | + ExprStruct(..) => { } + ExprAddrOf(..) => { sess.span_err( e.span, "borrowed pointers in constants may only refer to \ @@ -251,7 +251,7 @@ impl Visitor<()> for CheckItemRecursionVisitor { fn visit_expr(&mut self, e: @Expr, _: ()) { match e.node { - ExprPath(*) => match self.env.def_map.find(&e.id) { + ExprPath(..) => match self.env.def_map.find(&e.id) { Some(&DefStatic(def_id, _)) if ast_util::is_local(def_id) => match self.env.ast_map.get_copy(&def_id.node) { ast_map::node_item(it, _) => { diff --git a/src/librustc/middle/check_match.rs b/src/librustc/middle/check_match.rs index a65dc88ce99..c46f5fa892e 100644 --- a/src/librustc/middle/check_match.rs +++ b/src/librustc/middle/check_match.rs @@ -192,7 +192,7 @@ fn check_exhaustive(cx: &MatchCheckCtxt, sp: Span, pats: ~[@Pat]) { } } } - ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { + ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { match *ctor { vec(n) => Some(format!("vectors of length {}", n).to_managed()), _ => None @@ -274,7 +274,7 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful { ty::ty_evec(_, ty::vstore_fixed(n)) => { is_useful_specialized(cx, m, v, vec(n), n, left_ty) } - ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { + ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { let max_len = m.rev_iter().fold(0, |max_len, r| { match r[0].node { PatVec(ref before, _, ref after) => { @@ -348,13 +348,13 @@ fn pat_ctor_id(cx: &MatchCheckCtxt, p: @Pat) -> Option { PatRange(lo, hi) => { Some(range(eval_const_expr(cx.tcx, lo), eval_const_expr(cx.tcx, hi))) } - PatStruct(*) => { + PatStruct(..) => { match cx.tcx.def_map.find(&pat.id) { Some(&DefVariant(_, id, _)) => Some(variant(id)), _ => Some(single) } } - PatBox(_) | PatUniq(_) | PatTup(_) | PatRegion(*) => { + PatBox(_) | PatUniq(_) | PatTup(_) | PatRegion(..) => { Some(single) } PatVec(ref before, slice, ref after) => { @@ -372,7 +372,7 @@ fn is_wild(cx: &MatchCheckCtxt, p: @Pat) -> bool { PatWild | PatWildMulti => { true } PatIdent(_, _, _) => { match cx.tcx.def_map.find(&pat.id) { - Some(&DefVariant(_, _, _)) | Some(&DefStatic(*)) => { false } + Some(&DefVariant(_, _, _)) | Some(&DefStatic(..)) => { false } _ => { true } } } @@ -385,8 +385,8 @@ fn missing_ctor(cx: &MatchCheckCtxt, left_ty: ty::t) -> Option { match ty::get(left_ty).sty { - ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(*) | ty::ty_tup(_) | - ty::ty_struct(*) => { + ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(..) | ty::ty_tup(_) | + ty::ty_struct(..) => { for r in m.iter() { if !is_wild(cx, r[0]) { return None; } } @@ -451,7 +451,7 @@ fn missing_ctor(cx: &MatchCheckCtxt, _ => None } } - ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { + ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { // Find the lengths and slices of all vector patterns. let vec_pat_lens = m.iter().filter_map(|r| { @@ -508,7 +508,7 @@ fn missing_ctor(cx: &MatchCheckCtxt, fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint { match ty::get(ty).sty { ty::ty_tup(ref fs) => fs.len(), - ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(*) => 1u, + ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(..) => 1u, ty::ty_enum(eid, _) => { let id = match *ctor { variant(id) => id, _ => fail!("impossible case") }; @@ -518,7 +518,7 @@ fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint { } } ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(), - ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { + ty::ty_unboxed_vec(..) | ty::ty_evec(..) => { match *ctor { vec(n) => n, _ => 0u @@ -656,8 +656,8 @@ fn specialize(cx: &MatchCheckCtxt, } DefVariant(_, _, _) => None, - DefFn(*) | - DefStruct(*) => { + DefFn(..) | + DefStruct(..) => { // FIXME #4731: Is this right? --pcw let new_args; match args { @@ -847,7 +847,7 @@ fn is_refutable(cx: &MatchCheckCtxt, pat: &Pat) -> bool { return true; } } - Some(&DefStatic(*)) => return true, + Some(&DefStatic(..)) => return true, _ => () } @@ -857,7 +857,7 @@ fn is_refutable(cx: &MatchCheckCtxt, pat: &Pat) -> bool { is_refutable(cx, sub) } PatWild | PatWildMulti | PatIdent(_, _, None) => { false } - PatLit(@Expr {node: ExprLit(@Spanned { node: lit_nil, _}), _}) => { + PatLit(@Expr {node: ExprLit(@Spanned { node: lit_nil, ..}), ..}) => { // "()" false } @@ -872,7 +872,7 @@ fn is_refutable(cx: &MatchCheckCtxt, pat: &Pat) -> bool { args.iter().any(|a| is_refutable(cx, *a)) } PatEnum(_,_) => { false } - PatVec(*) => { true } + PatVec(..) => { true } } } @@ -903,7 +903,7 @@ fn check_legality_of_move_bindings(cx: &MatchCheckCtxt, let check_move: |&Pat, Option<@Pat>| = |p, sub| { // check legality of moving out of the enum - // x @ Foo(*) is legal, but x @ Foo(y) isn't. + // x @ Foo(..) is legal, but x @ Foo(y) isn't. if sub.map_default(false, |p| pat_contains_bindings(def_map, p)) { tcx.sess.span_err( p.span, diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index 28d6f9515a8..641a685a38f 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -193,7 +193,7 @@ impl ConstEvalVisitor { let cn = match e.node { ast::ExprLit(lit) => { match lit.node { - ast::lit_str(*) | ast::lit_float(*) => general_const, + ast::lit_str(..) | ast::lit_float(..) => general_const, _ => integral_const } } @@ -246,7 +246,7 @@ impl ConstEvalVisitor { // surrounding nonlocal constants. But we don't yet. ast::ExprPath(_) => self.lookup_constness(e), - ast::ExprRepeat(*) => general_const, + ast::ExprRepeat(..) => general_const, _ => non_const }; diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index e10e53d2575..6927793ec1f 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -399,7 +399,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { self.walk_expr(expr, in_out, loop_scopes); } - ast::StmtMac(*) => { + ast::StmtMac(..) => { self.tcx().sess.span_bug(stmt.span, "unexpanded macro"); } } @@ -568,7 +568,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { copy_bits(new_loop_scope.break_bits, in_out); } - ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ast::ExprLoop(ref blk, _) => { // @@ -706,8 +706,8 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { } ast::ExprLogLevel | - ast::ExprLit(*) | - ast::ExprPath(*) | + ast::ExprLit(..) | + ast::ExprPath(..) | ast::ExprSelf => { } @@ -734,7 +734,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> { self.walk_block(blk, in_out, loop_scopes); } - ast::ExprMac(*) => { + ast::ExprMac(..) => { self.tcx().sess.span_bug(expr.span, "unexpanded macro"); } } diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index c0ac48bfee8..4c7ffcf1e21 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -70,7 +70,7 @@ impl EffectCheckVisitor { debug!("effect: checking index with base type {}", ppaux::ty_to_str(self.tcx, base_type)); match ty::get(base_type).sty { - ty::ty_estr(*) => { + ty::ty_estr(..) => { self.tcx.sess.span_err(e.span, "modification of string types is not allowed"); } @@ -106,7 +106,7 @@ impl Visitor<()> for EffectCheckVisitor { fn visit_block(&mut self, block: &ast::Block, _:()) { let old_unsafe_context = self.unsafe_context; let is_unsafe = match block.rules { - ast::UnsafeBlock(*) => true, ast::DefaultBlock => false + ast::UnsafeBlock(..) => true, ast::DefaultBlock => false }; if is_unsafe && self.unsafe_context == SafeContext { self.unsafe_context = UnsafeBlock(block.id) @@ -154,10 +154,10 @@ impl Visitor<()> for EffectCheckVisitor { ast::ExprAddrOf(ast::MutMutable, base) => { self.check_str_index(base); } - ast::ExprInlineAsm(*) => { + ast::ExprInlineAsm(..) => { self.require_unsafe(expr.span, "use of inline assembly") } - ast::ExprPath(*) => { + ast::ExprPath(..) => { match ty::resolve_expr(self.tcx, expr) { ast::DefStatic(_, true) => { self.require_unsafe(expr.span, "use of mutable static") diff --git a/src/librustc/middle/entry.rs b/src/librustc/middle/entry.rs index 20b630e3063..c2d7878a081 100644 --- a/src/librustc/middle/entry.rs +++ b/src/librustc/middle/entry.rs @@ -76,7 +76,7 @@ pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) fn find_item(item: @item, ctxt: &mut EntryContext) { match item.node { - item_fn(*) => { + item_fn(..) => { if item.ident.name == special_idents::main.name { match ctxt.ast_map.find(&item.id) { Some(&ast_map::node_item(_, path)) => { diff --git a/src/librustc/middle/freevars.rs b/src/librustc/middle/freevars.rs index 7b0bb80eb28..1219fd9260e 100644 --- a/src/librustc/middle/freevars.rs +++ b/src/librustc/middle/freevars.rs @@ -47,10 +47,10 @@ impl Visitor for CollectFreevarsVisitor { fn visit_expr(&mut self, expr:@ast::Expr, depth:int) { match expr.node { - ast::ExprFnBlock(*) | ast::ExprProc(*) => { + ast::ExprFnBlock(..) | ast::ExprProc(..) => { visit::walk_expr(self, expr, depth + 1) } - ast::ExprPath(*) | ast::ExprSelf => { + ast::ExprPath(..) | ast::ExprSelf => { let mut i = 0; match self.def_map.find(&expr.id) { None => fail!("path not found"), diff --git a/src/librustc/middle/kind.rs b/src/librustc/middle/kind.rs index 3bc103519da..a4348a71d21 100644 --- a/src/librustc/middle/kind.rs +++ b/src/librustc/middle/kind.rs @@ -216,13 +216,13 @@ fn with_appropriate_checker(cx: &Context, ty::ty_closure(ty::ClosureTy { sigil: OwnedSigil, bounds: bounds, - _ + .. }) => { b(|cx, fv| check_for_uniq(cx, fv, bounds)) } ty::ty_closure(ty::ClosureTy { sigil: ManagedSigil, - _ + .. }) => { // can't happen } @@ -230,7 +230,7 @@ fn with_appropriate_checker(cx: &Context, sigil: BorrowedSigil, bounds: bounds, region: region, - _ + .. }) => { b(|cx, fv| check_for_block(cx, fv, bounds, region)) } @@ -442,9 +442,9 @@ fn check_imm_free_var(cx: &Context, def: Def, sp: Span) { sp, "mutable variables cannot be implicitly captured"); } - DefLocal(*) | DefArg(*) => { /* ok */ } + DefLocal(..) | DefArg(..) => { /* ok */ } DefUpvar(_, def1, _, _) => { check_imm_free_var(cx, *def1, sp); } - DefBinding(*) | DefSelf(*) => { /*ok*/ } + DefBinding(..) | DefSelf(..) => { /*ok*/ } _ => { cx.tcx.sess.span_bug( sp, @@ -480,7 +480,7 @@ pub fn check_send(cx: &Context, ty: ty::t, sp: Span) -> bool { pub fn check_durable(tcx: ty::ctxt, ty: ty::t, sp: Span) -> bool { if !ty::type_is_static(tcx, ty) { match ty::get(ty).sty { - ty::ty_param(*) => { + ty::ty_param(..) => { tcx.sess.span_err(sp, "value may contain borrowed \ pointers; add `'static` bound"); } @@ -529,7 +529,7 @@ pub fn check_cast_for_escaping_regions( // worries. let target_ty = ty::expr_ty(cx.tcx, target); match ty::get(target_ty).sty { - ty::ty_trait(*) => {} + ty::ty_trait(..) => {} _ => { return; } } @@ -591,7 +591,7 @@ pub fn check_cast_for_escaping_regions( fn is_ReScope(r: ty::Region) -> bool { match r { - ty::ReScope(*) => true, + ty::ReScope(..) => true, _ => false } } diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index 5babebef2f6..c8f245d5555 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -434,7 +434,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<@str> { Some((key, value)) if "lang" == key => { return Some(value); } - Some(*) | None => {} + Some(..) | None => {} } } @@ -446,7 +446,7 @@ pub fn collect_language_items(crate: &ast::Crate, -> LanguageItems { let mut collector = LanguageItemCollector::new(session); collector.collect(crate); - let LanguageItemCollector { items, _ } = collector; + let LanguageItemCollector { items, .. } = collector; session.abort_if_errors(); items } diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index 6af07947fde..4c6ca53694a 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -542,7 +542,7 @@ fn check_while_true_expr(cx: &Context, e: &ast::Expr) { ast::ExprWhile(cond, _) => { match cond.node { ast::ExprLit(@codemap::Spanned { - node: ast::lit_bool(true), _}) => + node: ast::lit_bool(true), ..}) => { cx.span_lint(while_true, e.span, "denote infinite loops with loop { ... }"); @@ -720,7 +720,7 @@ fn check_item_ctypes(cx: &Context, it: &ast::item) { cx.span_lint(ctypes, ty.span, "found enum type without foreign-function-safe \ representation annotation in foreign module"); - // NOTE this message could be more helpful + // hmm... this message could be more helpful } } _ => () @@ -785,10 +785,10 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) { fn check_heap_item(cx: &Context, it: &ast::item) { match it.node { - ast::item_fn(*) | - ast::item_ty(*) | - ast::item_enum(*) | - ast::item_struct(*) => check_heap_type(cx, it.span, + ast::item_fn(..) | + ast::item_ty(..) | + ast::item_enum(..) | + ast::item_struct(..) => check_heap_type(cx, it.span, ty::node_id_to_type(cx.tcx, it.id)), _ => () @@ -892,7 +892,7 @@ fn check_heap_expr(cx: &Context, e: &ast::Expr) { fn check_path_statement(cx: &Context, s: &ast::Stmt) { match s.node { - ast::StmtSemi(@ast::Expr { node: ast::ExprPath(_), _ }, _) => { + ast::StmtSemi(@ast::Expr { node: ast::ExprPath(_), .. }, _) => { cx.span_lint(path_statement, s.span, "path statement with no effect"); } @@ -922,10 +922,10 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) { } match it.node { - ast::item_ty(*) | ast::item_struct(*) => { + ast::item_ty(..) | ast::item_struct(..) => { check_case(cx, "type", it.ident, it.span) } - ast::item_trait(*) => { + ast::item_trait(..) => { check_case(cx, "trait", it.ident, it.span) } ast::item_enum(ref enum_definition, _) => { @@ -1001,7 +1001,7 @@ fn check_unused_mut_pat(cx: &Context, p: &ast::Pat) { ref path, _) if pat_util::pat_is_binding(cx.tcx.def_map, p)=> { // `let mut _a = 1;` doesn't need a warning. let initial_underscore = match path.segments { - [ast::PathSegment { identifier: id, _ }] => { + [ast::PathSegment { identifier: id, .. }] => { cx.tcx.sess.str_of(id).starts_with("_") } _ => { @@ -1027,8 +1027,8 @@ fn check_unnecessary_allocation(cx: &Context, e: &ast::Expr) { ast::ExprVstore(e2, ast::ExprVstoreUniq) | ast::ExprVstore(e2, ast::ExprVstoreBox) => { match e2.node { - ast::ExprLit(@codemap::Spanned{node: ast::lit_str(*), _}) | - ast::ExprVec(*) => {} + ast::ExprLit(@codemap::Spanned{node: ast::lit_str(..), ..}) | + ast::ExprVec(..) => {} _ => return } } @@ -1038,7 +1038,7 @@ fn check_unnecessary_allocation(cx: &Context, e: &ast::Expr) { match cx.tcx.adjustments.find_copy(&e.id) { Some(@ty::AutoDerefRef(ty::AutoDerefRef { - autoref: Some(ty::AutoBorrowVec(*)), _ })) => { + autoref: Some(ty::AutoBorrowVec(..)), .. })) => { cx.span_lint(unnecessary_allocation, e.span, "unnecessary allocation, the sigil can be removed"); } @@ -1071,11 +1071,11 @@ fn check_missing_doc_attrs(cx: &Context, fn check_missing_doc_item(cx: &mut Context, it: &ast::item) { // XXX doesn't need to be mut let desc = match it.node { - ast::item_fn(*) => "a function", - ast::item_mod(*) => "a module", - ast::item_enum(*) => "an enum", - ast::item_struct(*) => "a struct", - ast::item_trait(*) => "a trait", + ast::item_fn(..) => "a function", + ast::item_mod(..) => "a module", + ast::item_enum(..) => "an enum", + ast::item_struct(..) => "a struct", + ast::item_trait(..) => "a trait", _ => return }; check_missing_doc_attrs(cx, it.id, it.attrs, it.span, desc); @@ -1091,13 +1091,13 @@ fn check_missing_doc_method(cx: &Context, m: &ast::method) { Some(md) => { match md.container { // Always check default methods defined on traits. - ty::TraitContainer(*) => {} + ty::TraitContainer(..) => {} // For methods defined on impls, it depends on whether // it is an implementation for a trait or is a plain // impl. ty::ImplContainer(cid) => { match ty::impl_trait_ref(cx.tcx, cid) { - Some(*) => return, // impl for trait: don't doc + Some(..) => return, // impl for trait: don't doc None => {} // plain impl: doc according to privacy } } @@ -1128,9 +1128,9 @@ fn check_missing_doc_variant(cx: &Context, v: &ast::variant) { /// #[unstable] (or none of them) attributes. fn check_stability(cx: &Context, e: &ast::Expr) { let def = match e.node { - ast::ExprMethodCall(*) | - ast::ExprPath(*) | - ast::ExprStruct(*) => { + ast::ExprMethodCall(..) | + ast::ExprPath(..) | + ast::ExprStruct(..) => { match cx.tcx.def_map.find(&e.id) { Some(&def) => def, None => return @@ -1178,17 +1178,17 @@ fn check_stability(cx: &Context, e: &ast::Expr) { let (lint, label) = match stability { // no stability attributes == Unstable None => (unstable, "unmarked"), - Some(attr::Stability { level: attr::Unstable, _ }) => + Some(attr::Stability { level: attr::Unstable, .. }) => (unstable, "unstable"), - Some(attr::Stability { level: attr::Experimental, _ }) => + Some(attr::Stability { level: attr::Experimental, .. }) => (experimental, "experimental"), - Some(attr::Stability { level: attr::Deprecated, _ }) => + Some(attr::Stability { level: attr::Deprecated, .. }) => (deprecated, "deprecated"), _ => return }; let msg = match stability { - Some(attr::Stability { text: Some(ref s), _ }) => { + Some(attr::Stability { text: Some(ref s), .. }) => { format!("use of {} item: {}", label, *s) } _ => format!("use of {} item", label) diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 4f137f1f5c4..ec86efdad75 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -298,7 +298,7 @@ impl IrMaps { self.num_vars += 1; match vk { - Local(LocalInfo { id: node_id, _ }) | Arg(node_id, _) => { + Local(LocalInfo { id: node_id, .. }) | Arg(node_id, _) => { self.variable_map.insert(node_id, v); }, ImplicitRet => {} @@ -321,7 +321,7 @@ impl IrMaps { pub fn variable_name(&mut self, var: Variable) -> @str { match self.var_kinds[*var] { - Local(LocalInfo { ident: nm, _ }) | Arg(_, nm) => { + Local(LocalInfo { ident: nm, .. }) | Arg(_, nm) => { self.tcx.sess.str_of(nm) }, ImplicitRet => @"" @@ -394,14 +394,14 @@ fn visit_fn(v: &mut LivenessVisitor, match *fk { visit::fk_method(_, _, method) => { match method.explicit_self.node { - sty_value(_) | sty_region(*) | sty_box(_) | sty_uniq(_) => { + sty_value(_) | sty_region(..) | sty_box(_) | sty_uniq(_) => { fn_maps.add_variable(Arg(method.self_id, special_idents::self_)); } sty_static => {} } } - visit::fk_item_fn(*) | visit::fk_anon(*) | visit::fk_fn_block(*) => {} + visit::fk_item_fn(..) | visit::fk_anon(..) | visit::fk_fn_block(..) => {} } // gather up the various local variables, significant expressions, @@ -486,7 +486,7 @@ fn visit_expr(v: &mut LivenessVisitor, expr: @Expr, this: @mut IrMaps) { } visit::walk_expr(v, expr, this); } - ExprFnBlock(*) | ExprProc(*) => { + ExprFnBlock(..) | ExprProc(..) => { // Interesting control flow (for loops can contain labeled // breaks or continues) this.add_live_node_for_node(expr.id, ExprNode(expr.span)); @@ -521,25 +521,25 @@ fn visit_expr(v: &mut LivenessVisitor, expr: @Expr, this: @mut IrMaps) { } // live nodes required for interesting control flow: - ExprIf(*) | ExprMatch(*) | ExprWhile(*) | ExprLoop(*) => { + ExprIf(..) | ExprMatch(..) | ExprWhile(..) | ExprLoop(..) => { this.add_live_node_for_node(expr.id, ExprNode(expr.span)); visit::walk_expr(v, expr, this); } - ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ExprBinary(_, op, _, _) if ast_util::lazy_binop(op) => { this.add_live_node_for_node(expr.id, ExprNode(expr.span)); visit::walk_expr(v, expr, this); } // otherwise, live nodes are not required: - ExprIndex(*) | ExprField(*) | ExprVstore(*) | ExprVec(*) | - ExprCall(*) | ExprMethodCall(*) | ExprTup(*) | ExprLogLevel | - ExprBinary(*) | ExprAddrOf(*) | - ExprDoBody(*) | ExprCast(*) | ExprUnary(*) | ExprBreak(_) | - ExprAgain(_) | ExprLit(_) | ExprRet(*) | ExprBlock(*) | - ExprAssign(*) | ExprAssignOp(*) | ExprMac(*) | - ExprStruct(*) | ExprRepeat(*) | ExprParen(*) | - ExprInlineAsm(*) => { + ExprIndex(..) | ExprField(..) | ExprVstore(..) | ExprVec(..) | + ExprCall(..) | ExprMethodCall(..) | ExprTup(..) | ExprLogLevel | + ExprBinary(..) | ExprAddrOf(..) | + ExprDoBody(..) | ExprCast(..) | ExprUnary(..) | ExprBreak(_) | + ExprAgain(_) | ExprLit(_) | ExprRet(..) | ExprBlock(..) | + ExprAssign(..) | ExprAssignOp(..) | ExprMac(..) | + ExprStruct(..) | ExprRepeat(..) | ExprParen(..) | + ExprInlineAsm(..) => { visit::walk_expr(v, expr, this); } } @@ -956,7 +956,7 @@ impl Liveness { return self.propagate_through_expr(expr, succ); } - StmtMac(*) => { + StmtMac(..) => { self.tcx.sess.span_bug(stmt.span, "unexpanded macro"); } } @@ -1073,7 +1073,7 @@ impl Liveness { self.propagate_through_loop(expr, Some(cond), blk, succ) } - ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ExprForLoop(..) => fail!("non-desugared expr_for_loop"), // Note that labels have been resolved, so we don't need to look // at the label ident @@ -1243,7 +1243,7 @@ impl Liveness { } ExprLogLevel | - ExprLit(*) => { + ExprLit(..) => { succ } @@ -1251,7 +1251,7 @@ impl Liveness { self.propagate_through_block(blk, succ) } - ExprMac(*) => { + ExprMac(..) => { self.tcx.sess.span_bug(expr.span, "unexpanded macro"); } } @@ -1493,18 +1493,18 @@ fn check_expr(this: &mut Liveness, expr: @Expr) { } // no correctness conditions related to liveness - ExprCall(*) | ExprMethodCall(*) | ExprIf(*) | ExprMatch(*) | - ExprWhile(*) | ExprLoop(*) | ExprIndex(*) | ExprField(*) | - ExprVstore(*) | ExprVec(*) | ExprTup(*) | ExprLogLevel | - ExprBinary(*) | ExprDoBody(*) | - ExprCast(*) | ExprUnary(*) | ExprRet(*) | ExprBreak(*) | - ExprAgain(*) | ExprLit(_) | ExprBlock(*) | - ExprMac(*) | ExprAddrOf(*) | ExprStruct(*) | ExprRepeat(*) | - ExprParen(*) | ExprFnBlock(*) | ExprProc(*) | ExprPath(*) | - ExprSelf(*) => { + ExprCall(..) | ExprMethodCall(..) | ExprIf(..) | ExprMatch(..) | + ExprWhile(..) | ExprLoop(..) | ExprIndex(..) | ExprField(..) | + ExprVstore(..) | ExprVec(..) | ExprTup(..) | ExprLogLevel | + ExprBinary(..) | ExprDoBody(..) | + ExprCast(..) | ExprUnary(..) | ExprRet(..) | ExprBreak(..) | + ExprAgain(..) | ExprLit(_) | ExprBlock(..) | + ExprMac(..) | ExprAddrOf(..) | ExprStruct(..) | ExprRepeat(..) | + ExprParen(..) | ExprFnBlock(..) | ExprProc(..) | ExprPath(..) | + ExprSelf(..) => { visit::walk_expr(this, expr, ()); } - ExprForLoop(*) => fail!("non-desugared expr_for_loop") + ExprForLoop(..) => fail!("non-desugared expr_for_loop") } } diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 89e19631dae..0c44f58aeb4 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -68,11 +68,11 @@ pub enum categorization { cat_arg(ast::NodeId), // formal argument cat_deref(cmt, uint, PointerKind), // deref of a ptr cat_interior(cmt, InteriorKind), // something interior: field, tuple, etc - cat_downcast(cmt), // selects a particular enum variant (*) + cat_downcast(cmt), // selects a particular enum variant (..) cat_discr(cmt, ast::NodeId), // match discriminant (see preserve()) cat_self(ast::NodeId), // explicit `self` - // (*) downcast is only required if the enum has more than one variant + // (..) downcast is only required if the enum has more than one variant } #[deriving(Eq)] @@ -159,7 +159,7 @@ pub fn opt_deref_kind(t: ty::t) -> Option { ty::ty_trait(_, _, ty::UniqTraitStore, _, _) | ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | - ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, _}) => { + ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => { Some(deref_ptr(uniq_ptr)) } @@ -174,7 +174,7 @@ pub fn opt_deref_kind(t: ty::t) -> Option { ty::ty_estr(ty::vstore_slice(r)) | ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil, - region: r, _}) => { + region: r, ..}) => { Some(deref_ptr(region_ptr(ast::MutImmutable, r))) } @@ -195,8 +195,8 @@ pub fn opt_deref_kind(t: ty::t) -> Option { Some(deref_ptr(unsafe_ptr(mt.mutbl))) } - ty::ty_enum(*) | - ty::ty_struct(*) => { // newtype + ty::ty_enum(..) | + ty::ty_struct(..) => { // newtype Some(deref_interior(InteriorField(PositionalField(0)))) } @@ -346,7 +346,7 @@ impl mem_categorization_ctxt { self.cat_expr_unadjusted(expr) } - Some(&@ty::AutoAddEnv(*)) => { + Some(&@ty::AutoAddEnv(..)) => { // Convert a bare fn to a closure by adding NULL env. // Result is an rvalue. let expr_ty = ty::expr_ty_adjusted(self.tcx, expr); @@ -356,7 +356,7 @@ impl mem_categorization_ctxt { Some( &@ty::AutoDerefRef( ty::AutoDerefRef { - autoref: Some(_), _})) => { + autoref: Some(_), ..})) => { // Equivalent to &*expr or something similar. // Result is an rvalue. let expr_ty = ty::expr_ty_adjusted(self.tcx, expr); @@ -422,21 +422,21 @@ impl mem_categorization_ctxt { ast::ExprParen(e) => self.cat_expr_unadjusted(e), - ast::ExprAddrOf(*) | ast::ExprCall(*) | - ast::ExprAssign(*) | ast::ExprAssignOp(*) | - ast::ExprFnBlock(*) | ast::ExprProc(*) | ast::ExprRet(*) | - ast::ExprDoBody(*) | ast::ExprUnary(*) | - ast::ExprMethodCall(*) | ast::ExprCast(*) | ast::ExprVstore(*) | - ast::ExprVec(*) | ast::ExprTup(*) | ast::ExprIf(*) | - ast::ExprLogLevel | ast::ExprBinary(*) | ast::ExprWhile(*) | - ast::ExprBlock(*) | ast::ExprLoop(*) | ast::ExprMatch(*) | - ast::ExprLit(*) | ast::ExprBreak(*) | ast::ExprMac(*) | - ast::ExprAgain(*) | ast::ExprStruct(*) | ast::ExprRepeat(*) | - ast::ExprInlineAsm(*) => { + ast::ExprAddrOf(..) | ast::ExprCall(..) | + ast::ExprAssign(..) | ast::ExprAssignOp(..) | + ast::ExprFnBlock(..) | ast::ExprProc(..) | ast::ExprRet(..) | + ast::ExprDoBody(..) | ast::ExprUnary(..) | + ast::ExprMethodCall(..) | ast::ExprCast(..) | ast::ExprVstore(..) | + ast::ExprVec(..) | ast::ExprTup(..) | ast::ExprIf(..) | + ast::ExprLogLevel | ast::ExprBinary(..) | ast::ExprWhile(..) | + ast::ExprBlock(..) | ast::ExprLoop(..) | ast::ExprMatch(..) | + ast::ExprLit(..) | ast::ExprBreak(..) | ast::ExprMac(..) | + ast::ExprAgain(..) | ast::ExprStruct(..) | ast::ExprRepeat(..) | + ast::ExprInlineAsm(..) => { return self.cat_rvalue_node(expr, expr_ty); } - ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop") + ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop") } } @@ -447,13 +447,13 @@ impl mem_categorization_ctxt { def: ast::Def) -> cmt { match def { - ast::DefFn(*) | ast::DefStaticMethod(*) | ast::DefMod(_) | + ast::DefFn(..) | ast::DefStaticMethod(..) | ast::DefMod(_) | ast::DefForeignMod(_) | ast::DefStatic(_, false) | - ast::DefUse(_) | ast::DefVariant(*) | + ast::DefUse(_) | ast::DefVariant(..) | ast::DefTrait(_) | ast::DefTy(_) | ast::DefPrimTy(_) | - ast::DefTyParam(*) | ast::DefStruct(*) | - ast::DefTyParamBinder(*) | ast::DefRegion(_) | - ast::DefLabel(_) | ast::DefSelfTy(*) | ast::DefMethod(*) => { + ast::DefTyParam(..) | ast::DefStruct(..) | + ast::DefTyParamBinder(..) | ast::DefRegion(_) | + ast::DefLabel(_) | ast::DefSelfTy(..) | ast::DefMethod(..) => { @cmt_ { id:id, span:span, @@ -835,7 +835,7 @@ impl mem_categorization_ctxt { // we can be sure that the binding will remain valid for the // duration of the arm. // - // (*) There is subtlety concerning the correspondence between + // (..) There is subtlety concerning the correspondence between // pattern ids and types as compared to *expression* ids and // types. This is explained briefly. on the definition of the // type `cmt`, so go off and read what it says there, then @@ -881,7 +881,7 @@ impl mem_categorization_ctxt { } ast::PatEnum(_, None) => { - // variant(*) + // variant(..) } ast::PatEnum(_, Some(ref subpats)) => { match self.tcx.def_map.find(&pat.id) { @@ -897,7 +897,7 @@ impl mem_categorization_ctxt { }; for (i, &subpat) in subpats.iter().enumerate() { - let subpat_ty = self.pat_ty(subpat); // see (*) + let subpat_ty = self.pat_ty(subpat); // see (..) let subcmt = self.cat_imm_interior( @@ -907,10 +907,10 @@ impl mem_categorization_ctxt { self.cat_pattern(subcmt, subpat, |x,y| op(x,y)); } } - Some(&ast::DefFn(*)) | - Some(&ast::DefStruct(*)) => { + Some(&ast::DefFn(..)) | + Some(&ast::DefStruct(..)) => { for (i, &subpat) in subpats.iter().enumerate() { - let subpat_ty = self.pat_ty(subpat); // see (*) + let subpat_ty = self.pat_ty(subpat); // see (..) let cmt_field = self.cat_imm_interior( pat, cmt, subpat_ty, @@ -918,7 +918,7 @@ impl mem_categorization_ctxt { self.cat_pattern(cmt_field, subpat, |x,y| op(x,y)); } } - Some(&ast::DefStatic(*)) => { + Some(&ast::DefStatic(..)) => { for &subpat in subpats.iter() { self.cat_pattern(cmt, subpat, |x,y| op(x,y)); } @@ -942,7 +942,7 @@ impl mem_categorization_ctxt { ast::PatStruct(_, ref field_pats, _) => { // {f1: p1, ..., fN: pN} for fp in field_pats.iter() { - let field_ty = self.pat_ty(fp.pat); // see (*) + let field_ty = self.pat_ty(fp.pat); // see (..) let cmt_field = self.cat_field(pat, cmt, fp.ident, field_ty); self.cat_pattern(cmt_field, fp.pat, |x,y| op(x,y)); } @@ -951,7 +951,7 @@ impl mem_categorization_ctxt { ast::PatTup(ref subpats) => { // (p1, ..., pN) for (i, &subpat) in subpats.iter().enumerate() { - let subpat_ty = self.pat_ty(subpat); // see (*) + let subpat_ty = self.pat_ty(subpat); // see (..) let subcmt = self.cat_imm_interior( pat, cmt, subpat_ty, @@ -1003,7 +1003,7 @@ impl mem_categorization_ctxt { cat_copied_upvar(_) => { ~"captured outer variable in a heap closure" } - cat_rvalue(*) => { + cat_rvalue(..) => { ~"non-lvalue" } cat_local(_) => { @@ -1012,7 +1012,7 @@ impl mem_categorization_ctxt { cat_self(_) => { ~"self value" } - cat_arg(*) => { + cat_arg(..) => { ~"argument" } cat_deref(_, _, pk) => { @@ -1069,7 +1069,7 @@ pub fn field_mutbl(tcx: ty::ctxt, } } } - ty::ty_enum(*) => { + ty::ty_enum(..) => { match tcx.def_map.get_copy(&node_id) { ast::DefVariant(_, variant_id, _) => { let r = ty::lookup_struct_fields(tcx, variant_id); @@ -1101,15 +1101,15 @@ impl cmt_ { //! determines how long the value in `self` remains live. match self.cat { - cat_rvalue(*) | + cat_rvalue(..) | cat_static_item | - cat_copied_upvar(*) | - cat_local(*) | - cat_self(*) | - cat_arg(*) | - cat_deref(_, _, unsafe_ptr(*)) | - cat_deref(_, _, gc_ptr(*)) | - cat_deref(_, _, region_ptr(*)) => { + cat_copied_upvar(..) | + cat_local(..) | + cat_self(..) | + cat_arg(..) | + cat_deref(_, _, unsafe_ptr(..)) | + cat_deref(_, _, gc_ptr(..)) | + cat_deref(_, _, region_ptr(..)) => { self } cat_downcast(b) | @@ -1137,18 +1137,18 @@ impl cmt_ { // aliased and eventually recused. match self.cat { - cat_copied_upvar(CopiedUpvar {onceness: ast::Once, _}) | - cat_rvalue(*) | - cat_local(*) | + cat_copied_upvar(CopiedUpvar {onceness: ast::Once, ..}) | + cat_rvalue(..) | + cat_local(..) | cat_arg(_) | - cat_self(*) | - cat_deref(_, _, unsafe_ptr(*)) | // of course it is aliasable, but... + cat_self(..) | + cat_deref(_, _, unsafe_ptr(..)) | // of course it is aliasable, but... cat_deref(_, _, region_ptr(MutMutable, _)) => { None } - cat_copied_upvar(CopiedUpvar {onceness: ast::Many, _}) | - cat_static_item(*) => { + cat_copied_upvar(CopiedUpvar {onceness: ast::Many, ..}) | + cat_static_item(..) => { Some(AliasableOther) } @@ -1160,11 +1160,11 @@ impl cmt_ { Some(AliasableBorrowed(m)) } - cat_downcast(*) | - cat_stack_upvar(*) | + cat_downcast(..) | + cat_stack_upvar(..) | cat_deref(_, _, uniq_ptr) | - cat_interior(*) | - cat_discr(*) => { + cat_interior(..) | + cat_discr(..) => { None } } @@ -1185,11 +1185,11 @@ impl Repr for categorization { fn repr(&self, tcx: ty::ctxt) -> ~str { match *self { cat_static_item | - cat_rvalue(*) | - cat_copied_upvar(*) | - cat_local(*) | - cat_self(*) | - cat_arg(*) => { + cat_rvalue(..) | + cat_copied_upvar(..) | + cat_local(..) | + cat_self(..) | + cat_arg(..) => { format!("{:?}", *self) } cat_deref(cmt, derefs, ptr) => { @@ -1233,8 +1233,8 @@ impl Repr for InteriorKind { fn element_kind(t: ty::t) -> ElementKind { match ty::get(t).sty { - ty::ty_evec(*) => VecElement, - ty::ty_estr(*) => StrElement, + ty::ty_evec(..) => VecElement, + ty::ty_estr(..) => StrElement, _ => OtherElement } } diff --git a/src/librustc/middle/moves.rs b/src/librustc/middle/moves.rs index 93465dc9bac..f23ebac5e96 100644 --- a/src/librustc/middle/moves.rs +++ b/src/librustc/middle/moves.rs @@ -322,14 +322,14 @@ impl VisitContext { let comp_mode = match self.tcx.adjustments.find(&expr.id) { Some(&@ty::AutoDerefRef( ty::AutoDerefRef { - autoref: Some(_), _})) => Read, + autoref: Some(_), ..})) => Read, _ => expr_mode }; debug!("comp_mode = {:?}", comp_mode); match expr.node { - ExprPath(*) | ExprSelf => { + ExprPath(..) | ExprSelf => { match comp_mode { Move => { let def = self.tcx.def_map.get_copy(&expr.id); @@ -372,7 +372,7 @@ impl VisitContext { Many => Read, } }, - ty::ty_bare_fn(*) => Read, + ty::ty_bare_fn(..) => Read, ref x => self.tcx.sess.span_bug(callee.span, format!("non-function type in moves for expr_call: {:?}", x)), @@ -484,10 +484,10 @@ impl VisitContext { } ExprLogLevel | - ExprInlineAsm(*) | - ExprBreak(*) | - ExprAgain(*) | - ExprLit(*) => {} + ExprInlineAsm(..) | + ExprBreak(..) | + ExprAgain(..) | + ExprLit(..) => {} ExprLoop(ref blk, _) => { self.consume_block(blk); @@ -498,7 +498,7 @@ impl VisitContext { self.consume_block(blk); } - ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ExprUnary(_, _, lhs) => { if !self.use_overloaded_operator(expr, lhs, []) @@ -567,7 +567,7 @@ impl VisitContext { self.use_expr(base, comp_mode); } - ExprMac(*) => { + ExprMac(..) => { self.tcx.sess.span_bug( expr.span, "macro expression remains after expansion"); diff --git a/src/librustc/middle/pat_util.rs b/src/librustc/middle/pat_util.rs index 69e9e4d880d..9ef7a5f147d 100644 --- a/src/librustc/middle/pat_util.rs +++ b/src/librustc/middle/pat_util.rs @@ -30,9 +30,9 @@ pub fn pat_id_map(dm: resolve::DefMap, pat: &Pat) -> PatIdMap { pub fn pat_is_variant_or_struct(dm: resolve::DefMap, pat: &Pat) -> bool { match pat.node { - PatEnum(_, _) | PatIdent(_, _, None) | PatStruct(*) => { + PatEnum(_, _) | PatIdent(_, _, None) | PatStruct(..) => { match dm.find(&pat.id) { - Some(&DefVariant(*)) | Some(&DefStruct(*)) => true, + Some(&DefVariant(..)) | Some(&DefStruct(..)) => true, _ => false } } @@ -42,7 +42,7 @@ pub fn pat_is_variant_or_struct(dm: resolve::DefMap, pat: &Pat) -> bool { pub fn pat_is_const(dm: resolve::DefMap, pat: &Pat) -> bool { match pat.node { - PatIdent(_, _, None) | PatEnum(*) => { + PatIdent(_, _, None) | PatEnum(..) => { match dm.find(&pat.id) { Some(&DefStatic(_, false)) => true, _ => false @@ -54,7 +54,7 @@ pub fn pat_is_const(dm: resolve::DefMap, pat: &Pat) -> bool { pub fn pat_is_binding(dm: resolve::DefMap, pat: &Pat) -> bool { match pat.node { - PatIdent(*) => { + PatIdent(..) => { !pat_is_variant_or_struct(dm, pat) && !pat_is_const(dm, pat) } @@ -64,7 +64,7 @@ pub fn pat_is_binding(dm: resolve::DefMap, pat: &Pat) -> bool { pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: &Pat) -> bool { match pat.node { - PatIdent(*) => pat_is_binding(dm, pat), + PatIdent(..) => pat_is_binding(dm, pat), PatWild | PatWildMulti => true, _ => false } @@ -93,7 +93,7 @@ pub fn pat_binding_ids(dm: resolve::DefMap, pat: &Pat) -> ~[NodeId] { } /// Checks if the pattern contains any patterns that bind something to -/// an ident, e.g. `foo`, or `Foo(foo)` or `foo @ Bar(*)`. +/// an ident, e.g. `foo`, or `Foo(foo)` or `foo @ Bar(..)`. pub fn pat_contains_bindings(dm: resolve::DefMap, pat: &Pat) -> bool { let mut contains_bindings = false; walk_pat(pat, |p| { diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs index c2a21905be6..100d9329f18 100644 --- a/src/librustc/middle/privacy.rs +++ b/src/librustc/middle/privacy.rs @@ -50,7 +50,7 @@ impl Visitor<()> for ParentVisitor { let prev = self.curparent; match item.node { - ast::item_mod(*) => { self.curparent = item.id; } + ast::item_mod(..) => { self.curparent = item.id; } // Enum variants are parented to the enum definition itself beacuse // they inherit privacy ast::item_enum(ref def, _) => { @@ -173,7 +173,7 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> { match item.node { // impls/extern blocks do not break the "public chain" because they // cannot have visibility qualifiers on them anyway - ast::item_impl(*) | ast::item_foreign_mod(*) => {} + ast::item_impl(..) | ast::item_foreign_mod(..) => {} // Private by default, hence we only retain the "public chain" if // `pub` is explicitly listed. @@ -221,7 +221,7 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> { let public_ty = match ty.node { ast::ty_path(_, _, id) => { match self.tcx.def_map.get_copy(&id) { - ast::DefPrimTy(*) => true, + ast::DefPrimTy(..) => true, def => { let did = def_id_of_def(def); !is_local(did) || @@ -404,12 +404,12 @@ impl<'self> PrivacyVisitor<'self> { // where the method was defined? Some(&ast_map::node_method(ref m, imp, _)) => { match ty::impl_trait_ref(self.tcx, imp) { - Some(*) => return Allowable, + Some(..) => return Allowable, _ if m.vis == ast::public => return Allowable, _ => m.vis } } - Some(&ast_map::node_trait_method(*)) => { + Some(&ast_map::node_trait_method(..)) => { return Allowable; } @@ -494,15 +494,15 @@ impl<'self> PrivacyVisitor<'self> { match self.tcx.items.find(&id) { Some(&ast_map::node_item(item, _)) => { let desc = match item.node { - ast::item_mod(*) => "module", - ast::item_trait(*) => "trait", + ast::item_mod(..) => "module", + ast::item_trait(..) => "trait", _ => return false, }; let msg = format!("{} `{}` is private", desc, token::ident_to_str(&item.ident)); self.tcx.sess.span_note(span, msg); } - Some(*) | None => {} + Some(..) | None => {} } } Allowable => return true @@ -516,7 +516,7 @@ impl<'self> PrivacyVisitor<'self> { match self.def_privacy(variant_info.id) { Allowable => {} - ExternallyDenied | DisallowedBy(*) => { + ExternallyDenied | DisallowedBy(..) => { self.tcx.sess.span_err(span, "can only dereference enums \ with a single, public variant"); } @@ -569,16 +569,16 @@ impl<'self> PrivacyVisitor<'self> { } }; match self.tcx.def_map.get_copy(&path_id) { - ast::DefStaticMethod(*) => ck("static method"), - ast::DefFn(*) => ck("function"), - ast::DefStatic(*) => ck("static"), - ast::DefVariant(*) => ck("variant"), - ast::DefTy(*) => ck("type"), - ast::DefTrait(*) => ck("trait"), - ast::DefStruct(*) => ck("struct"), - ast::DefMethod(_, Some(*)) => ck("trait method"), - ast::DefMethod(*) => ck("method"), - ast::DefMod(*) => ck("module"), + ast::DefStaticMethod(..) => ck("static method"), + ast::DefFn(..) => ck("function"), + ast::DefStatic(..) => ck("static"), + ast::DefVariant(..) => ck("variant"), + ast::DefTy(..) => ck("type"), + ast::DefTrait(..) => ck("trait"), + ast::DefStruct(..) => ck("struct"), + ast::DefMethod(_, Some(..)) => ck("trait method"), + ast::DefMethod(..) => ck("method"), + ast::DefMod(..) => ck("module"), _ => {} } } @@ -592,8 +592,8 @@ impl<'self> PrivacyVisitor<'self> { } // Trait methods are always all public. The only controlling factor // is whether the trait itself is accessible or not. - method_param(method_param { trait_id: trait_id, _ }) | - method_object(method_object { trait_id: trait_id, _ }) => { + method_param(method_param { trait_id: trait_id, .. }) | + method_object(method_object { trait_id: trait_id, .. }) => { self.ensure_public(span, trait_id, None, "source trait"); } } @@ -707,7 +707,7 @@ impl<'self> Visitor<()> for PrivacyVisitor<'self> { fn visit_view_item(&mut self, a: &ast::view_item, _: ()) { match a.node { - ast::view_item_extern_mod(*) => {} + ast::view_item_extern_mod(..) => {} ast::view_item_use(ref uses) => { for vpath in uses.iter() { match vpath.node { @@ -793,7 +793,7 @@ impl Visitor<()> for SanePrivacyVisitor { } let orig_in_fn = util::replace(&mut self.in_fn, match item.node { - ast::item_mod(*) => false, // modules turn privacy back on + ast::item_mod(..) => false, // modules turn privacy back on _ => self.in_fn, // otherwise we inherit }); visit::walk_item(self, item, ()); @@ -842,14 +842,14 @@ impl SanePrivacyVisitor { ast::named_field(_, ast::private) => { // Fields should really be private by default... } - ast::named_field(*) | ast::unnamed_field => {} + ast::named_field(..) | ast::unnamed_field => {} } } }; match item.node { // implementations of traits don't need visibility qualifiers because // that's controlled by having the trait in scope. - ast::item_impl(_, Some(*), _, ref methods) => { + ast::item_impl(_, Some(..), _, ref methods) => { check_inherited(item.span, item.vis, "visibility qualifiers have no effect on trait \ impls"); @@ -896,7 +896,7 @@ impl SanePrivacyVisitor { match v.node.kind { ast::struct_variant_kind(ref s) => check_struct(s), - ast::tuple_variant_kind(*) => {} + ast::tuple_variant_kind(..) => {} } } } @@ -910,14 +910,14 @@ impl SanePrivacyVisitor { check_inherited(m.span, m.vis, "unnecessary visibility"); } - ast::required(*) => {} + ast::required(..) => {} } } } - ast::item_static(*) | - ast::item_fn(*) | ast::item_mod(*) | ast::item_ty(*) | - ast::item_mac(*) => { + ast::item_static(..) | + ast::item_fn(..) | ast::item_mod(..) | ast::item_ty(..) | + ast::item_mac(..) => { check_not_priv(item.span, item.vis, "items are private by \ default"); } @@ -959,7 +959,7 @@ impl SanePrivacyVisitor { match v.node.kind { ast::struct_variant_kind(ref s) => check_struct(s), - ast::tuple_variant_kind(*) => {} + ast::tuple_variant_kind(..) => {} } } } @@ -969,15 +969,15 @@ impl SanePrivacyVisitor { ast::item_trait(_, _, ref methods) => { for m in methods.iter() { match *m { - ast::required(*) => {} + ast::required(..) => {} ast::provided(ref m) => check_inherited(m.span, m.vis), } } } - ast::item_static(*) | - ast::item_fn(*) | ast::item_mod(*) | ast::item_ty(*) | - ast::item_mac(*) => {} + ast::item_static(..) | + ast::item_fn(..) | ast::item_mod(..) | ast::item_ty(..) | + ast::item_mac(..) => {} } } } diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 02ac4c52084..bc62e6afeee 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -73,7 +73,7 @@ fn method_might_be_inlined(tcx: ty::ctxt, method: &ast::method, if is_local(impl_src) { match tcx.items.find(&impl_src.node) { Some(&ast_map::node_item(item, _)) => item_might_be_inlined(item), - Some(*) | None => { + Some(..) | None => { tcx.sess.span_bug(method.span, "impl did is not an item") } } @@ -134,11 +134,11 @@ impl Visitor<()> for MarkSymbolVisitor { } self.reachable_symbols.insert(def_id.node); } - ast::ExprMethodCall(*) => { + ast::ExprMethodCall(..) => { match self.method_map.find(&expr.id) { Some(&typeck::method_map_entry { origin: typeck::method_static(def_id), - _ + .. }) => { if ReachableContext:: def_id_represents_local_inlined_item( @@ -191,7 +191,7 @@ impl ReachableContext { match tcx.items.find(&node_id) { Some(&ast_map::node_item(item, _)) => { match item.node { - ast::item_fn(*) => item_might_be_inlined(item), + ast::item_fn(..) => item_might_be_inlined(item), _ => false, } } @@ -313,10 +313,10 @@ impl ReachableContext { // These are normal, nothing reachable about these // inherently and their children are already in the // worklist, as determined by the privacy pass - ast::item_static(*) | ast::item_ty(*) | - ast::item_mod(*) | ast::item_foreign_mod(*) | - ast::item_impl(*) | ast::item_trait(*) | - ast::item_struct(*) | ast::item_enum(*) => {} + ast::item_static(..) | ast::item_ty(..) | + ast::item_mod(..) | ast::item_foreign_mod(..) | + ast::item_impl(..) | ast::item_trait(..) | + ast::item_struct(..) | ast::item_enum(..) => {} _ => { self.tcx.sess.span_bug(item.span, @@ -327,7 +327,7 @@ impl ReachableContext { } ast_map::node_trait_method(trait_method, _, _) => { match *trait_method { - ast::required(*) => { + ast::required(..) => { // Keep going, nothing to get exported } ast::provided(ref method) => { @@ -341,9 +341,9 @@ impl ReachableContext { } } // Nothing to recurse on for these - ast_map::node_foreign_item(*) | - ast_map::node_variant(*) | - ast_map::node_struct_ctor(*) => {} + ast_map::node_foreign_item(..) | + ast_map::node_variant(..) | + ast_map::node_struct_ctor(..) => {} _ => { let ident_interner = token::get_ident_interner(); let desc = ast_map::node_id_to_str(self.tcx.items, diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index b0568834ed4..fc7dfdf5624 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -351,7 +351,7 @@ fn resolve_stmt(visitor: &mut RegionResolutionVisitor, stmt: @ast::Stmt, cx: Context) { match stmt.node { - ast::StmtDecl(*) => { + ast::StmtDecl(..) => { visit::walk_stmt(visitor, stmt, cx); } ast::StmtExpr(_, stmt_id) | @@ -360,7 +360,7 @@ fn resolve_stmt(visitor: &mut RegionResolutionVisitor, let expr_cx = Context {parent: Some(stmt_id), ..cx}; visit::walk_stmt(visitor, stmt, expr_cx); } - ast::StmtMac(*) => visitor.sess.bug("unexpanded macro") + ast::StmtMac(..) => visitor.sess.bug("unexpanded macro") } } @@ -372,8 +372,8 @@ fn resolve_expr(visitor: &mut RegionResolutionVisitor, let mut new_cx = cx; new_cx.parent = Some(expr.id); match expr.node { - ast::ExprAssignOp(*) | ast::ExprIndex(*) | ast::ExprBinary(*) | - ast::ExprUnary(*) | ast::ExprCall(*) | ast::ExprMethodCall(*) => { + ast::ExprAssignOp(..) | ast::ExprIndex(..) | ast::ExprBinary(..) | + ast::ExprUnary(..) | ast::ExprCall(..) | ast::ExprMethodCall(..) => { // FIXME(#6268) Nested method calls // // The lifetimes for a call or method call look as follows: @@ -394,7 +394,7 @@ fn resolve_expr(visitor: &mut RegionResolutionVisitor, // parent_to_expr(new_cx, expr.callee_id); } - ast::ExprMatch(*) => { + ast::ExprMatch(..) => { new_cx.var_parent = Some(expr.id); } @@ -452,12 +452,12 @@ fn resolve_fn(visitor: &mut RegionResolutionVisitor, // The body of the fn itself is either a root scope (top-level fn) // or it continues with the inherited scope (closures). let body_cx = match *fk { - visit::fk_item_fn(*) | - visit::fk_method(*) => { + visit::fk_item_fn(..) | + visit::fk_method(..) => { Context {parent: None, var_parent: None, ..cx} } - visit::fk_anon(*) | - visit::fk_fn_block(*) => { + visit::fk_anon(..) | + visit::fk_fn_block(..) => { cx } }; diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index 49f26568d37..0d4c23d3dfb 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -1149,7 +1149,7 @@ impl Resolver { let is_public = item.vis == ast::public; match item.node { - item_mod(*) => { + item_mod(..) => { let (name_bindings, new_parent) = self.add_child(ident, parent, ForbidDuplicateModules, sp); @@ -1165,7 +1165,7 @@ impl Resolver { ModuleReducedGraphParent(name_bindings.get_module()) } - item_foreign_mod(*) => parent, + item_foreign_mod(..) => parent, // These items live in the value namespace. item_static(_, m, _) => { @@ -1187,7 +1187,7 @@ impl Resolver { } // These items live in the type namespace. - item_ty(*) => { + item_ty(..) => { let (name_bindings, _) = self.add_child(ident, parent, ForbidDuplicateTypes, sp); @@ -1253,7 +1253,7 @@ impl Resolver { match ty { &Ty { node: ty_path(ref path, _, _), - _ + .. } if path.segments.len() == 1 => { let name = path_to_ident(path); @@ -1395,7 +1395,7 @@ impl Resolver { new_parent } - item_mac(*) => { + item_mac(..) => { fail!("item macros unimplemented") } } @@ -1622,7 +1622,7 @@ impl Resolver { DefMod(def_id) | DefForeignMod(def_id) | DefStruct(def_id) | DefTy(def_id) => { match child_name_bindings.type_def { - Some(TypeNsDef { module_def: Some(module_def), _ }) => { + Some(TypeNsDef { module_def: Some(module_def), .. }) => { debug!("(building reduced graph for external crate) \ already created module"); module_def.def_id = Some(def_id); @@ -1662,7 +1662,7 @@ impl Resolver { child_name_bindings.define_value(def, dummy_sp(), is_public); } } - DefFn(*) | DefStaticMethod(*) | DefStatic(*) => { + DefFn(..) | DefStaticMethod(..) | DefStatic(..) => { debug!("(building reduced graph for external \ crate) building value (fn/static) {}", final_ident); child_name_bindings.define_value(def, dummy_sp(), is_public); @@ -1732,15 +1732,15 @@ impl Resolver { } self.structs.insert(def_id); } - DefMethod(*) => { + DefMethod(..) => { debug!("(building reduced graph for external crate) \ ignoring {:?}", def); // Ignored; handled elsewhere. } - DefSelf(*) | DefArg(*) | DefLocal(*) | - DefPrimTy(*) | DefTyParam(*) | DefBinding(*) | - DefUse(*) | DefUpvar(*) | DefRegion(*) | - DefTyParamBinder(*) | DefLabel(*) | DefSelfTy(*) => { + DefSelf(..) | DefArg(..) | DefLocal(..) | + DefPrimTy(..) | DefTyParam(..) | DefBinding(..) | + DefUse(..) | DefUpvar(..) | DefRegion(..) | + DefTyParamBinder(..) | DefLabel(..) | DefSelfTy(..) => { fail!("didn't expect `{:?}`", def); } } @@ -1817,7 +1817,7 @@ impl Resolver { match child_name_bindings.type_def { Some(TypeNsDef { module_def: Some(module_def), - _ + .. }) => { // We already have a module. This // is OK. @@ -2211,7 +2211,7 @@ impl Resolver { assert!(module_.glob_count >= 1); module_.glob_count -= 1; } - SingleImport(*) => { + SingleImport(..) => { // Ignore. } } @@ -2278,7 +2278,7 @@ impl Resolver { // search imports as well. let mut used_reexport = false; match (value_result, type_result) { - (BoundResult(*), BoundResult(*)) => {} // Continue. + (BoundResult(..), BoundResult(..)) => {} // Continue. _ => { // If there is an unresolved glob at this point in the // containing module, bail out. We don't know enough to be @@ -2365,7 +2365,7 @@ impl Resolver { // external modules. let mut used_public = false; match type_result { - BoundResult(*) => {} + BoundResult(..) => {} _ => { match containing_module.external_module_children .find(&source.name) { @@ -3386,16 +3386,16 @@ impl Resolver { let is_ty_param; match def_like { - DlDef(d @ DefLocal(*)) | DlDef(d @ DefUpvar(*)) | - DlDef(d @ DefArg(*)) | DlDef(d @ DefBinding(*)) => { + DlDef(d @ DefLocal(..)) | DlDef(d @ DefUpvar(..)) | + DlDef(d @ DefArg(..)) | DlDef(d @ DefBinding(..)) => { def = d; is_ty_param = false; } - DlDef(d @ DefTyParam(*)) => { + DlDef(d @ DefTyParam(..)) => { def = d; is_ty_param = true; } - DlDef(d @ DefSelf(*)) + DlDef(d @ DefSelf(..)) if allow_capturing_self == DontAllowCapturingSelf => { def = d; is_ty_param = false; @@ -3666,7 +3666,7 @@ impl Resolver { *foreign_item, ())); } - foreign_item_static(*) => { + foreign_item_static(..) => { visit::walk_foreign_item(this, *foreign_item, ()); @@ -3688,13 +3688,13 @@ impl Resolver { NoSelfBinding); } - item_static(*) => { + item_static(..) => { self.with_constant_rib(|this| { visit::walk_item(this, item, ()); }); } - item_mac(*) => { + item_mac(..) => { fail!("item macros unimplemented") } } @@ -3734,7 +3734,7 @@ impl Resolver { f(self); match type_parameters { - HasTypeParameters(*) => { + HasTypeParameters(..) => { self.type_ribs.pop(); } @@ -4282,7 +4282,7 @@ impl Resolver { "an enum variant"); self.record_def(pattern.id, (def, lp)); } - FoundStructOrEnumVariant(*) => { + FoundStructOrEnumVariant(..) => { self.resolve_error(pattern.span, format!("declaration of `{}` \ shadows an enum \ @@ -4301,7 +4301,7 @@ impl Resolver { "a constant"); self.record_def(pattern.id, (def, lp)); } - FoundConst(*) => { + FoundConst(..) => { self.resolve_error(pattern.span, "only irrefutable patterns \ allowed here"); @@ -4384,11 +4384,11 @@ impl Resolver { PatIdent(binding_mode, ref path, _) => { // This must be an enum variant, struct, or constant. match self.resolve_path(pat_id, path, ValueNS, false) { - Some(def @ (DefVariant(*), _)) | - Some(def @ (DefStruct(*), _)) => { + Some(def @ (DefVariant(..), _)) | + Some(def @ (DefStruct(..), _)) => { self.record_def(pattern.id, def); } - Some(def @ (DefStatic(*), _)) => { + Some(def @ (DefStatic(..), _)) => { self.enforce_default_binding_mode( pattern, binding_mode, @@ -4419,10 +4419,10 @@ impl Resolver { PatEnum(ref path, _) => { // This must be an enum variant, struct or const. match self.resolve_path(pat_id, path, ValueNS, false) { - Some(def @ (DefFn(*), _)) | - Some(def @ (DefVariant(*), _)) | - Some(def @ (DefStruct(*), _)) | - Some(def @ (DefStatic(*), _)) => { + Some(def @ (DefFn(..), _)) | + Some(def @ (DefVariant(..), _)) | + Some(def @ (DefStruct(..), _)) | + Some(def @ (DefStatic(..), _)) => { self.record_def(pattern.id, def); } Some(_) => { @@ -4516,7 +4516,7 @@ impl Resolver { // considered as not having a private component because // the lookup happened only within the current module. match def.def { - def @ DefVariant(*) | def @ DefStruct(*) => { + def @ DefVariant(..) | def @ DefStruct(..) => { return FoundStructOrEnumVariant(def, AllPublic); } def @ DefStatic(_, false) => { @@ -4655,7 +4655,7 @@ impl Resolver { None => {} } } - Some(*) | None => {} // Continue. + Some(..) | None => {} // Continue. } // Finally, search through external children. @@ -4975,7 +4975,7 @@ impl Resolver { // First-class methods are not supported yet; error // out here. match def { - (DefMethod(*), _) => { + (DefMethod(..), _) => { self.resolve_error(expr.span, "first-class methods \ are not supported"); @@ -5078,7 +5078,7 @@ impl Resolver { }) } - ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ExprBreak(Some(label)) | ExprAgain(Some(label)) => { match self.search_ribs(self.label_ribs, label, expr.span, @@ -5192,7 +5192,7 @@ impl Resolver { let i = self.lang_items.not_trait(); self.add_fixed_trait_for_expr(expr.id, i); } - ExprIndex(*) => { + ExprIndex(..) => { let i = self.lang_items.index_trait(); self.add_fixed_trait_for_expr(expr.id, i); } @@ -5345,7 +5345,7 @@ impl Resolver { descr: &str) { match pat_binding_mode { BindByValue(_) => {} - BindByRef(*) => { + BindByRef(..) => { self.resolve_error( pat.span, format!("cannot use `ref` binding mode with {}", @@ -5375,7 +5375,7 @@ impl Resolver { if vi.span == dummy_sp() { return } match vi.node { - view_item_extern_mod(*) => {} // ignore + view_item_extern_mod(..) => {} // ignore view_item_use(ref path) => { for p in path.iter() { match p.node { @@ -5486,7 +5486,7 @@ pub fn resolve_crate(session: Session, let mut resolver = Resolver(session, lang_items, crate.span); resolver.resolve(crate); let Resolver { def_map, export_map2, trait_map, last_private, - external_exports, _ } = resolver; + external_exports, .. } = resolver; CrateMap { def_map: def_map, exp_map2: export_map2, diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index b21720f2e30..fe1e2036b92 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -60,11 +60,11 @@ impl<'self> Visitor<&'self ScopeChain<'self>> for LifetimeContext { item: @ast::item, _: &'self ScopeChain<'self>) { let scope = match item.node { - ast::item_fn(*) | // fn lifetimes get added in visit_fn below - ast::item_mod(*) | - ast::item_mac(*) | - ast::item_foreign_mod(*) | - ast::item_static(*) => { + ast::item_fn(..) | // fn lifetimes get added in visit_fn below + ast::item_mod(..) | + ast::item_mac(..) | + ast::item_foreign_mod(..) | + ast::item_static(..) => { RootScope } ast::item_ty(_, ref generics) | @@ -97,7 +97,7 @@ impl<'self> Visitor<&'self ScopeChain<'self>> for LifetimeContext { visit::walk_fn(self, fk, fd, b, s, n, &scope1); debug!("popping fn scope id={} due to item/method", n); } - visit::fk_anon(*) | visit::fk_fn_block(*) => { + visit::fk_anon(..) | visit::fk_fn_block(..) => { visit::walk_fn(self, fk, fd, b, s, n, scope); } } @@ -107,8 +107,8 @@ impl<'self> Visitor<&'self ScopeChain<'self>> for LifetimeContext { ty: &ast::Ty, scope: &'self ScopeChain<'self>) { match ty.node { - ast::ty_closure(@ast::TyClosure { lifetimes: ref lifetimes, _ }) | - ast::ty_bare_fn(@ast::TyBareFn { lifetimes: ref lifetimes, _ }) => { + ast::ty_closure(@ast::TyClosure { lifetimes: ref lifetimes, .. }) | + ast::ty_bare_fn(@ast::TyBareFn { lifetimes: ref lifetimes, .. }) => { let scope1 = FnScope(ty.id, lifetimes, scope); self.check_lifetime_names(lifetimes); debug!("pushing fn scope id={} due to type", ty.id); diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index 1162f845ed0..bd87ab43650 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -358,7 +358,7 @@ fn variant_opt(bcx: @mut Block, pat_id: ast::NodeId) } unreachable!(); } - ast::DefFn(*) | + ast::DefFn(..) | ast::DefStruct(_) => { return lit(UnitLikeStructLit(pat_id)); } @@ -618,7 +618,7 @@ fn enter_opt<'r>(bcx: @mut Block, let mut i = 0; enter_match(bcx, tcx.def_map, m, col, val, |p| { let answer = match p.node { - ast::PatEnum(*) | + ast::PatEnum(..) | ast::PatIdent(_, _, None) if pat_is_const(tcx.def_map, p) => { let const_def = tcx.def_map.get_copy(&p.id); let const_def_id = ast_util::def_id_of_def(const_def); @@ -724,7 +724,7 @@ fn enter_opt<'r>(bcx: @mut Block, // submatch. Thus, including a default match would // cause the default match to fire spuriously. match *opt { - vec_len(*) => None, + vec_len(..) => None, _ => Some(vec::from_elem(variant_size, dummy)) } } @@ -935,15 +935,15 @@ fn get_options(bcx: @mut Block, m: &[Match], col: uint) -> ~[Opt] { ast::PatLit(l) => { add_to_set(ccx.tcx, &mut found, lit(ExprLit(l))); } - ast::PatIdent(*) => { + ast::PatIdent(..) => { // This is one of: an enum variant, a unit-like struct, or a // variable binding. match ccx.tcx.def_map.find(&cur.id) { - Some(&ast::DefVariant(*)) => { + Some(&ast::DefVariant(..)) => { add_to_set(ccx.tcx, &mut found, variant_opt(bcx, cur.id)); } - Some(&ast::DefStruct(*)) => { + Some(&ast::DefStruct(..)) => { add_to_set(ccx.tcx, &mut found, lit(UnitLikeStructLit(cur.id))); } @@ -954,12 +954,12 @@ fn get_options(bcx: @mut Block, m: &[Match], col: uint) -> ~[Opt] { _ => {} } } - ast::PatEnum(*) | ast::PatStruct(*) => { + ast::PatEnum(..) | ast::PatStruct(..) => { // This could be one of: a tuple-like enum variant, a // struct-like enum variant, or a struct. match ccx.tcx.def_map.find(&cur.id) { - Some(&ast::DefFn(*)) | - Some(&ast::DefVariant(*)) => { + Some(&ast::DefFn(..)) | + Some(&ast::DefVariant(..)) => { add_to_set(ccx.tcx, &mut found, variant_opt(bcx, cur.id)); } @@ -1078,7 +1078,7 @@ fn collect_record_or_struct_fields(bcx: @mut Block, match br.pats[col].node { ast::PatStruct(_, ref fs, _) => { match ty::get(node_id_type(bcx, br.pats[col].id)).sty { - ty::ty_struct(*) => { + ty::ty_struct(..) => { extend(&mut fields, *fs); found = true; } @@ -1168,8 +1168,8 @@ fn any_tuple_struct_pat(bcx: @mut Block, m: &[Match], col: uint) -> bool { match pat.node { ast::PatEnum(_, Some(_)) => { match bcx.tcx().def_map.find(&pat.id) { - Some(&ast::DefFn(*)) | - Some(&ast::DefStruct(*)) => true, + Some(&ast::DefFn(..)) | + Some(&ast::DefStruct(..)) => true, _ => false } } @@ -1599,7 +1599,7 @@ fn compile_submatch_continue(mut bcx: @mut Block, let pat_ty = node_id_type(bcx, pat_id); let llbox = Load(bcx, val); let unboxed = match ty::get(pat_ty).sty { - ty::ty_uniq(*) if !ty::type_contents(bcx.tcx(), pat_ty).owns_managed() => llbox, + ty::ty_uniq(..) if !ty::type_contents(bcx.tcx(), pat_ty).owns_managed() => llbox, _ => GEPi(bcx, llbox, [0u, abi::box_field_body]) }; compile_submatch(bcx, enter_uniq(bcx, dm, m, col, val), @@ -1636,7 +1636,7 @@ fn compile_submatch_continue(mut bcx: @mut Block, test_val = Load(bcx, val); kind = compare; }, - vec_len(*) => { + vec_len(..) => { let vt = tvec::vec_types(bcx, node_id_type(bcx, pat_id)); let unboxed = load_if_immediate(bcx, val, vt.vec_ty); let (_, len) = tvec::get_base_and_len(bcx, unboxed, vt.vec_ty); @@ -1708,7 +1708,7 @@ fn compile_submatch_continue(mut bcx: @mut Block, t, ast::BiGe) } range_result( - Result {val: vbegin, _}, + Result {val: vbegin, ..}, Result {bcx, val: vend}) => { let Result {bcx, val: llge} = compare_scalar_types( @@ -1748,7 +1748,7 @@ fn compile_submatch_continue(mut bcx: @mut Block, rslt(bcx, value) } range_result( - Result {val: vbegin, _}, + Result {val: vbegin, ..}, Result {bcx, val: vend}) => { let llge = compare_scalar_values( @@ -2172,8 +2172,8 @@ fn bind_irrefutable_pat(bcx: @mut Block, } } } - Some(&ast::DefFn(*)) | - Some(&ast::DefStruct(*)) => { + Some(&ast::DefFn(..)) | + Some(&ast::DefStruct(..)) => { match *sub_pats { None => { // This is a unit-like struct. Nothing to do here. @@ -2221,7 +2221,7 @@ fn bind_irrefutable_pat(bcx: @mut Block, let pat_ty = node_id_type(bcx, pat.id); let llbox = Load(bcx, val); let unboxed = match ty::get(pat_ty).sty { - ty::ty_uniq(*) if !ty::type_contents(bcx.tcx(), pat_ty).owns_managed() => llbox, + ty::ty_uniq(..) if !ty::type_contents(bcx.tcx(), pat_ty).owns_managed() => llbox, _ => GEPi(bcx, llbox, [0u, abi::box_field_body]) }; bcx = bind_irrefutable_pat(bcx, inner, unboxed, binding_mode); @@ -2230,7 +2230,7 @@ fn bind_irrefutable_pat(bcx: @mut Block, let loaded_val = Load(bcx, val); bcx = bind_irrefutable_pat(bcx, inner, loaded_val, binding_mode); } - ast::PatVec(*) => { + ast::PatVec(..) => { bcx.tcx().sess.span_bug( pat.span, format!("vector patterns are never irrefutable!")); diff --git a/src/librustc/middle/trans/adt.rs b/src/librustc/middle/trans/adt.rs index d6631f6d833..7893a63fa5d 100644 --- a/src/librustc/middle/trans/adt.rs +++ b/src/librustc/middle/trans/adt.rs @@ -247,7 +247,7 @@ pub fn is_ffi_safe(tcx: ty::ctxt, def_id: ast::DefId) -> bool { } } -// NOTE this should probably all be in ty +// this should probably all be in ty struct Case { discr: Disr, tys: ~[ty::t] } impl Case { fn is_zerolen(&self, cx: &mut CrateContext) -> bool { @@ -386,8 +386,8 @@ pub fn incomplete_type_of(cx: &mut CrateContext, r: &Repr, name: &str) -> Type { } pub fn finish_type_of(cx: &mut CrateContext, r: &Repr, llty: &mut Type) { match *r { - CEnum(*) | General(*) => { } - Univariant(ref st, _) | NullablePointer{ nonnull: ref st, _ } => + CEnum(..) | General(..) => { } + Univariant(ref st, _) | NullablePointer{ nonnull: ref st, .. } => llty.set_struct_body(struct_llfields(cx, st, false), st.packed) } } @@ -395,7 +395,7 @@ pub fn finish_type_of(cx: &mut CrateContext, r: &Repr, llty: &mut Type) { fn generic_type_of(cx: &mut CrateContext, r: &Repr, name: Option<&str>, sizing: bool) -> Type { match *r { CEnum(ity, _, _) => ll_inttype(cx, ity), - Univariant(ref st, _) | NullablePointer{ nonnull: ref st, _ } => { + Univariant(ref st, _) | NullablePointer{ nonnull: ref st, .. } => { match name { None => Type::struct_(struct_llfields(cx, st, sizing), st.packed), Some(name) => { assert_eq!(sizing, false); Type::named_struct(name) } @@ -461,13 +461,13 @@ fn struct_llfields(cx: &mut CrateContext, st: &Struct, sizing: bool) -> ~[Type] pub fn trans_switch(bcx: @mut Block, r: &Repr, scrutinee: ValueRef) -> (_match::branch_kind, Option) { match *r { - CEnum(*) | General(*) => { + CEnum(..) | General(..) => { (_match::switch, Some(trans_get_discr(bcx, r, scrutinee, None))) } - NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { + NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => { (_match::switch, Some(nullable_bitdiscr(bcx, nonnull, nndiscr, ptrfield, scrutinee))) } - Univariant(*) => { + Univariant(..) => { (_match::single, None) } } @@ -490,11 +490,11 @@ pub fn trans_get_discr(bcx: @mut Block, r: &Repr, scrutinee: ValueRef, cast_to: val = load_discr(bcx, ity, ptr, 0, (cases.len() - 1) as Disr); signed = ity.is_signed(); } - Univariant(*) => { + Univariant(..) => { val = C_u8(0); signed = false; } - NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { + NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => { val = nullable_bitdiscr(bcx, nonnull, nndiscr, ptrfield, scrutinee); signed = false; } @@ -552,10 +552,10 @@ pub fn trans_case(bcx: @mut Block, r: &Repr, discr: Disr) -> _match::opt_result _match::single_result(rslt(bcx, C_integral(ll_inttype(bcx.ccx(), ity), discr as u64, true))) } - Univariant(*) => { + Univariant(..) => { bcx.ccx().sess.bug("no cases for univariants or structs") } - NullablePointer{ _ } => { + NullablePointer{ .. } => { assert!(discr == 0 || discr == 1); _match::single_result(rslt(bcx, C_i1(discr != 0))) } @@ -583,10 +583,10 @@ pub fn trans_start_init(bcx: @mut Block, r: &Repr, val: ValueRef, discr: Disr) { Store(bcx, C_bool(true), GEPi(bcx, val, [0, st.fields.len() - 1])) } - Univariant(*) => { + Univariant(..) => { assert_eq!(discr, 0); } - NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { + NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => { if discr != nndiscr { let llptrptr = GEPi(bcx, val, [0, ptrfield]); let llptrty = type_of::type_of(bcx.ccx(), nonnull.fields[ptrfield]); @@ -609,13 +609,14 @@ fn assert_discr_in_range(ity: IntType, min: Disr, max: Disr, discr: Disr) { */ pub fn num_args(r: &Repr, discr: Disr) -> uint { match *r { - CEnum(*) => 0, + CEnum(..) => 0, Univariant(ref st, dtor) => { assert_eq!(discr, 0); st.fields.len() - (if dtor { 1 } else { 0 }) } General(_, ref cases) => cases[discr].fields.len() - 1, - NullablePointer{ nonnull: ref nonnull, nndiscr, nullfields: ref nullfields, _ } => { + NullablePointer{ nonnull: ref nonnull, nndiscr, + nullfields: ref nullfields, .. } => { if discr == nndiscr { nonnull.fields.len() } else { nullfields.len() } } } @@ -628,7 +629,7 @@ pub fn trans_field_ptr(bcx: @mut Block, r: &Repr, val: ValueRef, discr: Disr, // decide to do some kind of cdr-coding-like non-unique repr // someday), it will need to return a possibly-new bcx as well. match *r { - CEnum(*) => { + CEnum(..) => { bcx.ccx().sess.bug("element access in C-like enum") } Univariant(ref st, _dtor) => { @@ -638,7 +639,8 @@ pub fn trans_field_ptr(bcx: @mut Block, r: &Repr, val: ValueRef, discr: Disr, General(_, ref cases) => { struct_field_ptr(bcx, &cases[discr], val, ix + 1, true) } - NullablePointer{ nonnull: ref nonnull, nullfields: ref nullfields, nndiscr, _ } => { + NullablePointer{ nonnull: ref nonnull, nullfields: ref nullfields, + nndiscr, .. } => { if (discr == nndiscr) { struct_field_ptr(bcx, nonnull, val, ix, false) } else { @@ -718,7 +720,7 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: Disr, let contents = build_const_struct(ccx, st, vals); C_struct(contents, st.packed) } - NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { + NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => { if discr == nndiscr { C_struct(build_const_struct(ccx, nonnull, vals), false) } else { @@ -789,18 +791,18 @@ pub fn const_get_discrim(ccx: &mut CrateContext, r: &Repr, val: ValueRef) match *r { CEnum(ity, _, _) => { match ity { - attr::SignedInt(*) => const_to_int(val) as Disr, - attr::UnsignedInt(*) => const_to_uint(val) as Disr + attr::SignedInt(..) => const_to_int(val) as Disr, + attr::UnsignedInt(..) => const_to_uint(val) as Disr } } General(ity, _) => { match ity { - attr::SignedInt(*) => const_to_int(const_get_elt(ccx, val, [0])) as Disr, - attr::UnsignedInt(*) => const_to_uint(const_get_elt(ccx, val, [0])) as Disr + attr::SignedInt(..) => const_to_int(const_get_elt(ccx, val, [0])) as Disr, + attr::UnsignedInt(..) => const_to_uint(const_get_elt(ccx, val, [0])) as Disr } } - Univariant(*) => 0, - NullablePointer{ nndiscr, ptrfield, _ } => { + Univariant(..) => 0, + NullablePointer{ nndiscr, ptrfield, .. } => { if is_null(const_struct_field(ccx, val, ptrfield)) { /* subtraction as uint is ok because nndiscr is either 0 or 1 */ (1 - nndiscr) as Disr @@ -821,10 +823,10 @@ pub fn const_get_discrim(ccx: &mut CrateContext, r: &Repr, val: ValueRef) pub fn const_get_field(ccx: &mut CrateContext, r: &Repr, val: ValueRef, _discr: Disr, ix: uint) -> ValueRef { match *r { - CEnum(*) => ccx.sess.bug("element access in C-like enum const"), - Univariant(*) => const_struct_field(ccx, val, ix), - General(*) => const_struct_field(ccx, val, ix + 1), - NullablePointer{ _ } => const_struct_field(ccx, val, ix) + CEnum(..) => ccx.sess.bug("element access in C-like enum const"), + Univariant(..) => const_struct_field(ccx, val, ix), + General(..) => const_struct_field(ccx, val, ix + 1), + NullablePointer{ .. } => const_struct_field(ccx, val, ix) } } diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 29dff75eeeb..ac7b8240176 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -230,7 +230,7 @@ fn decl_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t, name: & } } // `~` pointer return values never alias because ownership is transferred - ty::ty_uniq(*) | + ty::ty_uniq(..) | ty::ty_evec(_, ty::vstore_uniq) => { unsafe { llvm::LLVMAddReturnAttribute(llfn, lib::llvm::NoAliasAttribute as c_uint); @@ -246,9 +246,9 @@ fn decl_rust_fn(ccx: &mut CrateContext, inputs: &[ty::t], output: ty::t, name: & let llarg = unsafe { llvm::LLVMGetParam(llfn, (offset + i) as c_uint) }; match ty::get(arg_ty).sty { // `~` pointer parameters never alias because ownership is transferred - ty::ty_uniq(*) | + ty::ty_uniq(..) | ty::ty_evec(_, ty::vstore_uniq) | - ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, _}) => { + ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => { unsafe { llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint); } @@ -702,7 +702,7 @@ pub fn iter_structural_ty(cx: @mut Block, av: ValueRef, t: ty::t, let mut cx = cx; match ty::get(t).sty { - ty::ty_struct(*) => { + ty::ty_struct(..) => { let repr = adt::represent_type(cx.ccx(), t); expr::with_field_tys(cx.tcx(), t, None, |discr, field_tys| { for (i, field_ty) in field_tys.iter().enumerate() { @@ -854,7 +854,7 @@ pub fn trans_external_path(ccx: &mut CrateContext, did: ast::DefId, t: ty::t) -> Some(Rust) | Some(RustIntrinsic) => { get_extern_rust_fn(ccx, fn_ty.sig.inputs, fn_ty.sig.output, name, did) } - Some(*) | None => { + Some(..) | None => { let c = foreign::llvm_calling_convention(ccx, fn_ty.abis); let cconv = c.unwrap_or(lib::llvm::CCallConv); let llty = type_of_fn_from_ty(ccx, t); @@ -1046,11 +1046,11 @@ pub fn find_bcx_for_scope(bcx: @mut Block, scope_id: ast::NodeId) -> @mut Block cur_scope = match cur_scope { Some(inf) => { match inf.node_info { - Some(NodeInfo { id, _ }) if id == scope_id => { + Some(NodeInfo { id, .. }) if id == scope_id => { return bcx_sid } // FIXME(#6268, #6248) hacky cleanup for nested method calls - Some(NodeInfo { callee_id: Some(id), _ }) if id == scope_id => { + Some(NodeInfo { callee_id: Some(id), .. }) if id == scope_id => { return bcx_sid } _ => inf.parent @@ -1171,7 +1171,7 @@ pub fn trans_stmt(cx: @mut Block, s: &ast::Stmt) -> @mut Block { ast::DeclItem(i) => trans_item(cx.fcx.ccx, i) } } - ast::StmtMac(*) => cx.tcx().sess.bug("unexpanded macro") + ast::StmtMac(..) => cx.tcx().sess.bug("unexpanded macro") } return bcx; @@ -2261,7 +2261,7 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) { trans_struct_def(ccx, struct_def); } } - ast::item_trait(*) => { + ast::item_trait(..) => { // Inside of this trait definition, we won't be actually translating any // functions, but the trait still needs to be walked. Otherwise default // methods with items will not get translated and will cause ICE's when @@ -2607,11 +2607,11 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef { foreign = true; match ni.node { - ast::foreign_item_fn(*) => { + ast::foreign_item_fn(..) => { let path = vec::append((*pth).clone(), [path_name(ni.ident)]); foreign::register_foreign_item_fn(ccx, abis, &path, ni) } - ast::foreign_item_static(*) => { + ast::foreign_item_static(..) => { // Treat the crate map static specially in order to // a weak-linkage-like functionality where it's // dynamically resolved at runtime. If we're @@ -3157,7 +3157,7 @@ pub fn trans_crate(sess: session::Session, decl_gc_metadata(ccx, llmod_id); fill_crate_map(ccx, ccx.crate_map); - // NOTE win32: wart with exporting crate_map symbol + // win32: wart with exporting crate_map symbol // We set the crate map (_rust_crate_map_toplevel) to use dll_export // linkage but that ends up causing the linker to look for a // __rust_crate_map_toplevel symbol (extra underscore) which it will diff --git a/src/librustc/middle/trans/callee.rs b/src/librustc/middle/trans/callee.rs index 10c34b0b928..b1aa8a1f26a 100644 --- a/src/librustc/middle/trans/callee.rs +++ b/src/librustc/middle/trans/callee.rs @@ -95,11 +95,11 @@ pub fn trans(bcx: @mut Block, expr: &ast::Expr) -> Callee { fn datum_callee(bcx: @mut Block, expr: &ast::Expr) -> Callee { let DatumBlock {bcx, datum} = expr::trans_to_datum(bcx, expr); match ty::get(datum.ty).sty { - ty::ty_bare_fn(*) => { + ty::ty_bare_fn(..) => { let llval = datum.to_appropriate_llval(bcx); return Callee {bcx: bcx, data: Fn(FnData {llfn: llval})}; } - ty::ty_closure(*) => { + ty::ty_closure(..) => { return Callee {bcx: bcx, data: Closure(datum)}; } _ => { @@ -138,19 +138,19 @@ pub fn trans(bcx: @mut Block, expr: &ast::Expr) -> Callee { ast::DefStruct(def_id) => { fn_callee(bcx, trans_fn_ref(bcx, def_id, ref_expr.id)) } - ast::DefStatic(*) | - ast::DefArg(*) | - ast::DefLocal(*) | - ast::DefBinding(*) | - ast::DefUpvar(*) | - ast::DefSelf(*) => { + ast::DefStatic(..) | + ast::DefArg(..) | + ast::DefLocal(..) | + ast::DefBinding(..) | + ast::DefUpvar(..) | + ast::DefSelf(..) => { datum_callee(bcx, ref_expr) } - ast::DefMod(*) | ast::DefForeignMod(*) | ast::DefTrait(*) | - ast::DefTy(*) | ast::DefPrimTy(*) | - ast::DefUse(*) | ast::DefTyParamBinder(*) | - ast::DefRegion(*) | ast::DefLabel(*) | ast::DefTyParam(*) | - ast::DefSelfTy(*) | ast::DefMethod(*) => { + ast::DefMod(..) | ast::DefForeignMod(..) | ast::DefTrait(..) | + ast::DefTy(..) | ast::DefPrimTy(..) | + ast::DefUse(..) | ast::DefTyParamBinder(..) | + ast::DefRegion(..) | ast::DefLabel(..) | ast::DefTyParam(..) | + ast::DefSelfTy(..) | ast::DefMethod(..) => { bcx.tcx().sess.span_bug( ref_expr.span, format!("Cannot translate def {:?} \ @@ -718,7 +718,7 @@ pub fn trans_call_inner(in_cx: @mut Block, // The `noalias` attribute on the return value is useful to a function ptr caller. match ty::get(ret_ty).sty { // `~` pointer return values never alias because ownership is transferred - ty::ty_uniq(*) | + ty::ty_uniq(..) | ty::ty_evec(_, ty::vstore_uniq) => { attrs.push((0, NoAliasAttribute)); } diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 7b2e439f2d2..5395944ce46 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -71,7 +71,7 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool { } match ty::get(ty).sty { ty::ty_bot => true, - ty::ty_struct(*) | ty::ty_enum(*) | ty::ty_tup(*) => { + ty::ty_struct(..) | ty::ty_enum(..) | ty::ty_tup(..) => { let llty = sizing_type_of(ccx, ty); llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type) } @@ -778,7 +778,7 @@ pub fn in_scope_cx(cx: @mut Block, cur_scope = match cur_scope { Some(inf) => match scope_id { Some(wanted) => match inf.node_info { - Some(NodeInfo { id: actual, _ }) if wanted == actual => { + Some(NodeInfo { id: actual, .. }) if wanted == actual => { debug!("in_scope_cx: selected cur={} (cx={})", cur.to_str(), cx.to_str()); f(inf); @@ -1054,11 +1054,11 @@ pub enum MonoDataClass { pub fn mono_data_classify(t: ty::t) -> MonoDataClass { match ty::get(t).sty { ty::ty_float(_) => MonoFloat, - ty::ty_rptr(*) | ty::ty_uniq(*) | - ty::ty_box(*) | ty::ty_opaque_box(*) | + ty::ty_rptr(..) | ty::ty_uniq(..) | + ty::ty_box(..) | ty::ty_opaque_box(..) | ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) | - ty::ty_bare_fn(*) => MonoNonNull, + ty::ty_bare_fn(..) => MonoNonNull, // Is that everything? Would closures or slices qualify? _ => MonoBits } diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 04da76cec9e..9a9f343744c 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -133,10 +133,10 @@ fn const_deref(cx: &mut CrateContext, v: ValueRef, t: ty::t, explicit: bool) Some(ref mt) => { assert!(mt.mutbl != ast::MutMutable); let dv = match ty::get(t).sty { - ty::ty_ptr(*) | ty::ty_rptr(*) => { + ty::ty_ptr(..) | ty::ty_rptr(..) => { const_deref_ptr(cx, v) } - ty::ty_enum(*) | ty::ty_struct(*) => { + ty::ty_enum(..) | ty::ty_struct(..) => { const_deref_newtype(cx, v, t) } _ => { @@ -162,7 +162,7 @@ pub fn get_const_val(cx: @mut CrateContext, } match cx.tcx.items.get_copy(&def_id.node) { ast_map::node_item(@ast::item { - node: ast::item_static(_, ast::MutImmutable, _), _ + node: ast::item_static(_, ast::MutImmutable, _), .. }, _) => { trans_const(cx, ast::MutImmutable, def_id.node); } @@ -419,7 +419,7 @@ fn const_expr_unadjusted(cx: @mut CrateContext, let len = llvm::LLVMConstIntGetZExtValue(len) as u64; let len = match ty::get(bt).sty { - ty::ty_estr(*) => {assert!(len > 0); len - 1}, + ty::ty_estr(..) => {assert!(len > 0); len - 1}, _ => len }; if iv >= len { @@ -533,7 +533,7 @@ fn const_expr_unadjusted(cx: @mut CrateContext, match sub.node { ast::ExprLit(ref lit) => { match lit.node { - ast::lit_str(*) => { const_expr(cx, sub) } + ast::lit_str(..) => { const_expr(cx, sub) } _ => { cx.sess.span_bug(e.span, "bad const-slice lit") } } } diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index 1360c9c7c9b..952854e7d04 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -238,7 +238,7 @@ pub fn trans_break_cont(bcx: @mut Block, loop_break: Some(brk), loop_label: l, parent, - _ + .. }) => { // If we're looking for a labeled loop, check the label... target = if to_end { diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index caed9fb8e9c..ad242a9bfe6 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -300,7 +300,7 @@ pub fn create_captured_var_metadata(bcx: @mut Block, cx.sess.span_bug(span, "debuginfo::create_captured_var_metadata() - NodeId not found"); } Some(ast_map::node_local(ident)) => ident, - Some(ast_map::node_arg(@ast::Pat { node: ast::PatIdent(_, ref path, _), _ })) => { + Some(ast_map::node_arg(@ast::Pat { node: ast::PatIdent(_, ref path, _), .. })) => { ast_util::path_to_ident(path) } _ => { @@ -388,14 +388,14 @@ pub fn create_self_argument_metadata(bcx: @mut Block, // Extract the span of the self argument from the method's AST let fnitem = bcx.ccx().tcx.items.get_copy(&bcx.fcx.id); let span = match fnitem { - ast_map::node_method(@ast::method { explicit_self: explicit_self, _ }, _, _) => { + ast_map::node_method(@ast::method { explicit_self: explicit_self, .. }, _, _) => { explicit_self.span } ast_map::node_trait_method( @ast::provided( @ast::method { explicit_self: explicit_self, - _ + .. }), _, _) => { @@ -570,7 +570,7 @@ pub fn create_function_debug_context(cx: &mut CrateContext, generics: ref generics, body: ref top_level_block, span: span, - _ + .. }, _, _) => { @@ -603,15 +603,15 @@ pub fn create_function_debug_context(cx: &mut CrateContext, generics: ref generics, body: ref top_level_block, span: span, - _ + .. }), _, _) => { (ident, fn_decl, generics, top_level_block, span, true) } - ast_map::node_foreign_item(@ast::foreign_item { _ }, _, _, _) | - ast_map::node_variant(*) | - ast_map::node_struct_ctor(*) => { + ast_map::node_foreign_item(@ast::foreign_item { .. }, _, _, _) | + ast_map::node_variant(..) | + ast_map::node_struct_ctor(..) => { return FunctionWithoutDebugInfo; } _ => cx.sess.bug(format!("create_function_debug_context: \ @@ -744,7 +744,7 @@ pub fn create_function_debug_context(cx: &mut CrateContext, name_to_append_suffix_to: &mut ~str) -> DIArray { let self_type = match param_substs { - Some(@param_substs{ self_ty: self_type, _ }) => self_type, + Some(@param_substs{ self_ty: self_type, .. }) => self_type, _ => None }; @@ -798,13 +798,13 @@ pub fn create_function_debug_context(cx: &mut CrateContext, // Handle other generic parameters let actual_types = match param_substs { - Some(@param_substs { tys: ref types, _ }) => types, + Some(@param_substs { tys: ref types, .. }) => types, None => { return create_DIArray(DIB(cx), template_params); } }; - for (index, &ast::TyParam{ ident: ident, _ }) in generics.ty_params.iter().enumerate() { + for (index, &ast::TyParam{ ident: ident, .. }) in generics.ty_params.iter().enumerate() { let actual_type = actual_types[index]; // Add actual type name to <...> clause of function name let actual_type_name = ppaux::ty_to_str(cx.tcx, actual_type); @@ -843,10 +843,10 @@ pub fn create_function_debug_context(cx: &mut CrateContext, default: uint) -> uint { match *top_level_block { - ast::Block { stmts: ref statements, _ } if statements.len() > 0 => { + ast::Block { stmts: ref statements, .. } if statements.len() > 0 => { span_start(cx, statements[0].span).line } - ast::Block { expr: Some(@ref expr), _ } => { + ast::Block { expr: Some(@ref expr), .. } => { span_start(cx, expr.span).line } _ => default @@ -1171,7 +1171,7 @@ impl RecursiveTypeDescription { fn metadata(&self) -> DICompositeType { match *self { - UnfinishedMetadata { metadata_stub, _ } => metadata_stub, + UnfinishedMetadata { metadata_stub, .. } => metadata_stub, FinalMetadata(metadata) => metadata } } @@ -1517,7 +1517,7 @@ fn prepare_enum_metadata(cx: &mut CrateContext, } as @MemberDescriptionFactory, } } - adt::NullablePointer { nonnull: ref struct_def, nndiscr, _ } => { + adt::NullablePointer { nonnull: ref struct_def, nndiscr, .. } => { let (metadata_stub, variant_llvm_type, member_description_factory) = describe_variant(cx, @@ -2227,7 +2227,7 @@ fn get_namespace_and_span_for_item(cx: &mut CrateContext, let containing_scope = namespace_for_item(cx, def_id, warning_span).scope; let definition_span = if def_id.crate == ast::LOCAL_CRATE { let definition_span = match cx.tcx.items.find(&def_id.node) { - Some(&ast_map::node_item(@ast::item { span, _ }, _)) => span, + Some(&ast_map::node_item(@ast::item { span, .. }, _)) => span, ref node => { cx.sess.span_warn(warning_span, format!("debuginfo::get_namespace_and_span_for_item() \ @@ -2328,7 +2328,7 @@ fn populate_scope_map(cx: &mut CrateContext, ast::StmtDecl(@ref decl, _) => walk_decl(cx, decl, scope_stack, scope_map), ast::StmtExpr(@ref exp, _) | ast::StmtSemi(@ref exp, _) => walk_expr(cx, exp, scope_stack, scope_map), - ast::StmtMac(*) => () // ignore macros (which should be expanded anyway) + ast::StmtMac(..) => () // ignore macros (which should be expanded anyway) } } @@ -2342,7 +2342,7 @@ fn populate_scope_map(cx: &mut CrateContext, scope_stack: &mut ~[ScopeStackEntry], scope_map: &mut HashMap) { match *decl { - codemap::Spanned { node: ast::DeclLocal(@ref local), _ } => { + codemap::Spanned { node: ast::DeclLocal(@ref local), .. } => { scope_map.insert(local.id, scope_stack.last().scope_metadata); walk_pattern(cx, local.pat, scope_stack, scope_map); @@ -2453,7 +2453,7 @@ fn populate_scope_map(cx: &mut CrateContext, ast::PatStruct(_, ref field_pats, _) => { scope_map.insert(pat.id, scope_stack.last().scope_metadata); - for &ast::FieldPat { pat: sub_pat, _ } in field_pats.iter() { + for &ast::FieldPat { pat: sub_pat, .. } in field_pats.iter() { walk_pattern(cx, sub_pat, scope_stack, scope_map); } } @@ -2604,14 +2604,14 @@ fn populate_scope_map(cx: &mut CrateContext, }) } - ast::ExprFnBlock(ast::fn_decl { inputs: ref inputs, _ }, ref block) | - ast::ExprProc(ast::fn_decl { inputs: ref inputs, _ }, ref block) => { + ast::ExprFnBlock(ast::fn_decl { inputs: ref inputs, .. }, ref block) | + ast::ExprProc(ast::fn_decl { inputs: ref inputs, .. }, ref block) => { with_new_scope(cx, block.span, scope_stack, scope_map, |cx, scope_stack, scope_map| { - for &ast::arg { pat: pattern, _ } in inputs.iter() { + for &ast::arg { pat: pattern, .. } in inputs.iter() { walk_pattern(cx, pattern, scope_stack, scope_map); } @@ -2622,7 +2622,7 @@ fn populate_scope_map(cx: &mut CrateContext, // ast::expr_loop_body(@ref inner_exp) | ast::ExprDoBody(@ref inner_exp) => { let inner_expr_is_expr_fn_block = match *inner_exp { - ast::Expr { node: ast::ExprFnBlock(*), _ } => true, + ast::Expr { node: ast::ExprFnBlock(..), .. } => true, _ => false }; @@ -2680,7 +2680,7 @@ fn populate_scope_map(cx: &mut CrateContext, } ast::ExprStruct(_, ref fields, ref base_exp) => { - for &ast::Field { expr: @ref exp, _ } in fields.iter() { + for &ast::Field { expr: @ref exp, .. } in fields.iter() { walk_expr(cx, exp, scope_stack, scope_map); } @@ -2691,8 +2691,8 @@ fn populate_scope_map(cx: &mut CrateContext, } ast::ExprInlineAsm(ast::inline_asm { inputs: ref inputs, - outputs: ref outputs, - _ }) => { + outputs: ref outputs, + .. }) => { // inputs, outputs: ~[(@str, @expr)] for &(_, @ref exp) in inputs.iter() { walk_expr(cx, exp, scope_stack, scope_map); diff --git a/src/librustc/middle/trans/expr.rs b/src/librustc/middle/trans/expr.rs index 4d69c95d281..47bd57e88f5 100644 --- a/src/librustc/middle/trans/expr.rs +++ b/src/librustc/middle/trans/expr.rs @@ -193,7 +193,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { }; debug!("unadjusted datum: {}", datum.to_str(bcx.ccx())); match *adjustment { - AutoAddEnv(*) => { + AutoAddEnv(..) => { datum = unpack_datum!(bcx, add_env(bcx, expr, datum)); } AutoDerefRef(ref adj) => { @@ -209,24 +209,24 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { None => { datum } - Some(AutoUnsafe(*)) | // region + unsafe ptrs have same repr - Some(AutoPtr(*)) => { + Some(AutoUnsafe(..)) | // region + unsafe ptrs have same repr + Some(AutoPtr(..)) => { unpack_datum!(bcx, auto_ref(bcx, datum)) } - Some(AutoBorrowVec(*)) => { + Some(AutoBorrowVec(..)) => { unpack_datum!(bcx, auto_slice(bcx, adj.autoderefs, expr, datum)) } - Some(AutoBorrowVecRef(*)) => { + Some(AutoBorrowVecRef(..)) => { unpack_datum!(bcx, auto_slice_and_ref(bcx, adj.autoderefs, expr, datum)) } - Some(AutoBorrowFn(*)) => { + Some(AutoBorrowFn(..)) => { let adjusted_ty = ty::adjust_ty(bcx.tcx(), expr.span, datum.ty, Some(adjustment)); unpack_datum!(bcx, auto_borrow_fn(bcx, adjusted_ty, datum)) } - Some(AutoBorrowObj(*)) => { + Some(AutoBorrowObj(..)) => { unpack_datum!(bcx, auto_borrow_obj( bcx, adj.autoderefs, expr, datum)) } @@ -364,7 +364,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { let source_data_ptr = GEPi(bcx, source_llval, [0u, abi::trt_field_box]); let source_data = Load(bcx, source_data_ptr); // always a ptr let target_data = match source_store { - ty::BoxTraitStore(*) => { + ty::BoxTraitStore(..) => { // For deref of @T or @mut T, create a dummy datum and // use the datum's deref method. This is more work // than just calling GEPi ourselves, but it ensures @@ -388,7 +388,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { autoderefs)); derefd_datum.to_rptr(bcx).to_value_llval(bcx) } - ty::UniqTraitStore(*) => { + ty::UniqTraitStore(..) => { // For a ~T box, there may or may not be a header, // depending on whether the type T references managed // boxes. However, since we do not *know* the type T @@ -410,7 +410,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock { Load(bcx, borrow_offset_ptr); InBoundsGEP(bcx, llopaque, [borrow_offset]) } - ty::RegionTraitStore(*) => { + ty::RegionTraitStore(..) => { source_data } }; @@ -709,14 +709,14 @@ fn trans_rvalue_dps_unadjusted(bcx: @mut Block, expr: &ast::Expr, args.iter().enumerate().map(|(i, arg)| (i, *arg)).collect(); return trans_adt(bcx, repr, 0, numbered_fields, None, dest); } - ast::ExprLit(@codemap::Spanned {node: ast::lit_str(s, _), _}) => { + ast::ExprLit(@codemap::Spanned {node: ast::lit_str(s, _), ..}) => { return tvec::trans_lit_str(bcx, expr, s, dest); } ast::ExprVstore(contents, ast::ExprVstoreSlice) | ast::ExprVstore(contents, ast::ExprVstoreMutSlice) => { return tvec::trans_slice_vstore(bcx, expr, contents, dest); } - ast::ExprVec(*) | ast::ExprRepeat(*) => { + ast::ExprVec(..) | ast::ExprRepeat(..) => { return tvec::trans_fixed_vstore(bcx, expr, expr, dest); } ast::ExprFnBlock(ref decl, ref body) | @@ -832,7 +832,7 @@ fn trans_def_dps_unadjusted(bcx: @mut Block, ref_expr: &ast::Expr, let repr = adt::represent_type(ccx, ty); adt::trans_start_init(bcx, repr, lldest, 0); } - ty::ty_bare_fn(*) => { + ty::ty_bare_fn(..) => { let fn_data = callee::trans_fn_ref(bcx, def_id, ref_expr.id); Store(bcx, fn_data.llfn, lldest); } @@ -1672,14 +1672,14 @@ pub enum cast_kind { pub fn cast_type_kind(t: ty::t) -> cast_kind { match ty::get(t).sty { ty::ty_char => cast_integral, - ty::ty_float(*) => cast_float, - ty::ty_ptr(*) => cast_pointer, - ty::ty_rptr(*) => cast_pointer, - ty::ty_bare_fn(*) => cast_pointer, - ty::ty_int(*) => cast_integral, - ty::ty_uint(*) => cast_integral, + ty::ty_float(..) => cast_float, + ty::ty_ptr(..) => cast_pointer, + ty::ty_rptr(..) => cast_pointer, + ty::ty_bare_fn(..) => cast_pointer, + ty::ty_int(..) => cast_integral, + ty::ty_uint(..) => cast_integral, ty::ty_bool => cast_integral, - ty::ty_enum(*) => cast_enum, + ty::ty_enum(..) => cast_enum, _ => cast_other } } diff --git a/src/librustc/middle/trans/foreign.rs b/src/librustc/middle/trans/foreign.rs index 74268330702..ac65719f02e 100644 --- a/src/librustc/middle/trans/foreign.rs +++ b/src/librustc/middle/trans/foreign.rs @@ -98,7 +98,7 @@ pub fn llvm_calling_convention(ccx: &mut CrateContext, C => lib::llvm::CCallConv, Win64 => lib::llvm::X86_64_Win64, - // NOTE These API constants ought to be more specific + // These API constants ought to be more specific... Cdecl => lib::llvm::CCallConv, Aapcs => lib::llvm::CCallConv, } @@ -347,7 +347,7 @@ pub fn trans_foreign_mod(ccx: @mut CrateContext, let _icx = push_ctxt("foreign::trans_foreign_mod"); for &foreign_item in foreign_mod.items.iter() { match foreign_item.node { - ast::foreign_item_fn(*) => { + ast::foreign_item_fn(..) => { let (abis, mut path) = match ccx.tcx.items.get_copy(&foreign_item.id) { ast_map::node_foreign_item(_, abis, _, path) => (abis, (*path).clone()), _ => fail!("Unable to find foreign item in tcx.items table.") diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 70d983a01fa..4e796fd21b3 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -127,8 +127,8 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t { if field == abi::tydesc_field_take_glue { match ty::get(t).sty { - ty::ty_unboxed_vec(*) | - ty::ty_uniq(*) | + ty::ty_unboxed_vec(..) | + ty::ty_uniq(..) | ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) => { return ty::mk_u32(); } _ => () @@ -142,14 +142,14 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t { if field == abi::tydesc_field_free_glue { match ty::get(t).sty { - ty::ty_bare_fn(*) | - ty::ty_closure(*) | - ty::ty_box(*) | + ty::ty_bare_fn(..) | + ty::ty_closure(..) | + ty::ty_box(..) | ty::ty_opaque_box | - ty::ty_uniq(*) | + ty::ty_uniq(..) | ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) | - ty::ty_opaque_closure_ptr(*) => (), + ty::ty_opaque_closure_ptr(..) => (), _ => { return ty::mk_u32(); } } } @@ -373,7 +373,7 @@ pub fn make_free_glue(bcx: @mut Block, v: ValueRef, t: ty::t) -> @mut Block { None); trans_free(bcx, v) } - ty::ty_uniq(*) => { + ty::ty_uniq(..) => { uniq::make_free_glue(bcx, v, t) } ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | @@ -602,8 +602,8 @@ pub fn declare_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info { } let has_header = match ty::get(t).sty { - ty::ty_box(*) => true, - ty::ty_uniq(*) => ty::type_contents(ccx.tcx, t).owns_managed(), + ty::ty_box(..) => true, + ty::ty_uniq(..) => ty::type_contents(ccx.tcx, t).owns_managed(), _ => false }; diff --git a/src/librustc/middle/trans/inline.rs b/src/librustc/middle/trans/inline.rs index d9f7cdeeb2e..bbabba3381d 100644 --- a/src/librustc/middle/trans/inline.rs +++ b/src/librustc/middle/trans/inline.rs @@ -67,7 +67,7 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::DefId) // however, so we use the available_externally linkage which llvm // provides match item.node { - ast::item_static(*) => { + ast::item_static(..) => { let g = get_item_val(ccx, item.id); // see the comment in get_item_val() as to why this check is // performed here. diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index 71d2204b94f..3c4aeb9e762 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -113,7 +113,7 @@ pub fn trans_method(ccx: @mut CrateContext, let self_ty = ty::node_id_to_type(ccx.tcx, method.self_id); let self_ty = match param_substs { None => self_ty, - Some(@param_substs {tys: ref tys, self_ty: ref self_sub, _}) => { + Some(@param_substs {tys: ref tys, self_ty: ref self_sub, ..}) => { ty::subst_tps(ccx.tcx, *tys, *self_sub, self_ty) } }; @@ -361,7 +361,7 @@ pub fn trans_monomorphized_callee(bcx: @mut Block, }) } } - typeck::vtable_param(*) => { + typeck::vtable_param(..) => { fail!("vtable_param left in monomorphized function's vtable substs"); } }; @@ -437,7 +437,7 @@ pub fn trans_trait_callee(bcx: @mut Block, // make a local copy for trait if needed let self_ty = expr_ty_adjusted(bcx, self_expr); let self_scratch = match ty::get(self_ty).sty { - ty::ty_trait(_, _, ty::RegionTraitStore(*), _, _) => { + ty::ty_trait(_, _, ty::RegionTraitStore(..), _, _) => { unpack_datum!(bcx, expr::trans_to_datum(bcx, self_expr)) } _ => { diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs index f625ce4b01c..9f26b5c4caf 100644 --- a/src/librustc/middle/trans/monomorphize.rs +++ b/src/librustc/middle/trans/monomorphize.rs @@ -105,7 +105,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, ast_map::node_method(m, _, pt) => (pt, m.ident, m.span), ast_map::node_foreign_item(i, abis, _, pt) if abis.is_intrinsic() => (pt, i.ident, i.span), - ast_map::node_foreign_item(*) => { + ast_map::node_foreign_item(..) => { // Foreign externs don't have to be monomorphized. return (get_item_val(ccx, fn_id.node), true); } @@ -121,20 +121,20 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, ast_map::node_trait_method(@ast::required(_), _, _) => { ccx.tcx.sess.bug("Can't monomorphize a required trait method") } - ast_map::node_expr(*) => { + ast_map::node_expr(..) => { ccx.tcx.sess.bug("Can't monomorphize an expr") } - ast_map::node_stmt(*) => { + ast_map::node_stmt(..) => { ccx.tcx.sess.bug("Can't monomorphize a stmt") } - ast_map::node_arg(*) => ccx.tcx.sess.bug("Can't monomorphize an arg"), - ast_map::node_block(*) => { + ast_map::node_arg(..) => ccx.tcx.sess.bug("Can't monomorphize an arg"), + ast_map::node_block(..) => { ccx.tcx.sess.bug("Can't monomorphize a block") } - ast_map::node_local(*) => { + ast_map::node_local(..) => { ccx.tcx.sess.bug("Can't monomorphize a local") } - ast_map::node_callee_scope(*) => { + ast_map::node_callee_scope(..) => { ccx.tcx.sess.bug("Can't monomorphize a callee-scope") } ast_map::node_struct_ctor(_, i, pt) => (pt, i.ident, i.span) @@ -208,7 +208,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, let lldecl = match map_node { ast_map::node_item(i@@ast::item { node: ast::item_fn(ref decl, _, _, _, ref body), - _ + .. }, _) => { let d = mk_lldecl(); set_llvm_fn_attrs(i.attrs, d); @@ -223,7 +223,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, []); d } - ast_map::node_item(*) => { + ast_map::node_item(..) => { ccx.tcx.sess.bug("Can't monomorphize this kind of item") } ast_map::node_foreign_item(i, _, _, _) => { @@ -278,13 +278,13 @@ pub fn monomorphic_fn(ccx: @mut CrateContext, } // Ugh -- but this ensures any new variants won't be forgotten - ast_map::node_expr(*) | - ast_map::node_stmt(*) | - ast_map::node_trait_method(*) | - ast_map::node_arg(*) | - ast_map::node_block(*) | - ast_map::node_callee_scope(*) | - ast_map::node_local(*) => { + ast_map::node_expr(..) | + ast_map::node_stmt(..) | + ast_map::node_trait_method(..) | + ast_map::node_arg(..) | + ast_map::node_block(..) | + ast_map::node_callee_scope(..) | + ast_map::node_local(..) => { ccx.tcx.sess.bug(format!("Can't monomorphize a {:?}", map_node)) } }; diff --git a/src/librustc/middle/trans/reflect.rs b/src/librustc/middle/trans/reflect.rs index ccfe0d6e979..5278ff15495 100644 --- a/src/librustc/middle/trans/reflect.rs +++ b/src/librustc/middle/trans/reflect.rs @@ -355,7 +355,7 @@ impl Reflector { let extra = ~[self.c_uint(p.idx)]; self.visit("param", extra) } - ty::ty_self(*) => self.leaf("self"), + ty::ty_self(..) => self.leaf("self"), ty::ty_type => self.leaf("type"), ty::ty_opaque_box => self.leaf("opaque_box"), ty::ty_opaque_closure_ptr(ck) => { diff --git a/src/librustc/middle/trans/tvec.rs b/src/librustc/middle/trans/tvec.rs index 82615b1e119..d641ed42c30 100644 --- a/src/librustc/middle/trans/tvec.rs +++ b/src/librustc/middle/trans/tvec.rs @@ -359,7 +359,7 @@ pub fn write_content(bcx: @mut Block, let _indenter = indenter(); match content_expr.node { - ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), _ }) => { + ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), .. }) => { match dest { Ignore => { return bcx; @@ -456,7 +456,7 @@ pub fn elements_required(bcx: @mut Block, content_expr: &ast::Expr) -> uint { //! Figure out the number of elements we need to store this content match content_expr.node { - ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), _ }) => { + ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), .. }) => { s.len() }, ast::ExprVec(ref es, _) => es.len(), diff --git a/src/librustc/middle/trans/type_.rs b/src/librustc/middle/trans/type_.rs index 579405fc881..3e0761e214c 100644 --- a/src/librustc/middle/trans/type_.rs +++ b/src/librustc/middle/trans/type_.rs @@ -283,7 +283,7 @@ impl Type { let box_ty = match store { ty::BoxTraitStore => Type::opaque_box(ctx), ty::UniqTraitStore => Type::unique(ctx, &Type::i8()), - ty::RegionTraitStore(*) => Type::i8() + ty::RegionTraitStore(..) => Type::i8() }; Type::struct_([tydesc_ptr, box_ty.ptr_to()], false) } diff --git a/src/librustc/middle/trans/type_of.rs b/src/librustc/middle/trans/type_of.rs index 0b51105cdde..2a8db2ca2a7 100644 --- a/src/librustc/middle/trans/type_of.rs +++ b/src/librustc/middle/trans/type_of.rs @@ -118,21 +118,21 @@ pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type { ty::ty_estr(ty::vstore_box) | ty::ty_evec(_, ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_box) | - ty::ty_box(*) | + ty::ty_box(..) | ty::ty_opaque_box | - ty::ty_uniq(*) | - ty::ty_ptr(*) | - ty::ty_rptr(*) | + ty::ty_uniq(..) | + ty::ty_ptr(..) | + ty::ty_rptr(..) | ty::ty_type | - ty::ty_opaque_closure_ptr(*) => Type::i8p(), + ty::ty_opaque_closure_ptr(..) => Type::i8p(), - ty::ty_estr(ty::vstore_slice(*)) | - ty::ty_evec(_, ty::vstore_slice(*)) => { + ty::ty_estr(ty::vstore_slice(..)) | + ty::ty_evec(_, ty::vstore_slice(..)) => { Type::struct_([Type::i8p(), Type::i8p()], false) } - ty::ty_bare_fn(*) => Type::i8p(), - ty::ty_closure(*) => Type::struct_([Type::i8p(), Type::i8p()], false), + ty::ty_bare_fn(..) => Type::i8p(), + ty::ty_closure(..) => Type::struct_([Type::i8p(), Type::i8p()], false), ty::ty_trait(_, _, store, _, _) => Type::opaque_trait(cx, store), ty::ty_estr(ty::vstore_fixed(size)) => Type::array(&Type::i8(), size as u64), @@ -145,12 +145,12 @@ pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type { Type::vec(cx.sess.targ_cfg.arch, &sz_ty) } - ty::ty_tup(*) | ty::ty_enum(*) => { + ty::ty_tup(..) | ty::ty_enum(..) => { let repr = adt::represent_type(cx, t); adt::sizing_type_of(cx, repr) } - ty::ty_struct(*) => { + ty::ty_struct(..) => { if ty::type_is_simd(cx.tcx, t) { let et = ty::simd_type(cx.tcx, t); let n = ty::simd_size(cx.tcx, t); @@ -161,7 +161,7 @@ pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type { } } - ty::ty_self(_) | ty::ty_infer(*) | ty::ty_param(*) | ty::ty_err(*) => { + ty::ty_self(_) | ty::ty_infer(..) | ty::ty_param(..) | ty::ty_err(..) => { cx.tcx.sess.bug(format!("fictitious type {:?} in sizing_type_of()", ty::get(t).sty)) } }; @@ -285,7 +285,7 @@ pub fn type_of(cx: &mut CrateContext, t: ty::t) -> Type { } ty::ty_trait(_, _, store, _, _) => Type::opaque_trait(cx, store), ty::ty_type => cx.tydesc_type.ptr_to(), - ty::ty_tup(*) => { + ty::ty_tup(..) => { let repr = adt::represent_type(cx, t); adt::type_of(cx, repr) } @@ -304,10 +304,10 @@ pub fn type_of(cx: &mut CrateContext, t: ty::t) -> Type { adt::incomplete_type_of(cx, repr, name) } } - ty::ty_self(*) => cx.tcx.sess.unimpl("type_of: ty_self"), - ty::ty_infer(*) => cx.tcx.sess.bug("type_of with ty_infer"), - ty::ty_param(*) => cx.tcx.sess.bug("type_of with ty_param"), - ty::ty_err(*) => cx.tcx.sess.bug("type_of with ty_err") + ty::ty_self(..) => cx.tcx.sess.unimpl("type_of: ty_self"), + ty::ty_infer(..) => cx.tcx.sess.bug("type_of with ty_infer"), + ty::ty_param(..) => cx.tcx.sess.bug("type_of with ty_param"), + ty::ty_err(..) => cx.tcx.sess.bug("type_of with ty_err") }; debug!("--> mapped t={} {:?} to llty={}", @@ -318,7 +318,7 @@ pub fn type_of(cx: &mut CrateContext, t: ty::t) -> Type { // If this was an enum or struct, fill in the type now. match ty::get(t).sty { - ty::ty_enum(*) | ty::ty_struct(*) if !ty::type_is_simd(cx.tcx, t) => { + ty::ty_enum(..) | ty::ty_struct(..) if !ty::type_is_simd(cx.tcx, t) => { let repr = adt::represent_type(cx, t); adt::finish_type_of(cx, repr, &mut llty); } diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 39a6ad895d9..cabe65b097b 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -512,8 +512,8 @@ pub enum Region { impl Region { pub fn is_bound(&self) -> bool { match self { - &ty::ReEarlyBound(*) => true, - &ty::ReLateBound(*) => true, + &ty::ReEarlyBound(..) => true, + &ty::ReLateBound(..) => true, _ => false } } @@ -1506,14 +1506,14 @@ pub fn type_is_bool(ty: t) -> bool { get(ty).sty == ty_bool } pub fn type_is_self(ty: t) -> bool { match get(ty).sty { - ty_self(*) => true, + ty_self(..) => true, _ => false } } pub fn type_is_structural(ty: t) -> bool { match get(ty).sty { - ty_struct(*) | ty_tup(_) | ty_enum(*) | ty_closure(_) | ty_trait(*) | + ty_struct(..) | ty_tup(_) | ty_enum(..) | ty_closure(_) | ty_trait(..) | ty_evec(_, vstore_fixed(_)) | ty_estr(vstore_fixed(_)) | ty_evec(_, vstore_slice(_)) | ty_estr(vstore_slice(_)) => true, @@ -1647,7 +1647,7 @@ pub fn type_is_scalar(ty: t) -> bool { match get(ty).sty { ty_nil | ty_bool | ty_char | ty_int(_) | ty_float(_) | ty_uint(_) | ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) | ty_type | - ty_bare_fn(*) | ty_ptr(_) => true, + ty_bare_fn(..) | ty_ptr(_) => true, _ => false } } @@ -2296,7 +2296,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool { type_requires(cx, seen, r_ty, mt.ty) } - ty_ptr(*) => { + ty_ptr(..) => { false // unsafe ptrs can always be NULL } @@ -2401,7 +2401,7 @@ pub fn type_structurally_contains_uniques(cx: ctxt, ty: t) -> bool { pub fn type_is_trait(ty: t) -> bool { match get(ty).sty { - ty_trait(*) => true, + ty_trait(..) => true, _ => false } } @@ -2422,7 +2422,7 @@ pub fn type_is_char(ty: t) -> bool { pub fn type_is_bare_fn(ty: t) -> bool { match get(ty).sty { - ty_bare_fn(*) => true, + ty_bare_fn(..) => true, _ => false } } @@ -2448,7 +2448,7 @@ pub fn type_is_signed(ty: t) -> bool { pub fn type_is_machine(ty: t) -> bool { match get(ty).sty { ty_int(ast::ty_i) | ty_uint(ast::ty_u) => false, - ty_int(*) | ty_uint(*) | ty_float(*) => true, + ty_int(..) | ty_uint(..) | ty_float(..) => true, _ => false } } @@ -2497,11 +2497,11 @@ pub fn type_is_pod(cx: ctxt, ty: t) -> bool { }); } - ty_estr(vstore_slice(*)) | ty_evec(_, vstore_slice(*)) => { + ty_estr(vstore_slice(..)) | ty_evec(_, vstore_slice(..)) => { result = false; } - ty_infer(*) | ty_self(*) | ty_err => { + ty_infer(..) | ty_self(..) | ty_err => { cx.sess.bug("non concrete type in type_is_pod"); } } @@ -3010,10 +3010,10 @@ pub fn method_call_type_param_defs(tcx: ctxt, } typeck::method_param(typeck::method_param { trait_id: trt_id, - method_num: n_mth, _}) | + method_num: n_mth, ..}) | typeck::method_object(typeck::method_object { trait_id: trt_id, - method_num: n_mth, _}) => { + method_num: n_mth, ..}) => { // ...trait methods bounds, in contrast, include only the // method bounds, so we must preprend the tps from the // trait itself. This ought to be harmonized. @@ -3068,28 +3068,28 @@ pub fn expr_kind(tcx: ctxt, // generated via DPS. However, assign_op (e.g., `x += y`) is an // exception, as its result is always unit. return match expr.node { - ast::ExprAssignOp(*) => RvalueStmtExpr, + ast::ExprAssignOp(..) => RvalueStmtExpr, _ => RvalueDpsExpr }; } match expr.node { - ast::ExprPath(*) | ast::ExprSelf => { + ast::ExprPath(..) | ast::ExprSelf => { match resolve_expr(tcx, expr) { - ast::DefVariant(*) | ast::DefStruct(*) => RvalueDpsExpr, + ast::DefVariant(..) | ast::DefStruct(..) => RvalueDpsExpr, // Fn pointers are just scalar values. - ast::DefFn(*) | ast::DefStaticMethod(*) => RvalueDatumExpr, + ast::DefFn(..) | ast::DefStaticMethod(..) => RvalueDatumExpr, // Note: there is actually a good case to be made that // def_args, particularly those of immediate type, ought to // considered rvalues. - ast::DefStatic(*) | - ast::DefBinding(*) | - ast::DefUpvar(*) | - ast::DefArg(*) | - ast::DefLocal(*) | - ast::DefSelf(*) => LvalueExpr, + ast::DefStatic(..) | + ast::DefBinding(..) | + ast::DefUpvar(..) | + ast::DefArg(..) | + ast::DefLocal(..) | + ast::DefSelf(..) => LvalueExpr, def => { tcx.sess.span_bug(expr.span, format!( @@ -3100,30 +3100,30 @@ pub fn expr_kind(tcx: ctxt, } ast::ExprUnary(_, ast::UnDeref, _) | - ast::ExprField(*) | - ast::ExprIndex(*) => { + ast::ExprField(..) | + ast::ExprIndex(..) => { LvalueExpr } - ast::ExprCall(*) | - ast::ExprMethodCall(*) | - ast::ExprStruct(*) | - ast::ExprTup(*) | - ast::ExprIf(*) | - ast::ExprMatch(*) | - ast::ExprFnBlock(*) | - ast::ExprProc(*) | - ast::ExprDoBody(*) | - ast::ExprBlock(*) | - ast::ExprRepeat(*) | - ast::ExprLit(@codemap::Spanned {node: lit_str(*), _}) | + ast::ExprCall(..) | + ast::ExprMethodCall(..) | + ast::ExprStruct(..) | + ast::ExprTup(..) | + ast::ExprIf(..) | + ast::ExprMatch(..) | + ast::ExprFnBlock(..) | + ast::ExprProc(..) | + ast::ExprDoBody(..) | + ast::ExprBlock(..) | + ast::ExprRepeat(..) | + ast::ExprLit(@codemap::Spanned {node: lit_str(..), ..}) | ast::ExprVstore(_, ast::ExprVstoreSlice) | ast::ExprVstore(_, ast::ExprVstoreMutSlice) | - ast::ExprVec(*) => { + ast::ExprVec(..) => { RvalueDpsExpr } - ast::ExprCast(*) => { + ast::ExprCast(..) => { match tcx.node_types.find(&(expr.id as uint)) { Some(&t) => { if type_is_trait(t) { @@ -3149,24 +3149,24 @@ pub fn expr_kind(tcx: ctxt, } } - ast::ExprBreak(*) | - ast::ExprAgain(*) | - ast::ExprRet(*) | - ast::ExprWhile(*) | - ast::ExprLoop(*) | - ast::ExprAssign(*) | - ast::ExprInlineAsm(*) | - ast::ExprAssignOp(*) => { + ast::ExprBreak(..) | + ast::ExprAgain(..) | + ast::ExprRet(..) | + ast::ExprWhile(..) | + ast::ExprLoop(..) | + ast::ExprAssign(..) | + ast::ExprInlineAsm(..) | + ast::ExprAssignOp(..) => { RvalueStmtExpr } - ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ast::ExprLogLevel | ast::ExprLit(_) | // Note: lit_str is carved out above - ast::ExprUnary(*) | - ast::ExprAddrOf(*) | - ast::ExprBinary(*) | + ast::ExprUnary(..) | + ast::ExprAddrOf(..) | + ast::ExprBinary(..) | ast::ExprVstore(_, ast::ExprVstoreBox) | ast::ExprVstore(_, ast::ExprVstoreMutBox) | ast::ExprVstore(_, ast::ExprVstoreUniq) => { @@ -3175,7 +3175,7 @@ pub fn expr_kind(tcx: ctxt, ast::ExprParen(e) => expr_kind(tcx, method_map, e), - ast::ExprMac(*) => { + ast::ExprMac(..) => { tcx.sess.span_bug( expr.span, "macro expression remains after expansion"); @@ -3188,7 +3188,7 @@ pub fn stmt_node_id(s: &ast::Stmt) -> ast::NodeId { ast::StmtDecl(_, id) | StmtExpr(_, id) | StmtSemi(_, id) => { return id; } - ast::StmtMac(*) => fail!("unexpanded macro in trans") + ast::StmtMac(..) => fail!("unexpanded macro in trans") } } @@ -3356,13 +3356,13 @@ pub fn type_err_to_str(cx: ctxt, err: &type_err) -> ~str { cx.sess.str_of(values.found)) } terr_arg_count => ~"incorrect number of function parameters", - terr_regions_does_not_outlive(*) => { + terr_regions_does_not_outlive(..) => { format!("lifetime mismatch") } - terr_regions_not_same(*) => { + terr_regions_not_same(..) => { format!("lifetimes are not the same") } - terr_regions_no_overlap(*) => { + terr_regions_no_overlap(..) => { format!("lifetimes do not intersect") } terr_regions_insufficiently_polymorphic(br, _) => { @@ -3482,7 +3482,7 @@ pub fn provided_trait_methods(cx: ctxt, id: ast::DefId) -> ~[@Method] { match cx.items.find(&id.node) { Some(&ast_map::node_item(@ast::item { node: item_trait(_, _, ref ms), - _ + .. }, _)) => match ast_util::split_trait_methods(*ms) { (_, p) => p.map(|m| method(cx, ast_util::local_def(m.id))) @@ -3589,7 +3589,7 @@ pub fn impl_trait_ref(cx: ctxt, id: ast::DefId) -> Option<@TraitRef> { match cx.items.find(&id.node) { Some(&ast_map::node_item(@ast::item { node: ast::item_impl(_, ref opt_trait, _, _), - _}, + ..}, _)) => { match opt_trait { &Some(ref t) => Some(ty::node_id_to_trait_ref(cx, t.ref_id)), @@ -3865,7 +3865,7 @@ pub fn enum_variants(cx: ctxt, id: ast::DefId) -> @~[@VariantInfo] { match cx.items.get_copy(&id.node) { ast_map::node_item(@ast::item { node: ast::item_enum(ref enum_definition, _), - _ + .. }, _) => { let mut last_discriminant: Option = None; @enum_definition.variants.iter().map(|variant| { @@ -3960,7 +3960,7 @@ pub fn lookup_trait_def(cx: ctxt, did: ast::DefId) -> @ty::TraitDef { pub fn each_attr(tcx: ctxt, did: DefId, f: |@MetaItem| -> bool) -> bool { if is_local(did) { match tcx.items.find(&did.node) { - Some(&ast_map::node_item(@ast::item {attrs: ref attrs, _}, _)) => + Some(&ast_map::node_item(@ast::item {attrs: ref attrs, ..}, _)) => attrs.iter().advance(|attr| f(attr.node.value)), _ => tcx.sess.bug(format!("has_attr: {:?} is not an item", did)) @@ -4022,7 +4022,7 @@ pub fn lookup_field_type(tcx: ctxt, } else { match tcx.tcache.find(&id) { - Some(&ty_param_bounds_and_ty {ty, _}) => ty, + Some(&ty_param_bounds_and_ty {ty, ..}) => ty, None => { let tpt = csearch::get_field_type(tcx, struct_id, id); tcx.tcache.insert(id, tpt); @@ -4224,7 +4224,7 @@ pub fn normalize_ty(cx: ctxt, t: t) -> t { fn fold_vstore(&mut self, vstore: vstore) -> vstore { match vstore { - vstore_fixed(*) | vstore_uniq | vstore_box => vstore, + vstore_fixed(..) | vstore_uniq | vstore_box => vstore, vstore_slice(_) => vstore_slice(ReStatic) } } @@ -4307,7 +4307,7 @@ pub fn eval_repeat_count(tcx: &T, count_expr: &ast::Expr) -> return 0; } }, - Err(*) => { + Err(..) => { tcx.ty_ctxt().sess.span_err(count_expr.span, "expected constant integer for repeat count \ but found variable"); @@ -4574,11 +4574,11 @@ pub fn hash_crate_independent(tcx: ctxt, t: t, local_hash: @str) -> u64 { ReStatic => {} ReEmpty | - ReEarlyBound(*) | - ReLateBound(*) | - ReFree(*) | - ReScope(*) | - ReInfer(*) => { + ReEarlyBound(..) | + ReLateBound(..) | + ReFree(..) | + ReScope(..) | + ReInfer(..) => { tcx.sess.bug("non-static region found when hashing a type") } } diff --git a/src/librustc/middle/ty_fold.rs b/src/librustc/middle/ty_fold.rs index 2f35121dc02..d196956163b 100644 --- a/src/librustc/middle/ty_fold.rs +++ b/src/librustc/middle/ty_fold.rs @@ -192,7 +192,7 @@ pub fn super_fold_sty(this: &mut T, ty::ty_float(_) | ty::ty_type | ty::ty_opaque_closure_ptr(_) | ty::ty_err | ty::ty_opaque_box | ty::ty_infer(_) | - ty::ty_param(*) | ty::ty_self(_) => { + ty::ty_param(..) | ty::ty_self(_) => { (*sty).clone() } } diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index 77dbb66fd7f..74a51f1dbce 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -329,7 +329,7 @@ pub fn ast_ty_to_ty( ty::vstore_slice(r) => { ty::RegionTraitStore(r) } - ty::vstore_fixed(*) => { + ty::vstore_fixed(..) => { tcx.sess.span_err( path.span, "@trait, ~trait or &trait are the only supported \ @@ -459,7 +459,7 @@ pub fn ast_ty_to_ty( // Kind bounds on path types are only supported for traits. match a_def { // But don't emit the error if the user meant to do a trait anyway. - ast::DefTrait(*) => { }, + ast::DefTrait(..) => { }, _ if bounds.is_some() => tcx.sess.span_err(ast_ty.span, "kind bounds can only be used on trait types"), @@ -810,6 +810,6 @@ fn conv_builtin_bounds(tcx: ty::ctxt, ast_bounds: &Option. - (&None, ty::RegionTraitStore(*)) => ty::EmptyBuiltinBounds(), + (&None, ty::RegionTraitStore(..)) => ty::EmptyBuiltinBounds(), } } diff --git a/src/librustc/middle/typeck/check/_match.rs b/src/librustc/middle/typeck/check/_match.rs index 0785ba002aa..809f465fb28 100644 --- a/src/librustc/middle/typeck/check/_match.rs +++ b/src/librustc/middle/typeck/check/_match.rs @@ -355,7 +355,7 @@ pub fn check_struct_pat(pcx: &pat_ctxt, pat_id: ast::NodeId, span: Span, if supplied_def_id == struct_id => { // OK. } - Some(&ast::DefStruct(*)) | Some(&ast::DefVariant(*)) => { + Some(&ast::DefStruct(..)) | Some(&ast::DefVariant(..)) => { let name = pprust::path_to_str(path, tcx.sess.intr()); tcx.sess.span_err(span, format!("mismatched types: expected `{}` but found `{}`", @@ -393,7 +393,7 @@ pub fn check_struct_like_enum_variant_pat(pcx: &pat_ctxt, check_struct_pat_fields(pcx, span, path, fields, class_fields, variant_id, substitutions, etc); } - Some(&ast::DefStruct(*)) | Some(&ast::DefVariant(*)) => { + Some(&ast::DefStruct(..)) | Some(&ast::DefVariant(..)) => { let name = pprust::path_to_str(path, tcx.sess.intr()); tcx.sess.span_err(span, format!("mismatched types: expected `{}` but \ @@ -452,8 +452,8 @@ pub fn check_pat(pcx: &pat_ctxt, pat: @ast::Pat, expected: ty::t) { } fcx.write_ty(pat.id, b_ty); } - ast::PatEnum(*) | - ast::PatIdent(*) if pat_is_const(tcx.def_map, pat) => { + ast::PatEnum(..) | + ast::PatIdent(..) if pat_is_const(tcx.def_map, pat) => { let const_did = ast_util::def_id_of_def(tcx.def_map.get_copy(&pat.id)); let const_tpt = ty::lookup_item_type(tcx, const_did); demand::suptype(fcx, pat.span, expected, const_tpt.ty); diff --git a/src/librustc/middle/typeck/check/method.rs b/src/librustc/middle/typeck/check/method.rs index c7503e25684..6467be93a8e 100644 --- a/src/librustc/middle/typeck/check/method.rs +++ b/src/librustc/middle/typeck/check/method.rs @@ -324,7 +324,7 @@ impl<'self> LookupContext<'self> { ty_param(p) => { self.push_inherent_candidates_from_param(self_ty, p); } - ty_self(*) => { + ty_self(..) => { // Call is of the form "self.foo()" and appears in one // of a trait's default method implementations. self.push_inherent_candidates_from_self(self_ty); @@ -740,7 +740,7 @@ impl<'self> LookupContext<'self> { }) } - ty_closure(*) => { + ty_closure(..) => { // This case should probably be handled similarly to // Trait instances. None @@ -760,13 +760,13 @@ impl<'self> LookupContext<'self> { let tcx = self.tcx(); match ty::get(self_ty).sty { - ty_bare_fn(*) | ty_box(*) | ty_uniq(*) | ty_rptr(*) | + ty_bare_fn(..) | ty_box(..) | ty_uniq(..) | ty_rptr(..) | ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) | - ty_self(_) | ty_param(*) | ty_nil | ty_bot | ty_bool | - ty_char | ty_int(*) | ty_uint(*) | - ty_float(*) | ty_enum(*) | ty_ptr(*) | ty_struct(*) | ty_tup(*) | - ty_estr(*) | ty_evec(*) | ty_trait(*) | ty_closure(*) => { + ty_self(_) | ty_param(..) | ty_nil | ty_bot | ty_bool | + ty_char | ty_int(..) | ty_uint(..) | + ty_float(..) | ty_enum(..) | ty_ptr(..) | ty_struct(..) | ty_tup(..) | + ty_estr(..) | ty_evec(..) | ty_trait(..) | ty_closure(..) => { self.search_for_some_kind_of_autorefd_method( AutoPtr, autoderefs, [MutImmutable, MutMutable], |m,r| ty::mk_rptr(tcx, r, ty::mt {ty:self_ty, mutbl:m})) @@ -929,7 +929,7 @@ impl<'self> LookupContext<'self> { assert!(candidate.method_ty.explicit_self != sty_static); let transformed_self_ty = match candidate.origin { - method_object(*) => { + method_object(..) => { // For annoying reasons, we've already handled the // substitution for object calls. candidate.method_ty.transformed_self_ty.unwrap() @@ -1066,7 +1066,7 @@ impl<'self> LookupContext<'self> { ast::sty_value(_) => { ty::mk_err() // error reported in `enforce_object_limitations()` } - ast::sty_region(*) | ast::sty_box(*) | ast::sty_uniq(*) => { + ast::sty_region(..) | ast::sty_box(..) | ast::sty_uniq(..) => { let transformed_self_ty = method_ty.transformed_self_ty.clone().unwrap(); match ty::get(transformed_self_ty).sty { @@ -1108,10 +1108,10 @@ impl<'self> LookupContext<'self> { */ match candidate.origin { - method_static(*) | method_param(*) => { + method_static(..) | method_param(..) => { return; // not a call to a trait instance } - method_object(*) => {} + method_object(..) => {} } match candidate.method_ty.explicit_self { @@ -1129,7 +1129,7 @@ impl<'self> LookupContext<'self> { through an object"); } - ast::sty_region(*) | ast::sty_box(*) | ast::sty_uniq(*) => {} + ast::sty_region(..) | ast::sty_box(..) | ast::sty_uniq(..) => {} } if ty::type_has_self(method_fty) { // reason (a) above @@ -1155,8 +1155,8 @@ impl<'self> LookupContext<'self> { } // XXX: does this properly enforce this on everything now // that self has been merged in? -sully - method_param(method_param { trait_id: trait_id, _ }) | - method_object(method_object { trait_id: trait_id, _ }) => { + method_param(method_param { trait_id: trait_id, .. }) | + method_object(method_object { trait_id: trait_id, .. }) => { bad = self.tcx().destructor_for_type.contains_key(&trait_id); } } diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 6bd8226258b..8caf873a889 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -198,7 +198,7 @@ impl PurityState { purity => { let (purity, def) = match blk.rules { - ast::UnsafeBlock(*) => (ast::unsafe_fn, blk.id), + ast::UnsafeBlock(..) => (ast::unsafe_fn, blk.id), ast::DefaultBlock => (purity, self.def), }; PurityState{ def: def, @@ -622,7 +622,7 @@ pub fn check_item(ccx: @mut CrateCtxt, it: @ast::item) { let trait_def = ty::lookup_trait_def(ccx.tcx, local_def(it.id)); for trait_method in (*trait_methods).iter() { match *trait_method { - required(*) => { + required(..) => { // Nothing to do, since required methods don't have // bodies to check. } @@ -633,7 +633,7 @@ pub fn check_item(ccx: @mut CrateCtxt, it: @ast::item) { } } } - ast::item_struct(*) => { + ast::item_struct(..) => { check_struct(ccx, it.id, it.span); } ast::item_ty(ref t, ref generics) => { @@ -1354,8 +1354,8 @@ pub fn check_lit(fcx: @mut FnCtxt, lit: @ast::lit) -> ty::t { let tcx = fcx.ccx.tcx; match lit.node { - ast::lit_str(*) => ty::mk_estr(tcx, ty::vstore_slice(ty::ReStatic)), - ast::lit_binary(*) => { + ast::lit_str(..) => ty::mk_estr(tcx, ty::vstore_slice(ty::ReStatic)), + ast::lit_binary(..) => { ty::mk_evec(tcx, ty::mt{ ty: ty::mk_u8(), mutbl: ast::MutImmutable }, ty::vstore_slice(ty::ReStatic)) } @@ -1743,9 +1743,9 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, }; for (i, arg) in args.iter().take(t).enumerate() { let is_block = match arg.node { - ast::ExprFnBlock(*) | - ast::ExprProc(*) | - ast::ExprDoBody(*) => true, + ast::ExprFnBlock(..) | + ast::ExprProc(..) | + ast::ExprDoBody(..) => true, _ => false }; @@ -1874,8 +1874,8 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, }; let fn_sig = match *fn_sty { - ty::ty_bare_fn(ty::BareFnTy {sig: ref sig, _}) | - ty::ty_closure(ty::ClosureTy {sig: ref sig, _}) => sig, + ty::ty_bare_fn(ty::BareFnTy {sig: ref sig, ..}) | + ty::ty_closure(ty::ClosureTy {sig: ref sig, ..}) => sig, _ => { fcx.type_error_message(call_expr.span, |actual| { format!("expected function but \ @@ -2573,7 +2573,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, match expr.node { ast::ExprVstore(ev, vst) => { let typ = match ev.node { - ast::ExprLit(@codemap::Spanned { node: ast::lit_str(*), _ }) => { + ast::ExprLit(@codemap::Spanned { node: ast::lit_str(..), .. }) => { let tt = ast_expr_vstore_to_vstore(fcx, ev, vst); ty::mk_estr(tcx, tt) } @@ -2723,13 +2723,13 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, } None => { match *sty { - ty::ty_enum(*) => { + ty::ty_enum(..) => { tcx.sess.span_err( expr.span, "can only dereference enums with a single variant which \ has a single argument"); } - ty::ty_struct(*) => { + ty::ty_struct(..) => { tcx.sess.span_err( expr.span, "can only dereference structs with one anonymous field"); @@ -2890,7 +2890,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, fcx.write_nil(id); } } - ast::ExprForLoop(*) => + ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"), ast::ExprLoop(ref body, _) => { check_block_no_value(fcx, (body)); @@ -3012,7 +3012,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt, else { match ty::get(t_1).sty { // This will be looked up later on - ty::ty_trait(*) => (), + ty::ty_trait(..) => (), _ => { if ty::type_is_nil(t_e) { @@ -3322,7 +3322,7 @@ pub fn check_stmt(fcx: @mut FnCtxt, stmt: @ast::Stmt) { saw_bot |= ty::type_is_bot(expr_ty); saw_err |= ty::type_is_error(expr_ty); } - ast::StmtMac(*) => fcx.ccx.tcx.sess.bug("unexpanded macro") + ast::StmtMac(..) => fcx.ccx.tcx.sess.bug("unexpanded macro") } if saw_bot { fcx.write_bot(node_id); @@ -3371,7 +3371,7 @@ pub fn check_block_with_expected(fcx: @mut FnCtxt, let s_ty = fcx.node_ty(s_id); if last_was_bot && !warned && match s.node { ast::StmtDecl(@codemap::Spanned { node: ast::DeclLocal(_), - _}, _) | + ..}, _) | ast::StmtExpr(_, _) | ast::StmtSemi(_, _) => { true } @@ -3656,28 +3656,28 @@ pub fn ty_param_bounds_and_ty_for_def(fcx: @mut FnCtxt, ast::DefTrait(_) | ast::DefTy(_) | ast::DefPrimTy(_) | - ast::DefTyParam(*)=> { + ast::DefTyParam(..)=> { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found type"); } - ast::DefMod(*) | ast::DefForeignMod(*) => { + ast::DefMod(..) | ast::DefForeignMod(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found module"); } - ast::DefUse(*) => { + ast::DefUse(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found use"); } - ast::DefRegion(*) => { + ast::DefRegion(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found region"); } - ast::DefTyParamBinder(*) => { + ast::DefTyParamBinder(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found type parameter"); } - ast::DefLabel(*) => { + ast::DefLabel(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found label"); } - ast::DefSelfTy(*) => { + ast::DefSelfTy(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found self ty"); } - ast::DefMethod(*) => { + ast::DefMethod(..) => { fcx.ccx.tcx.sess.span_bug(sp, "expected value but found method"); } } @@ -3905,7 +3905,7 @@ pub fn check_bounds_are_used(ccx: @mut CrateCtxt, ty::walk_ty(ty, |t| { match ty::get(t).sty { - ty::ty_param(param_ty {idx, _}) => { + ty::ty_param(param_ty {idx, ..}) => { debug!("Found use of ty param \\#{}", idx); tps_used[idx] = true; } diff --git a/src/librustc/middle/typeck/check/regionck.rs b/src/librustc/middle/typeck/check/regionck.rs index 98ef129dd20..57781fbe6cc 100644 --- a/src/librustc/middle/typeck/check/regionck.rs +++ b/src/librustc/middle/typeck/check/regionck.rs @@ -164,7 +164,7 @@ pub fn regionck_fn(fcx: @mut FnCtxt, blk: &ast::Block) { } impl Visitor<()> for Rcx { - // (*) FIXME(#3238) should use visit_pat, not visit_arm/visit_local, + // (..) FIXME(#3238) should use visit_pat, not visit_arm/visit_local, // However, right now we run into an issue whereby some free // regions are not properly related if they appear within the // types of arguments that must be inferred. This could be @@ -176,7 +176,7 @@ impl Visitor<()> for Rcx { fn visit_expr(&mut self, ex:@ast::Expr, _:()) { visit_expr(self, ex); } - //visit_pat: visit_pat, // (*) see above + //visit_pat: visit_pat, // (..) see above fn visit_arm(&mut self, a:&ast::Arm, _:()) { visit_arm(self, a); } @@ -264,11 +264,11 @@ fn visit_expr(rcx: &mut Rcx, expr: @ast::Expr) { // operators is a hopeless mess and I can't figure out how to // represent it. - ndm // - // ast::expr_assign_op(*) | + // ast::expr_assign_op(..) | - ast::ExprIndex(*) | - ast::ExprBinary(*) | - ast::ExprUnary(*) if has_method_map => { + ast::ExprIndex(..) | + ast::ExprBinary(..) | + ast::ExprUnary(..) if has_method_map => { tcx.region_maps.record_cleanup_scope(expr.id); } ast::ExprBinary(_, ast::BiAnd, lhs, rhs) | @@ -276,8 +276,8 @@ fn visit_expr(rcx: &mut Rcx, expr: @ast::Expr) { tcx.region_maps.record_cleanup_scope(lhs.id); tcx.region_maps.record_cleanup_scope(rhs.id); } - ast::ExprCall(*) | - ast::ExprMethodCall(*) => { + ast::ExprCall(..) | + ast::ExprMethodCall(..) => { tcx.region_maps.record_cleanup_scope(expr.id); } ast::ExprMatch(_, ref arms) => { @@ -427,7 +427,7 @@ fn visit_expr(rcx: &mut Rcx, expr: @ast::Expr) { visit::walk_expr(rcx, expr, ()); } - ast::ExprFnBlock(*) | ast::ExprProc(*) => { + ast::ExprFnBlock(..) | ast::ExprProc(..) => { check_expr_fn_block(rcx, expr); } @@ -462,7 +462,7 @@ fn check_expr_fn_block(rcx: &mut Rcx, match ty::get(function_type).sty { ty::ty_closure( ty::ClosureTy { - sigil: ast::BorrowedSigil, region: region, _}) => { + sigil: ast::BorrowedSigil, region: region, ..}) => { if get_freevars(tcx, expr.id).is_empty() { // No free variables means that the environment // will be NULL at runtime and hence the closure @@ -504,7 +504,7 @@ fn constrain_callee(rcx: &mut Rcx, let callee_ty = rcx.resolve_node_type(callee_id); match ty::get(callee_ty).sty { - ty::ty_bare_fn(*) => { } + ty::ty_bare_fn(..) => { } ty::ty_closure(ref closure_ty) => { rcx.fcx.mk_subr(true, infer::InvokeClosure(callee_expr.span), call_region, closure_ty.region); @@ -1004,7 +1004,7 @@ pub mod guarantor { guarantor(rcx, e) } - ast::ExprPath(*) | ast::ExprSelf => { + ast::ExprPath(..) | ast::ExprSelf => { // Either a variable or constant and hence resides // in constant memory or on the stack frame. Either way, // not guaranteed by a region pointer. @@ -1013,39 +1013,39 @@ pub mod guarantor { // All of these expressions are rvalues and hence their // value is not guaranteed by a region pointer. - ast::ExprInlineAsm(*) | - ast::ExprMac(*) | + ast::ExprInlineAsm(..) | + ast::ExprMac(..) | ast::ExprLit(_) | - ast::ExprUnary(*) | - ast::ExprAddrOf(*) | - ast::ExprBinary(*) | - ast::ExprVstore(*) | - ast::ExprBreak(*) | - ast::ExprAgain(*) | - ast::ExprRet(*) | + ast::ExprUnary(..) | + ast::ExprAddrOf(..) | + ast::ExprBinary(..) | + ast::ExprVstore(..) | + ast::ExprBreak(..) | + ast::ExprAgain(..) | + ast::ExprRet(..) | ast::ExprLogLevel | - ast::ExprWhile(*) | - ast::ExprLoop(*) | - ast::ExprAssign(*) | - ast::ExprAssignOp(*) | - ast::ExprCast(*) | - ast::ExprCall(*) | - ast::ExprMethodCall(*) | - ast::ExprStruct(*) | - ast::ExprTup(*) | - ast::ExprIf(*) | - ast::ExprMatch(*) | - ast::ExprFnBlock(*) | - ast::ExprProc(*) | - ast::ExprDoBody(*) | - ast::ExprBlock(*) | - ast::ExprRepeat(*) | - ast::ExprVec(*) => { + ast::ExprWhile(..) | + ast::ExprLoop(..) | + ast::ExprAssign(..) | + ast::ExprAssignOp(..) | + ast::ExprCast(..) | + ast::ExprCall(..) | + ast::ExprMethodCall(..) | + ast::ExprStruct(..) | + ast::ExprTup(..) | + ast::ExprIf(..) | + ast::ExprMatch(..) | + ast::ExprFnBlock(..) | + ast::ExprProc(..) | + ast::ExprDoBody(..) | + ast::ExprBlock(..) | + ast::ExprRepeat(..) | + ast::ExprVec(..) => { assert!(!ty::expr_is_lval( rcx.fcx.tcx(), rcx.fcx.inh.method_map, expr)); None } - ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), + ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"), } } @@ -1056,7 +1056,7 @@ pub mod guarantor { debug!("before adjustments, cat={:?}", expr_ct.cat); match rcx.fcx.inh.adjustments.find(&expr.id) { - Some(&@ty::AutoAddEnv(*)) => { + Some(&@ty::AutoAddEnv(..)) => { // This is basically an rvalue, not a pointer, no regions // involved. expr_ct.cat = ExprCategorization { @@ -1166,14 +1166,14 @@ pub mod guarantor { ty::ty_estr(ty::vstore_slice(r)) => { BorrowedPointer(r) } - ty::ty_uniq(*) | + ty::ty_uniq(..) | ty::ty_estr(ty::vstore_uniq) | ty::ty_trait(_, _, ty::UniqTraitStore, _, _) | ty::ty_evec(_, ty::vstore_uniq) => { OwnedPointer } - ty::ty_box(*) | - ty::ty_ptr(*) | + ty::ty_box(..) | + ty::ty_ptr(..) | ty::ty_evec(_, ty::vstore_box) | ty::ty_trait(_, _, ty::BoxTraitStore, _, _) | ty::ty_estr(ty::vstore_box) => { @@ -1255,8 +1255,8 @@ pub mod guarantor { let r = ty::ty_region(rcx.fcx.tcx(), pat.span, rptr_ty); link_ref_bindings_in_pat(rcx, p, Some(r)); } - ast::PatLit(*) => {} - ast::PatRange(*) => {} + ast::PatLit(..) => {} + ast::PatRange(..) => {} ast::PatVec(ref before, ref slice, ref after) => { let vec_ty = rcx.resolve_node_type(pat.id); let vstore = ty::ty_vstore(vec_ty); diff --git a/src/librustc/middle/typeck/check/vtable.rs b/src/librustc/middle/typeck/check/vtable.rs index 782a5276b74..abdab02dedd 100644 --- a/src/librustc/middle/typeck/check/vtable.rs +++ b/src/librustc/middle/typeck/check/vtable.rs @@ -248,7 +248,7 @@ fn lookup_vtable(vcx: &VtableContext, // If the type is self or a param, we look at the trait/supertrait // bounds to see if they include the trait we are looking for. let vtable_opt = match ty::get(ty).sty { - ty::ty_param(param_ty {idx: n, _}) => { + ty::ty_param(param_ty {idx: n, ..}) => { let type_param_bounds: &[@ty::TraitRef] = vcx.param_env.type_param_bounds[n].trait_bounds; lookup_vtable_from_bounds(vcx, @@ -559,7 +559,7 @@ pub fn early_resolve_expr(ex: @ast::Expr, let cx = fcx.ccx; match ex.node { - ast::ExprPath(*) => { + ast::ExprPath(..) => { fcx.opt_node_ty_substs(ex.id, |substs| { debug!("vtable resolution on parameter bounds for expr {}", ex.repr(fcx.tcx())); @@ -631,7 +631,7 @@ pub fn early_resolve_expr(ex: @ast::Expr, match (&ty::get(ty).sty, store) { (&ty::ty_box(mt), ty::BoxTraitStore) | (&ty::ty_uniq(mt), ty::UniqTraitStore) | - (&ty::ty_rptr(_, mt), ty::RegionTraitStore(*)) + (&ty::ty_rptr(_, mt), ty::RegionTraitStore(..)) if !mutability_allowed(mt.mutbl, target_mutbl) => { fcx.tcx().sess.span_err(ex.span, format!("types differ in mutability")); @@ -639,7 +639,7 @@ pub fn early_resolve_expr(ex: @ast::Expr, (&ty::ty_box(mt), ty::BoxTraitStore) | (&ty::ty_uniq(mt), ty::UniqTraitStore) | - (&ty::ty_rptr(_, mt), ty::RegionTraitStore(*)) => { + (&ty::ty_rptr(_, mt), ty::RegionTraitStore(..)) => { let location_info = &location_info_for_expr(ex); let vcx = fcx.vtable_context(); diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index 115058824c6..f7a1662ca12 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -75,15 +75,15 @@ pub fn get_base_type(inference_context: @mut InferCtxt, } match get(resolved_type).sty { - ty_enum(*) | ty_trait(*) | ty_struct(*) => { + ty_enum(..) | ty_trait(..) | ty_struct(..) => { debug!("(getting base type) found base type"); Some(resolved_type) } - ty_nil | ty_bot | ty_bool | ty_char | ty_int(*) | ty_uint(*) | ty_float(*) | - ty_estr(*) | ty_evec(*) | ty_bare_fn(*) | ty_closure(*) | ty_tup(*) | - ty_infer(*) | ty_param(*) | ty_self(*) | ty_type | ty_opaque_box | - ty_opaque_closure_ptr(*) | ty_unboxed_vec(*) | ty_err | ty_box(_) | + ty_nil | ty_bot | ty_bool | ty_char | ty_int(..) | ty_uint(..) | ty_float(..) | + ty_estr(..) | ty_evec(..) | ty_bare_fn(..) | ty_closure(..) | ty_tup(..) | + ty_infer(..) | ty_param(..) | ty_self(..) | ty_type | ty_opaque_box | + ty_opaque_closure_ptr(..) | ty_unboxed_vec(..) | ty_err | ty_box(_) | ty_uniq(_) | ty_ptr(_) | ty_rptr(_, _) => { debug!("(getting base type) no base type; found {:?}", get(original_type).sty); @@ -562,7 +562,7 @@ impl CoherenceChecker { } Some(&node_item(item, _)) => { match item.node { - item_struct(*) | item_enum(*) => true, + item_struct(..) | item_enum(..) => true, _ => false, } } diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index aa99c2b0f37..11cbcd4cbdd 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -74,7 +74,7 @@ impl visit::Visitor<()> for CollectItemTypesVisitor { pub fn collect_item_types(ccx: @mut CrateCtxt, crate: &ast::Crate) { fn collect_intrinsic_type(ccx: &CrateCtxt, lang_item: ast::DefId) { - let ty::ty_param_bounds_and_ty { ty: ty, _ } = + let ty::ty_param_bounds_and_ty { ty: ty, .. } = ccx.get_item_ty(lang_item); ccx.tcx.intrinsic_defs.insert(lang_item, ty); } @@ -184,7 +184,7 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt, match tcx.items.get_copy(&trait_id) { ast_map::node_item(@ast::item { node: ast::item_trait(ref generics, _, ref ms), - _ + .. }, _) => { let trait_ty_generics = ty_generics(ccx, generics, 0); @@ -811,7 +811,7 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: &ast::item) tcx.tcache.insert(local_def(it.id), tpt); return tpt; } - ast::item_trait(*) => { + ast::item_trait(..) => { tcx.sess.span_bug( it.span, format!("Invoked ty_of_item on trait")); @@ -827,9 +827,9 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: &ast::item) tcx.tcache.insert(local_def(it.id), tpt); return tpt; } - ast::item_impl(*) | ast::item_mod(_) | + ast::item_impl(..) | ast::item_mod(_) | ast::item_foreign_mod(_) => fail!(), - ast::item_mac(*) => fail!("item macros unimplemented") + ast::item_mac(..) => fail!("item macros unimplemented") } } diff --git a/src/librustc/middle/typeck/infer/coercion.rs b/src/librustc/middle/typeck/infer/coercion.rs index e825aca2eec..f4c3c33dbb3 100644 --- a/src/librustc/middle/typeck/infer/coercion.rs +++ b/src/librustc/middle/typeck/infer/coercion.rs @@ -115,13 +115,13 @@ impl Coerce { }); } - ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil, _}) => { + ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil, ..}) => { return self.unpack_actual_value(a, |sty_a| { self.coerce_borrowed_fn(a, sty_a, b) }); } - ty::ty_trait(_, _, ty::RegionTraitStore(*), m, _) => { + ty::ty_trait(_, _, ty::RegionTraitStore(..), m, _) => { return self.unpack_actual_value(a, |sty_a| { self.coerce_borrowed_object(a, sty_a, b, m) }); diff --git a/src/librustc/middle/typeck/infer/error_reporting.rs b/src/librustc/middle/typeck/infer/error_reporting.rs index 635de28194d..04ba1bcb31f 100644 --- a/src/librustc/middle/typeck/infer/error_reporting.rs +++ b/src/librustc/middle/typeck/infer/error_reporting.rs @@ -472,7 +472,7 @@ impl ErrorReportingHelpers for InferCtxt { infer::BoundRegionInTypeOrImpl(_) => { format!(" for region in type/impl") } - infer::BoundRegionInCoherence(*) => { + infer::BoundRegionInCoherence(..) => { format!(" for coherence check") } }; diff --git a/src/librustc/middle/typeck/infer/region_inference/doc.rs b/src/librustc/middle/typeck/infer/region_inference/doc.rs index 2b99a0a4f0e..f63779cd8b8 100644 --- a/src/librustc/middle/typeck/infer/region_inference/doc.rs +++ b/src/librustc/middle/typeck/infer/region_inference/doc.rs @@ -192,10 +192,10 @@ going on: fn weird() { let mut x: ~Foo = ~Foo { ... }; 'a: add(&mut (*x).f, - 'b: inc(&mut (*x).f)) // (*) + 'b: inc(&mut (*x).f)) // (..) } -The important part is the line marked `(*)` which contains a call to +The important part is the line marked `(..)` which contains a call to `add()`. The first argument is a mutable borrow of the field `f`. The second argument also borrows the field `f`. Now, in the current borrow checker, the first borrow is given the lifetime of the call to @@ -248,7 +248,7 @@ this similar but unsound example: } fn weird() { let mut x: ~Foo = ~Foo { ... }; - 'a: add(&mut (*x).f, consume(x)) // (*) + 'a: add(&mut (*x).f, consume(x)) // (..) } In this case, the second argument to `add` actually consumes `x`, thus diff --git a/src/librustc/middle/typeck/infer/region_inference/mod.rs b/src/librustc/middle/typeck/infer/region_inference/mod.rs index f639139d265..1a36d2c54d8 100644 --- a/src/librustc/middle/typeck/infer/region_inference/mod.rs +++ b/src/librustc/middle/typeck/infer/region_inference/mod.rs @@ -244,10 +244,10 @@ impl RegionVarBindings { debug!("RegionVarBindings: make_subregion({:?}, {:?})", sub, sup); match (sub, sup) { - (ReEarlyBound(*), _) | - (ReLateBound(*), _) | - (_, ReEarlyBound(*)) | - (_, ReLateBound(*)) => { + (ReEarlyBound(..), _) | + (ReLateBound(..), _) | + (_, ReEarlyBound(..)) | + (_, ReLateBound(..)) => { self.tcx.sess.span_bug( origin.span(), format!("Cannot relate bound region: {} <= {}", @@ -493,10 +493,10 @@ impl RegionVarBindings { fn lub_concrete_regions(&self, a: Region, b: Region) -> Region { match (a, b) { - (ReLateBound(*), _) | - (_, ReLateBound(*)) | - (ReEarlyBound(*), _) | - (_, ReEarlyBound(*)) => { + (ReLateBound(..), _) | + (_, ReLateBound(..)) | + (ReEarlyBound(..), _) | + (_, ReEarlyBound(..)) => { self.tcx.sess.bug( format!("Cannot relate bound region: LUB({}, {})", a.repr(self.tcx), @@ -553,8 +553,8 @@ impl RegionVarBindings { // For these types, we cannot define any additional // relationship: - (ReInfer(ReSkolemized(*)), _) | - (_, ReInfer(ReSkolemized(*))) => { + (ReInfer(ReSkolemized(..)), _) | + (_, ReInfer(ReSkolemized(..))) => { if a == b {a} else {ReStatic} } } @@ -597,10 +597,10 @@ impl RegionVarBindings { -> cres { debug!("glb_concrete_regions({:?}, {:?})", a, b); match (a, b) { - (ReLateBound(*), _) | - (_, ReLateBound(*)) | - (ReEarlyBound(*), _) | - (_, ReEarlyBound(*)) => { + (ReLateBound(..), _) | + (_, ReLateBound(..)) | + (ReEarlyBound(..), _) | + (_, ReEarlyBound(..)) => { self.tcx.sess.bug( format!("Cannot relate bound region: GLB({}, {})", a.repr(self.tcx), @@ -649,8 +649,8 @@ impl RegionVarBindings { // For these types, we cannot define any additional // relationship: - (ReInfer(ReSkolemized(*)), _) | - (_, ReInfer(ReSkolemized(*))) => { + (ReInfer(ReSkolemized(..)), _) | + (_, ReInfer(ReSkolemized(..))) => { if a == b { Ok(a) } else { @@ -779,11 +779,11 @@ impl RegionVarBindings { } } } - ConstrainVarSubReg(*) => { + ConstrainVarSubReg(..) => { // This is a contraction constraint. Ignore it. false } - ConstrainRegSubReg(*) => { + ConstrainRegSubReg(..) => { // No region variables involved. Ignore. false } @@ -831,7 +831,7 @@ impl RegionVarBindings { var_data: &mut [VarData]) { self.iterate_until_fixed_point("Contraction", |constraint| { match *constraint { - ConstrainRegSubVar(*) => { + ConstrainRegSubVar(..) => { // This is an expansion constraint. Ignore. false } @@ -848,7 +848,7 @@ impl RegionVarBindings { let a_data = &mut var_data[a_vid.to_uint()]; self.contract_node(a_vid, a_data, b_region) } - ConstrainRegSubReg(*) => { + ConstrainRegSubReg(..) => { // No region variables involved. Ignore. false } @@ -934,9 +934,9 @@ impl RegionVarBindings { { for (constraint, _) in self.constraints.iter() { let (sub, sup) = match *constraint { - ConstrainVarSubVar(*) | - ConstrainRegSubVar(*) | - ConstrainVarSubReg(*) => { + ConstrainVarSubVar(..) | + ConstrainRegSubVar(..) | + ConstrainVarSubReg(..) => { continue; } ConstrainRegSubReg(sub, sup) => { @@ -1065,7 +1065,7 @@ impl RegionVarBindings { dummy_idx, *constraint); } - ConstrainRegSubReg(*) => { + ConstrainRegSubReg(..) => { // Relations between two concrete regions do not // require an edge in the graph. } @@ -1214,7 +1214,7 @@ impl RegionVarBindings { process_edges(self, &mut state, graph, node_idx, dir); } - let WalkState {result, dup_found, _} = state; + let WalkState {result, dup_found, ..} = state; return (result, dup_found); fn process_edges(this: &RegionVarBindings, @@ -1243,7 +1243,7 @@ impl RegionVarBindings { }); } - ConstrainRegSubReg(*) => {} + ConstrainRegSubReg(..) => {} } true }); diff --git a/src/librustc/middle/typeck/infer/test.rs b/src/librustc/middle/typeck/infer/test.rs index 7c56594d267..a48e7b5d0f0 100644 --- a/src/librustc/middle/typeck/infer/test.rs +++ b/src/librustc/middle/typeck/infer/test.rs @@ -126,14 +126,14 @@ impl Env { } return match it.node { - ast::item_const(*) | ast::item_fn(*) | - ast::item_foreign_mod(*) | ast::item_ty(*) => { + ast::item_const(..) | ast::item_fn(..) | + ast::item_foreign_mod(..) | ast::item_ty(..) => { None } - ast::item_enum(*) | ast::item_struct(*) | - ast::item_trait(*) | ast::item_impl(*) | - ast::item_mac(*) => { + ast::item_enum(..) | ast::item_struct(..) | + ast::item_trait(..) | ast::item_impl(..) | + ast::item_mac(..) => { None } diff --git a/src/librustc/middle/typeck/mod.rs b/src/librustc/middle/typeck/mod.rs index 6afbcf053b8..ac7e6940b60 100644 --- a/src/librustc/middle/typeck/mod.rs +++ b/src/librustc/middle/typeck/mod.rs @@ -344,7 +344,7 @@ fn check_main_fn_ty(ccx: &CrateCtxt, let tcx = ccx.tcx; let main_t = ty::node_id_to_type(tcx, main_id); match ty::get(main_t).sty { - ty::ty_bare_fn(*) => { + ty::ty_bare_fn(..) => { match tcx.items.find(&main_id) { Some(&ast_map::node_item(it,_)) => { match it.node { diff --git a/src/librustc/middle/typeck/variance.rs b/src/librustc/middle/typeck/variance.rs index 985bcaf96d1..95fe4ec34c6 100644 --- a/src/librustc/middle/typeck/variance.rs +++ b/src/librustc/middle/typeck/variance.rs @@ -338,7 +338,7 @@ impl<'self> Visitor<()> for TermsContext<'self> { // tcx, we rely on the fact that all inferreds for a particular // item are assigned continuous indices. match item.node { - ast::item_trait(*) => { + ast::item_trait(..) => { self.add_inferred(item.id, SelfParam, 0, item.id); } _ => { } @@ -372,13 +372,13 @@ impl<'self> Visitor<()> for TermsContext<'self> { visit::walk_item(self, item, ()); } - ast::item_impl(*) | - ast::item_static(*) | - ast::item_fn(*) | - ast::item_mod(*) | - ast::item_foreign_mod(*) | - ast::item_ty(*) | - ast::item_mac(*) => { + ast::item_impl(..) | + ast::item_static(..) | + ast::item_fn(..) | + ast::item_mod(..) | + ast::item_foreign_mod(..) | + ast::item_ty(..) | + ast::item_mac(..) => { visit::walk_item(self, item, ()); } } @@ -460,7 +460,7 @@ impl<'self> Visitor<()> for ConstraintContext<'self> { } } - ast::item_struct(*) => { + ast::item_struct(..) => { let struct_fields = ty::lookup_struct_fields(tcx, did); for field_info in struct_fields.iter() { assert_eq!(field_info.id.crate, ast::LOCAL_CRATE); @@ -469,7 +469,7 @@ impl<'self> Visitor<()> for ConstraintContext<'self> { } } - ast::item_trait(*) => { + ast::item_trait(..) => { let methods = ty::trait_methods(tcx, did); for method in methods.iter() { match method.transformed_self_ty { @@ -493,13 +493,13 @@ impl<'self> Visitor<()> for ConstraintContext<'self> { } } - ast::item_static(*) | - ast::item_fn(*) | - ast::item_mod(*) | - ast::item_foreign_mod(*) | - ast::item_ty(*) | - ast::item_impl(*) | - ast::item_mac(*) => { + ast::item_static(..) | + ast::item_fn(..) | + ast::item_mod(..) | + ast::item_foreign_mod(..) | + ast::item_ty(..) | + ast::item_impl(..) | + ast::item_mac(..) => { visit::walk_item(self, item, ()); } } @@ -659,7 +659,7 @@ impl<'self> ConstraintContext<'self> { substs, variance); } - ty::ty_param(ty::param_ty { def_id: ref def_id, _ }) => { + ty::ty_param(ty::param_ty { def_id: ref def_id, .. }) => { assert_eq!(def_id.crate, ast::LOCAL_CRATE); match self.terms_cx.inferred_map.find(&def_id.node) { Some(&index) => { @@ -679,19 +679,19 @@ impl<'self> ConstraintContext<'self> { self.add_constraint(index, variance); } - ty::ty_bare_fn(ty::BareFnTy { sig: ref sig, _ }) => { + ty::ty_bare_fn(ty::BareFnTy { sig: ref sig, .. }) => { self.add_constraints_from_sig(sig, variance); } - ty::ty_closure(ty::ClosureTy { sig: ref sig, region, _ }) => { + ty::ty_closure(ty::ClosureTy { sig: ref sig, region, .. }) => { let contra = self.contravariant(variance); self.add_constraints_from_region(region, contra); self.add_constraints_from_sig(sig, variance); } - ty::ty_infer(*) | ty::ty_err | ty::ty_type | - ty::ty_opaque_box | ty::ty_opaque_closure_ptr(*) | - ty::ty_unboxed_vec(*) => { + ty::ty_infer(..) | ty::ty_err | ty::ty_type | + ty::ty_opaque_box | ty::ty_opaque_closure_ptr(..) | + ty::ty_unboxed_vec(..) => { self.tcx().sess.bug( format!("Unexpected type encountered in \ variance inference: {}", @@ -770,12 +770,12 @@ impl<'self> ConstraintContext<'self> { ty::ReStatic => { } - ty::ReLateBound(*) => { + ty::ReLateBound(..) => { // We do not infer variance for region parameters on // methods or in fn types. } - ty::ReFree(*) | ty::ReScope(*) | ty::ReInfer(*) | + ty::ReFree(..) | ty::ReScope(..) | ty::ReInfer(..) | ty::ReEmpty => { // We don't expect to see anything but 'static or bound // regions when visiting member types or method types. @@ -822,7 +822,7 @@ struct SolveContext<'self> { } fn solve_constraints(constraints_cx: ConstraintContext) { - let ConstraintContext { terms_cx, constraints, _ } = constraints_cx; + let ConstraintContext { terms_cx, constraints, .. } = constraints_cx; let solutions = vec::from_elem(terms_cx.num_inferred(), ty::Bivariant); let mut solutions_cx = SolveContext { terms_cx: terms_cx, diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 28fe067293b..a0823a584c3 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -71,7 +71,7 @@ impl<'self> Visitor<()> for LoopQueryVisitor<'self> { match e.node { // Skip inner loops, since a break in the inner loop isn't a // break inside the outer loop - ast::ExprLoop(*) | ast::ExprWhile(*) => {} + ast::ExprLoop(..) | ast::ExprWhile(..) => {} _ => visit::walk_expr(self, e, ()) } } diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 0364eb890fb..1a7640e5b9a 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -81,11 +81,11 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region) } Some(&ast_map::node_expr(expr)) => { match expr.node { - ast::ExprCall(*) => explain_span(cx, "call", expr.span), - ast::ExprMethodCall(*) => { + ast::ExprCall(..) => explain_span(cx, "call", expr.span), + ast::ExprMethodCall(..) => { explain_span(cx, "method call", expr.span) }, - ast::ExprMatch(*) => explain_span(cx, "match", expr.span), + ast::ExprMatch(..) => explain_span(cx, "match", expr.span), _ => explain_span(cx, "expression", expr.span) } } @@ -93,7 +93,7 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region) explain_span(cx, "statement", stmt.span) } Some(&ast_map::node_item(it, _)) if (match it.node { - ast::item_fn(*) => true, _ => false}) => { + ast::item_fn(..) => true, _ => false}) => { explain_span(cx, "function body", it.span) } Some(_) | None => { @@ -119,7 +119,7 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region) (format!("{} {}", prefix, msg), opt_span) } Some(&ast_map::node_item(it, _)) if match it.node { - ast::item_impl(*) => true, _ => false} => { + ast::item_impl(..) => true, _ => false} => { let (msg, opt_span) = explain_span(cx, "impl", it.span); (format!("{} {}", prefix, msg), opt_span) } @@ -136,7 +136,7 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region) // I believe these cases should not occur (except when debugging, // perhaps) - ty::ReInfer(_) | ty::ReEarlyBound(*) | ty::ReLateBound(*) => { + ty::ReInfer(_) | ty::ReEarlyBound(..) | ty::ReLateBound(..) => { (format!("lifetime {:?}", region), None) } }; @@ -179,18 +179,18 @@ pub fn ReScope_id_to_str(cx: ctxt, node_id: ast::NodeId) -> ~str { } Some(&ast_map::node_expr(expr)) => { match expr.node { - ast::ExprCall(*) => { + ast::ExprCall(..) => { format!("", cx.sess.codemap.span_to_str(expr.span)) } - ast::ExprMatch(*) => { + ast::ExprMatch(..) => { format!("", cx.sess.codemap.span_to_str(expr.span)) } - ast::ExprAssignOp(*) | - ast::ExprUnary(*) | - ast::ExprBinary(*) | - ast::ExprIndex(*) => { + ast::ExprAssignOp(..) | + ast::ExprUnary(..) | + ast::ExprBinary(..) | + ast::ExprIndex(..) => { format!("", cx.sess.codemap.span_to_str(expr.span)) } @@ -494,7 +494,7 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str { }; if !cx.sess.verbose() { ident } else { format!("{}:{:?}", ident, did) } } - ty_self(*) => ~"Self", + ty_self(..) => ~"Self", ty_enum(did, ref substs) | ty_struct(did, ref substs) => { let path = ty::item_path(cx, did); let base = ast_map::path_to_str(path, cx.sess.intr()); @@ -751,12 +751,12 @@ impl Repr for ast::DefId { // and otherwise fallback to just printing the crate/node pair if self.crate == ast::LOCAL_CRATE { match tcx.items.find(&self.node) { - Some(&ast_map::node_item(*)) | - Some(&ast_map::node_foreign_item(*)) | - Some(&ast_map::node_method(*)) | - Some(&ast_map::node_trait_method(*)) | - Some(&ast_map::node_variant(*)) | - Some(&ast_map::node_struct_ctor(*)) => { + Some(&ast_map::node_item(..)) | + Some(&ast_map::node_foreign_item(..)) | + Some(&ast_map::node_method(..)) | + Some(&ast_map::node_trait_method(..)) | + Some(&ast_map::node_variant(..)) | + Some(&ast_map::node_struct_ctor(..)) => { return format!("{:?}:{}", *self, ty::item_path_str(tcx, *self)); } _ => {} diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index 11c2aca6c34..87d2b5dac1e 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -151,19 +151,19 @@ impl Item { } pub fn is_mod(&self) -> bool { - match self.inner { ModuleItem(*) => true, _ => false } + match self.inner { ModuleItem(..) => true, _ => false } } pub fn is_trait(&self) -> bool { - match self.inner { TraitItem(*) => true, _ => false } + match self.inner { TraitItem(..) => true, _ => false } } pub fn is_struct(&self) -> bool { - match self.inner { StructItem(*) => true, _ => false } + match self.inner { StructItem(..) => true, _ => false } } pub fn is_enum(&self) -> bool { - match self.inner { EnumItem(*) => true, _ => false } + match self.inner { EnumItem(..) => true, _ => false } } pub fn is_fn(&self) -> bool { - match self.inner { FunctionItem(*) => true, _ => false } + match self.inner { FunctionItem(..) => true, _ => false } } } @@ -538,13 +538,13 @@ pub enum TraitMethod { impl TraitMethod { pub fn is_req(&self) -> bool { match self { - &Required(*) => true, + &Required(..) => true, _ => false, } } pub fn is_def(&self) -> bool { match self { - &Provided(*) => true, + &Provided(..) => true, _ => false, } } @@ -1140,17 +1140,17 @@ fn name_from_pat(p: &ast::Pat) -> ~str { PatWildMulti => ~"..", PatIdent(_, ref p, _) => path_to_str(p), PatEnum(ref p, _) => path_to_str(p), - PatStruct(*) => fail!("tried to get argument name from pat_struct, \ + PatStruct(..) => fail!("tried to get argument name from pat_struct, \ which is not allowed in function arguments"), - PatTup(*) => ~"(tuple arg NYI)", + PatTup(..) => ~"(tuple arg NYI)", PatBox(p) => name_from_pat(p), PatUniq(p) => name_from_pat(p), PatRegion(p) => name_from_pat(p), - PatLit(*) => fail!("tried to get argument name from pat_lit, \ + PatLit(..) => fail!("tried to get argument name from pat_lit, \ which is not allowed in function arguments"), - PatRange(*) => fail!("tried to get argument name from pat_range, \ + PatRange(..) => fail!("tried to get argument name from pat_range, \ which is not allowed in function arguments"), - PatVec(*) => fail!("tried to get argument name from pat_vec, \ + PatVec(..) => fail!("tried to get argument name from pat_vec, \ which is not allowed in function arguments") } } diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 79aba0f1320..dc8e9072499 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -73,7 +73,7 @@ fn get_ast_and_resolve(cpath: &Path, let mut crate = phase_1_parse_input(sess, cfg.clone(), &input); crate = phase_2_configure_and_expand(sess, cfg, crate); let driver::driver::CrateAnalysis { - exported_items, ty_cx, _ + exported_items, ty_cx, .. } = phase_3_run_analysis_passes(sess, &crate); debug!("crate: {:?}", crate); diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 90c317668fc..b80f92016a8 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -277,7 +277,7 @@ impl fmt::Default for clean::Type { external_path(f.buf, path, false, fqn.as_slice(), kind, crate); typarams(f.buf, tp); } - clean::Self(*) => f.buf.write("Self".as_bytes()), + clean::Self(..) => f.buf.write("Self".as_bytes()), clean::Primitive(prim) => { let s = match prim { ast::ty_int(ast::ty_i) => "int", diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 819316313b6..0df4820d822 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -423,7 +423,7 @@ impl<'self> SourceCollector<'self> { let mut r = match io::result(|| File::open(&p)) { Ok(r) => r, // eew macro hacks - Err(*) => return filename == "" + Err(..) => return filename == "" }; // read everything @@ -491,12 +491,12 @@ impl DocFolder for Cache { match item.inner { clean::ImplItem(ref i) => { match i.trait_ { - Some(clean::ResolvedPath{ id, _ }) => { + Some(clean::ResolvedPath{ id, .. }) => { let v = self.implementors.find_or_insert_with(id, |_|{ ~[] }); match i.for_ { - clean::ResolvedPath{_} => { + clean::ResolvedPath{..} => { v.unshift(PathType(i.for_.clone())); } _ => { @@ -506,7 +506,7 @@ impl DocFolder for Cache { } } } - Some(*) | None => {} + Some(..) | None => {} } } _ => {} @@ -516,21 +516,21 @@ impl DocFolder for Cache { match item.name { Some(ref s) => { let parent = match item.inner { - clean::TyMethodItem(*) | - clean::StructFieldItem(*) | - clean::VariantItem(*) => { + clean::TyMethodItem(..) | + clean::StructFieldItem(..) | + clean::VariantItem(..) => { Some((Some(*self.parent_stack.last()), self.stack.slice_to(self.stack.len() - 1))) } - clean::MethodItem(*) => { + clean::MethodItem(..) => { if self.parent_stack.len() == 0 { None } else { let last = self.parent_stack.last(); let amt = match self.paths.find(last) { Some(&(_, "trait")) => self.stack.len() - 1, - Some(*) | None => self.stack.len(), + Some(..) | None => self.stack.len(), }; Some((Some(*last), self.stack.slice_to(amt))) } @@ -562,10 +562,10 @@ impl DocFolder for Cache { } else { false } } else { false }; match item.inner { - clean::StructItem(*) | clean::EnumItem(*) | - clean::TypedefItem(*) | clean::TraitItem(*) | - clean::FunctionItem(*) | clean::ModuleItem(*) | - clean::ForeignFunctionItem(*) | clean::VariantItem(*) => { + clean::StructItem(..) | clean::EnumItem(..) | + clean::TypedefItem(..) | clean::TraitItem(..) | + clean::FunctionItem(..) | clean::ModuleItem(..) | + clean::ForeignFunctionItem(..) | clean::VariantItem(..) => { self.paths.insert(item.id, (self.stack.clone(), shortty(&item))); } _ => {} @@ -573,12 +573,12 @@ impl DocFolder for Cache { // Maintain the parent stack let parent_pushed = match item.inner { - clean::TraitItem(*) | clean::EnumItem(*) | clean::StructItem(*) => { + clean::TraitItem(..) | clean::EnumItem(..) | clean::StructItem(..) => { self.parent_stack.push(item.id); true } clean::ImplItem(ref i) => { match i.for_ { - clean::ResolvedPath{ id, _ } => { + clean::ResolvedPath{ id, .. } => { self.parent_stack.push(id); true } _ => false @@ -592,9 +592,9 @@ impl DocFolder for Cache { let ret = match self.fold_item_recur(item) { Some(item) => { match item { - clean::Item{ attrs, inner: clean::ImplItem(i), _ } => { + clean::Item{ attrs, inner: clean::ImplItem(i), .. } => { match i.for_ { - clean::ResolvedPath { id, _ } => { + clean::ResolvedPath { id, .. } => { let v = self.impls.find_or_insert_with(id, |_| { ~[] }); @@ -608,7 +608,7 @@ impl DocFolder for Cache { Some(clean::NameValue(_, dox)) => { v.push((i, Some(dox))); } - Some(*) | None => { + Some(..) | None => { v.push((i, None)); } } @@ -620,7 +620,7 @@ impl DocFolder for Cache { // Private modules may survive the strip-private pass if // they contain impls for public types, but those will get // stripped here - clean::Item { inner: clean::ModuleItem(ref m), _ } + clean::Item { inner: clean::ModuleItem(ref m), .. } if m.items.len() == 0 => None, i => Some(i), } @@ -800,7 +800,7 @@ impl Context { match item.inner { // modules are special because they add a namespace. We also need to // recurse into the items of the module as well. - clean::ModuleItem(*) => { + clean::ModuleItem(..) => { let name = item.name.get_ref().to_owned(); let item = Cell::new(item); self.recurse(name, |this| { @@ -833,28 +833,28 @@ impl Context { fn shortty(item: &clean::Item) -> &'static str { match item.inner { - clean::ModuleItem(*) => "mod", - clean::StructItem(*) => "struct", - clean::EnumItem(*) => "enum", - clean::FunctionItem(*) => "fn", - clean::TypedefItem(*) => "typedef", - clean::StaticItem(*) => "static", - clean::TraitItem(*) => "trait", - clean::ImplItem(*) => "impl", - clean::ViewItemItem(*) => "viewitem", - clean::TyMethodItem(*) => "tymethod", - clean::MethodItem(*) => "method", - clean::StructFieldItem(*) => "structfield", - clean::VariantItem(*) => "variant", - clean::ForeignFunctionItem(*) => "ffi", - clean::ForeignStaticItem(*) => "ffs", + clean::ModuleItem(..) => "mod", + clean::StructItem(..) => "struct", + clean::EnumItem(..) => "enum", + clean::FunctionItem(..) => "fn", + clean::TypedefItem(..) => "typedef", + clean::StaticItem(..) => "static", + clean::TraitItem(..) => "trait", + clean::ImplItem(..) => "impl", + clean::ViewItemItem(..) => "viewitem", + clean::TyMethodItem(..) => "tymethod", + clean::MethodItem(..) => "method", + clean::StructFieldItem(..) => "structfield", + clean::VariantItem(..) => "variant", + clean::ForeignFunctionItem(..) => "ffi", + clean::ForeignStaticItem(..) => "ffs", } } impl<'self> Item<'self> { fn ismodule(&self) -> bool { match self.item.inner { - clean::ModuleItem(*) => true, _ => false + clean::ModuleItem(..) => true, _ => false } } } @@ -895,11 +895,11 @@ impl<'self> fmt::Default for Item<'self> { // Write the breadcrumb trail header for the top write!(fmt.buf, "

"); match it.item.inner { - clean::ModuleItem(*) => write!(fmt.buf, "Module "), - clean::FunctionItem(*) => write!(fmt.buf, "Function "), - clean::TraitItem(*) => write!(fmt.buf, "Trait "), - clean::StructItem(*) => write!(fmt.buf, "Struct "), - clean::EnumItem(*) => write!(fmt.buf, "Enum "), + clean::ModuleItem(..) => write!(fmt.buf, "Module "), + clean::FunctionItem(..) => write!(fmt.buf, "Function "), + clean::TraitItem(..) => write!(fmt.buf, "Trait "), + clean::StructItem(..) => write!(fmt.buf, "Struct "), + clean::EnumItem(..) => write!(fmt.buf, "Enum "), _ => {} } let cur = it.cx.current.as_slice(); @@ -931,7 +931,7 @@ impl<'self> fmt::Default for Item<'self> { fn item_path(item: &clean::Item) -> ~str { match item.inner { - clean::ModuleItem(*) => *item.name.get_ref() + "/index.html", + clean::ModuleItem(..) => *item.name.get_ref() + "/index.html", _ => shortty(item) + "." + *item.name.get_ref() + ".html" } } @@ -982,31 +982,31 @@ fn item_module(w: &mut Writer, cx: &Context, match (&i1.inner, &i2.inner) { (&clean::ViewItemItem(ref a), &clean::ViewItemItem(ref b)) => { match (&a.inner, &b.inner) { - (&clean::ExternMod(*), _) => true, - (_, &clean::ExternMod(*)) => false, + (&clean::ExternMod(..), _) => true, + (_, &clean::ExternMod(..)) => false, _ => idx1 < idx2, } } - (&clean::ViewItemItem(*), _) => true, - (_, &clean::ViewItemItem(*)) => false, - (&clean::ModuleItem(*), _) => true, - (_, &clean::ModuleItem(*)) => false, - (&clean::StructItem(*), _) => true, - (_, &clean::StructItem(*)) => false, - (&clean::EnumItem(*), _) => true, - (_, &clean::EnumItem(*)) => false, - (&clean::StaticItem(*), _) => true, - (_, &clean::StaticItem(*)) => false, - (&clean::ForeignFunctionItem(*), _) => true, - (_, &clean::ForeignFunctionItem(*)) => false, - (&clean::ForeignStaticItem(*), _) => true, - (_, &clean::ForeignStaticItem(*)) => false, - (&clean::TraitItem(*), _) => true, - (_, &clean::TraitItem(*)) => false, - (&clean::FunctionItem(*), _) => true, - (_, &clean::FunctionItem(*)) => false, - (&clean::TypedefItem(*), _) => true, - (_, &clean::TypedefItem(*)) => false, + (&clean::ViewItemItem(..), _) => true, + (_, &clean::ViewItemItem(..)) => false, + (&clean::ModuleItem(..), _) => true, + (_, &clean::ModuleItem(..)) => false, + (&clean::StructItem(..), _) => true, + (_, &clean::StructItem(..)) => false, + (&clean::EnumItem(..), _) => true, + (_, &clean::EnumItem(..)) => false, + (&clean::StaticItem(..), _) => true, + (_, &clean::StaticItem(..)) => false, + (&clean::ForeignFunctionItem(..), _) => true, + (_, &clean::ForeignFunctionItem(..)) => false, + (&clean::ForeignStaticItem(..), _) => true, + (_, &clean::ForeignStaticItem(..)) => false, + (&clean::TraitItem(..), _) => true, + (_, &clean::TraitItem(..)) => false, + (&clean::FunctionItem(..), _) => true, + (_, &clean::FunctionItem(..)) => false, + (&clean::TypedefItem(..), _) => true, + (_, &clean::TypedefItem(..)) => false, _ => idx1 < idx2, } } @@ -1026,21 +1026,21 @@ fn item_module(w: &mut Writer, cx: &Context, } curty = myty; write!(w, "

{}

\n", match myitem.inner { - clean::ModuleItem(*) => "Modules", - clean::StructItem(*) => "Structs", - clean::EnumItem(*) => "Enums", - clean::FunctionItem(*) => "Functions", - clean::TypedefItem(*) => "Type Definitions", - clean::StaticItem(*) => "Statics", - clean::TraitItem(*) => "Traits", - clean::ImplItem(*) => "Implementations", - clean::ViewItemItem(*) => "Reexports", - clean::TyMethodItem(*) => "Type Methods", - clean::MethodItem(*) => "Methods", - clean::StructFieldItem(*) => "Struct Fields", - clean::VariantItem(*) => "Variants", - clean::ForeignFunctionItem(*) => "Foreign Functions", - clean::ForeignStaticItem(*) => "Foreign Statics", + clean::ModuleItem(..) => "Modules", + clean::StructItem(..) => "Structs", + clean::EnumItem(..) => "Enums", + clean::FunctionItem(..) => "Functions", + clean::TypedefItem(..) => "Type Definitions", + clean::StaticItem(..) => "Statics", + clean::TraitItem(..) => "Traits", + clean::ImplItem(..) => "Implementations", + clean::ViewItemItem(..) => "Reexports", + clean::TyMethodItem(..) => "Type Methods", + clean::MethodItem(..) => "Methods", + clean::StructFieldItem(..) => "Struct Fields", + clean::VariantItem(..) => "Variants", + clean::ForeignFunctionItem(..) => "Foreign Functions", + clean::ForeignStaticItem(..) => "Foreign Statics", }); } @@ -1450,7 +1450,7 @@ fn render_impl(w: &mut Writer, i: &clean::Impl, dox: &Option<~str>) { Some(ref ty) => { write!(w, "{} for ", *ty); match *ty { - clean::ResolvedPath { id, _ } => Some(id), + clean::ResolvedPath { id, .. } => Some(id), _ => None, } } @@ -1527,7 +1527,7 @@ fn render_impl(w: &mut Writer, i: &clean::Impl, dox: &Option<~str>) { for method in t.methods.iter() { let n = method.item().name.clone(); match i.methods.iter().find(|m| m.name == n) { - Some(*) => continue, + Some(..) => continue, None => {} } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 977931eb42a..c5b2125c163 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -278,7 +278,7 @@ fn json_input(input: &str) -> Result { version {}", SCHEMA_VERSION)) } } - Some(*) => return Err(~"malformed json"), + Some(..) => return Err(~"malformed json"), None => return Err(~"expected a schema version"), } let crate = match obj.pop(&~"crate") { @@ -293,7 +293,7 @@ fn json_input(input: &str) -> Result { let plugin_output = ~[]; Ok((crate, plugin_output)) } - Ok(*) => Err(~"malformed json input: expected an object at the top"), + Ok(..) => Err(~"malformed json input: expected an object at the top"), } } diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index f7705f93a79..6f469ba6fff 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -88,39 +88,39 @@ impl<'self> fold::DocFolder for Stripper<'self> { fn fold_item(&mut self, i: Item) -> Option { match i.inner { // These items can all get re-exported - clean::TypedefItem(*) | clean::StaticItem(*) | - clean::StructItem(*) | clean::EnumItem(*) | - clean::TraitItem(*) | clean::FunctionItem(*) | - clean::VariantItem(*) | clean::MethodItem(*) | - clean::ForeignFunctionItem(*) | clean::ForeignStaticItem(*) => { + clean::TypedefItem(..) | clean::StaticItem(..) | + clean::StructItem(..) | clean::EnumItem(..) | + clean::TraitItem(..) | clean::FunctionItem(..) | + clean::VariantItem(..) | clean::MethodItem(..) | + clean::ForeignFunctionItem(..) | clean::ForeignStaticItem(..) => { if !self.exported_items.contains(&i.id) { return None; } } - clean::ViewItemItem(*) => { + clean::ViewItemItem(..) => { if i.visibility != Some(ast::public) { return None } } - clean::StructFieldItem(*) => { + clean::StructFieldItem(..) => { if i.visibility == Some(ast::private) { return None; } } // handled below - clean::ModuleItem(*) => {} + clean::ModuleItem(..) => {} // impls/tymethods have no control over privacy - clean::ImplItem(*) | clean::TyMethodItem(*) => {} + clean::ImplItem(..) | clean::TyMethodItem(..) => {} } let fastreturn = match i.inner { // nothing left to do for traits (don't want to filter their // methods out, visibility controlled by the trait) - clean::TraitItem(*) => true, + clean::TraitItem(..) => true, // implementations of traits are always public. clean::ImplItem(ref imp) if imp.trait_.is_some() => true, @@ -159,12 +159,12 @@ impl<'self> fold::DocFolder for ImplStripper<'self> { match i.inner { clean::ImplItem(ref imp) => { match imp.trait_ { - Some(clean::ResolvedPath{ id, _ }) => { + Some(clean::ResolvedPath{ id, .. }) => { if !self.contains(&id) { return None; } } - Some(*) | None => {} + Some(..) | None => {} } } _ => {} diff --git a/src/librustpkg/lib.rs b/src/librustpkg/lib.rs index 2308f314b14..ffc5f2c947d 100644 --- a/src/librustpkg/lib.rs +++ b/src/librustpkg/lib.rs @@ -233,7 +233,7 @@ impl CtxMethods for BuildContext { self.build(&mut pkg_src, what); match pkg_src { PkgSrc { destination_workspace: ws, - id: id, _ } => { + id: id, .. } => { Some((id, ws)) } } @@ -244,7 +244,7 @@ impl CtxMethods for BuildContext { self.build(&mut pkg_src, what); match pkg_src { PkgSrc { destination_workspace: ws, - id: id, _ } => { + id: id, .. } => { Some((id, ws)) } } diff --git a/src/librustpkg/package_source.rs b/src/librustpkg/package_source.rs index b93199e2c61..b89d4f55258 100644 --- a/src/librustpkg/package_source.rs +++ b/src/librustpkg/package_source.rs @@ -146,7 +146,7 @@ impl PkgSrc { source_workspace: source, destination_workspace: destination, start_dir: start, - id: id, _ } => { + id: id, .. } => { let result = PkgSrc { source_workspace: source.clone(), build_in_destination: build_in_destination, diff --git a/src/librustpkg/tests.rs b/src/librustpkg/tests.rs index 86c0fb27680..5401a30a86c 100644 --- a/src/librustpkg/tests.rs +++ b/src/librustpkg/tests.rs @@ -1091,7 +1091,7 @@ fn no_rebuilding() { command_line_test([~"build", ~"foo"], workspace); match command_line_test_partial([~"build", ~"foo"], workspace) { - Success(*) => (), // ok + Success(..) => (), // ok Fail(ref status) if status.status.matches_exit_status(65) => fail!("no_rebuilding failed: it tried to rebuild bar"), Fail(_) => fail!("no_rebuilding failed for some other reason") @@ -1110,7 +1110,7 @@ fn no_recopying() { assert!(chmod_read_only(&foo_lib.unwrap())); match command_line_test_partial([~"install", ~"foo"], workspace) { - Success(*) => (), // ok + Success(..) => (), // ok Fail(ref status) if status.status.matches_exit_status(65) => fail!("no_recopying failed: it tried to re-copy foo"), Fail(_) => fail!("no_copying failed for some other reason") @@ -1129,7 +1129,7 @@ fn no_rebuilding_dep() { // Now make `bar` read-only so that subsequent rebuilds of it will fail assert!(chmod_read_only(&bar_lib)); match command_line_test_partial([~"build", ~"foo"], workspace) { - Success(*) => (), // ok + Success(..) => (), // ok Fail(ref r) if r.status.matches_exit_status(65) => fail!("no_rebuilding_dep failed: it tried to rebuild bar"), Fail(_) => fail!("no_rebuilding_dep failed for some other reason") @@ -1150,7 +1150,7 @@ fn do_rebuild_dep_dates_change() { assert!(chmod_read_only(&bar_lib_name)); match command_line_test_partial([~"build", ~"foo"], workspace) { - Success(*) => fail!("do_rebuild_dep_dates_change failed: it didn't rebuild bar"), + Success(..) => fail!("do_rebuild_dep_dates_change failed: it didn't rebuild bar"), Fail(ref r) if r.status.matches_exit_status(65) => (), // ok Fail(_) => fail!("do_rebuild_dep_dates_change failed for some other reason") } @@ -1171,7 +1171,7 @@ fn do_rebuild_dep_only_contents_change() { // should adjust the datestamp match command_line_test_partial([~"build", ~"foo"], workspace) { - Success(*) => fail!("do_rebuild_dep_only_contents_change failed: it didn't rebuild bar"), + Success(..) => fail!("do_rebuild_dep_only_contents_change failed: it didn't rebuild bar"), Fail(ref r) if r.status.matches_exit_status(65) => (), // ok Fail(_) => fail!("do_rebuild_dep_only_contents_change failed for some other reason") } @@ -1729,7 +1729,7 @@ fn test_cfg_fail() { ~"build", ~"foo"], workspace) { - Success(*) => fail!("test_cfg_fail failed"), + Success(..) => fail!("test_cfg_fail failed"), _ => () } } @@ -2116,7 +2116,7 @@ fn test_rustpkg_test_failure_exit_status() { let res = command_line_test_partial([~"test", ~"foo"], foo_workspace); match res { Fail(_) => {}, - Success(*) => fail!("Expected test failure but got success") + Success(..) => fail!("Expected test failure but got success") } } @@ -2147,7 +2147,7 @@ fn test_rebuild_when_needed() { frob_source_file(foo_workspace, &foo_id, "test.rs"); chmod_read_only(&test_executable); match command_line_test_partial([~"test", ~"foo"], foo_workspace) { - Success(*) => fail!("test_rebuild_when_needed didn't rebuild"), + Success(..) => fail!("test_rebuild_when_needed didn't rebuild"), Fail(ref r) if r.status.matches_exit_status(65) => (), // ok Fail(_) => fail!("test_rebuild_when_needed failed for some other reason") } @@ -2167,7 +2167,7 @@ fn test_no_rebuilding() { foo_workspace).expect("test_no_rebuilding failed"); chmod_read_only(&test_executable); match command_line_test_partial([~"test", ~"foo"], foo_workspace) { - Success(*) => (), // ok + Success(..) => (), // ok Fail(ref r) if r.status.matches_exit_status(65) => fail!("test_no_rebuilding failed: it rebuilt the tests"), Fail(_) => fail!("test_no_rebuilding failed for some other reason") @@ -2295,7 +2295,7 @@ fn test_compile_error() { writeFile(&main_crate, "pub fn main() { if 42 != ~\"the answer\" { fail!(); } }"); let result = command_line_test_partial([~"build", ~"foo"], foo_workspace); match result { - Success(*) => fail!("Failed by succeeding!"), // should be a compile error + Success(..) => fail!("Failed by succeeding!"), // should be a compile error Fail(ref status) => { debug!("Failed with status {:?}... that's good, right?", status); } @@ -2363,7 +2363,7 @@ fn test_c_dependency_no_rebuilding() { assert!(chmod_read_only(&c_library_path)); match command_line_test_partial([~"build", ~"cdep"], dir) { - Success(*) => (), // ok + Success(..) => (), // ok Fail(ref r) if r.status.matches_exit_status(65) => fail!("test_c_dependency_no_rebuilding failed: \ it tried to rebuild foo.c"), @@ -2401,7 +2401,7 @@ fn test_c_dependency_yes_rebuilding() { } match command_line_test_partial([~"build", ~"cdep"], dir) { - Success(*) => fail!("test_c_dependency_yes_rebuilding failed: \ + Success(..) => fail!("test_c_dependency_yes_rebuilding failed: \ it didn't rebuild and should have"), Fail(ref r) if r.status.matches_exit_status(65) => (), Fail(_) => fail!("test_c_dependency_yes_rebuilding failed for some other reason") @@ -2421,7 +2421,7 @@ fn correct_error_dependency() { fn main() {}"); match command_line_test_partial([~"build", ~"badpkg"], dir) { - Fail(ProcessOutput{ error: error, output: output, _ }) => { + Fail(ProcessOutput{ error: error, output: output, .. }) => { assert!(str::is_utf8(error)); assert!(str::is_utf8(output)); let error_str = str::from_utf8(error); @@ -2436,7 +2436,7 @@ fn correct_error_dependency() { fail!("Wrong error"); } } - Success(*) => fail!("Test passed when it should have failed") + Success(..) => fail!("Test passed when it should have failed") } } diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index ec5922cf67a..41b8fd5f373 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -649,7 +649,7 @@ pub fn datestamp(p: &Path) -> Option { debug!("Date = {:?}", out); Some(out as libc::time_t) } - Err(*) => None, + Err(..) => None, } } diff --git a/src/librustuv/lib.rs b/src/librustuv/lib.rs index 1f06f87c9de..76882e885a8 100644 --- a/src/librustuv/lib.rs +++ b/src/librustuv/lib.rs @@ -44,8 +44,6 @@ via `close` and `delete` methods. #[crate_type = "lib"]; #[feature(macro_rules, globs)]; -#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot -#[allow(cstack)]; // NOTE: remove after the next snapshot. use std::cast::transmute; use std::cast; diff --git a/src/librustuv/net.rs b/src/librustuv/net.rs index 2c0528e8742..3a485bf2ea9 100644 --- a/src/librustuv/net.rs +++ b/src/librustuv/net.rs @@ -36,8 +36,8 @@ use uvll::sockaddr; fn socket_addr_as_sockaddr(addr: SocketAddr, f: |*sockaddr| -> T) -> T { let malloc = match addr.ip { - Ipv4Addr(*) => uvll::rust_malloc_ip4_addr, - Ipv6Addr(*) => uvll::rust_malloc_ip6_addr, + Ipv4Addr(..) => uvll::rust_malloc_ip4_addr, + Ipv6Addr(..) => uvll::rust_malloc_ip6_addr, }; let ip = addr.ip.to_str(); @@ -667,7 +667,7 @@ mod test { #[test] fn connect_close_ip4() { match TcpWatcher::connect(local_loop(), next_test_ip4()) { - Ok(*) => fail!(), + Ok(..) => fail!(), Err(e) => assert_eq!(e.name(), ~"ECONNREFUSED"), } } @@ -675,7 +675,7 @@ mod test { #[test] fn connect_close_ip6() { match TcpWatcher::connect(local_loop(), next_test_ip6()) { - Ok(*) => fail!(), + Ok(..) => fail!(), Err(e) => assert_eq!(e.name(), ~"ECONNREFUSED"), } } @@ -683,16 +683,16 @@ mod test { #[test] fn udp_bind_close_ip4() { match UdpWatcher::bind(local_loop(), next_test_ip4()) { - Ok(*) => {} - Err(*) => fail!() + Ok(..) => {} + Err(..) => fail!() } } #[test] fn udp_bind_close_ip6() { match UdpWatcher::bind(local_loop(), next_test_ip6()) { - Ok(*) => {} - Err(*) => fail!() + Ok(..) => {} + Err(..) => fail!() } } diff --git a/src/librustuv/pipe.rs b/src/librustuv/pipe.rs index 6b48e823e42..829ddf9fe16 100644 --- a/src/librustuv/pipe.rs +++ b/src/librustuv/pipe.rs @@ -246,15 +246,15 @@ mod tests { #[test] fn connect_err() { match PipeWatcher::connect(local_loop(), &"path/to/nowhere".to_c_str()) { - Ok(*) => fail!(), - Err(*) => {} + Ok(..) => fail!(), + Err(..) => {} } } #[test] fn bind_err() { match PipeListener::bind(local_loop(), &"path/to/nowhere".to_c_str()) { - Ok(*) => fail!(), + Ok(..) => fail!(), Err(e) => assert_eq!(e.name(), ~"EACCES"), } } @@ -263,8 +263,8 @@ mod tests { fn bind() { let p = next_test_unix().to_c_str(); match PipeListener::bind(local_loop(), &p) { - Ok(*) => {} - Err(*) => fail!(), + Ok(..) => {} + Err(..) => fail!(), } } diff --git a/src/librustuv/process.rs b/src/librustuv/process.rs index 0577d19ec46..8098ea653bc 100644 --- a/src/librustuv/process.rs +++ b/src/librustuv/process.rs @@ -212,7 +212,7 @@ impl RtioProcess for Process { // Make sure (on the home scheduler) that we have an exit status listed let _m = self.fire_homing_missile(); match self.exit_status { - Some(*) => {} + Some(..) => {} None => { // If there's no exit code previously listed, then the // process's exit callback has yet to be invoked. We just diff --git a/src/libstd/fmt/mod.rs b/src/libstd/fmt/mod.rs index 33ef4731405..9fa2c7ab1f3 100644 --- a/src/libstd/fmt/mod.rs +++ b/src/libstd/fmt/mod.rs @@ -768,7 +768,7 @@ impl<'self> Formatter<'self> { Left(parse::Few) => value < 8, Left(parse::Many) => value >= 8, - Right(*) => false + Right(..) => false }; if run { return self.runplural(value, s.result); diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs index 885fe75fb9f..6489ff79205 100644 --- a/src/libstd/fmt/parse.rs +++ b/src/libstd/fmt/parse.rs @@ -217,7 +217,7 @@ impl<'self> Parser<'self> { self.cur.next(); true } - Some(*) | None => false, + Some(..) | None => false, } } @@ -251,7 +251,7 @@ impl<'self> Parser<'self> { loop { match self.cur.clone().next() { Some((_, c)) if char::is_whitespace(c) => { self.cur.next(); } - Some(*) | None => { return } + Some(..) | None => { return } } } } @@ -284,7 +284,7 @@ impl<'self> Parser<'self> { Some((pos, '}')) | Some((pos, '{')) => { return self.input.slice(start, pos); } - Some(*) => { self.cur.next(); } + Some(..) => { self.cur.next(); } None => { self.cur.next(); return self.input.slice(start, self.input.len()); @@ -340,7 +340,7 @@ impl<'self> Parser<'self> { spec.fill = Some(c); self.cur.next(); } - Some(*) | None => {} + Some(..) | None => {} } } None => {} @@ -449,7 +449,7 @@ impl<'self> Parser<'self> { self.ws(); match self.cur.clone().next() { Some((_, '}')) => { break } - Some(*) | None => {} + Some(..) | None => {} } } // The "other" selector must be present @@ -493,10 +493,10 @@ impl<'self> Parser<'self> { } } } - Some(*) | None => {} + Some(..) | None => {} } } - Some(*) | None => {} + Some(..) | None => {} } // Next, generate all the arms @@ -547,7 +547,7 @@ impl<'self> Parser<'self> { self.ws(); match self.cur.clone().next() { Some((_, '}')) => { break } - Some(*) | None => {} + Some(..) | None => {} } } @@ -597,7 +597,7 @@ impl<'self> Parser<'self> { self.cur.next(); pos } - Some(*) | None => { return self.input.slice(0, 0); } + Some(..) | None => { return self.input.slice(0, 0); } }; let mut end; loop { diff --git a/src/libstd/hashmap.rs b/src/libstd/hashmap.rs index a61871cbb5e..e7eb8e60704 100644 --- a/src/libstd/hashmap.rs +++ b/src/libstd/hashmap.rs @@ -577,7 +577,7 @@ impl Iterator<(K, V)> for HashMapMoveIterator { fn next(&mut self) -> Option<(K, V)> { for elt in self.iter { match elt { - Some(Bucket {key, value, _}) => return Some((key, value)), + Some(Bucket {key, value, ..}) => return Some((key, value)), None => {}, } } diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index d1502df047e..a4be74d1d7f 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -678,7 +678,7 @@ impl path::Path { pub fn is_file(&self) -> bool { match io::result(|| self.stat()) { Ok(s) => s.kind == io::TypeFile, - Err(*) => false + Err(..) => false } } @@ -693,7 +693,7 @@ impl path::Path { pub fn is_dir(&self) -> bool { match io::result(|| self.stat()) { Ok(s) => s.kind == io::TypeDirectory, - Err(*) => false + Err(..) => false } } } @@ -1027,8 +1027,8 @@ mod test { let from = Path::new("test/nonexistent-bogus-path"); let to = Path::new("test/other-bogus-path"); match io::result(|| copy(&from, &to)) { - Ok(*) => fail!(), - Err(*) => { + Ok(..) => fail!(), + Err(..) => { assert!(!from.exists()); assert!(!to.exists()); } @@ -1054,7 +1054,7 @@ mod test { File::create(&out); match io::result(|| copy(&out, &*tmpdir)) { - Ok(*) => fail!(), Err(*) => {} + Ok(..) => fail!(), Err(..) => {} } }) @@ -1076,7 +1076,7 @@ mod test { let out = tmpdir.join("out"); match io::result(|| copy(&*tmpdir, &out)) { - Ok(*) => fail!(), Err(*) => {} + Ok(..) => fail!(), Err(..) => {} } assert!(!out.exists()); }) @@ -1121,8 +1121,8 @@ mod test { test!(fn readlink_not_symlink() { let tmpdir = tmpdir(); match io::result(|| readlink(&*tmpdir)) { - Ok(*) => fail!("wanted a failure"), - Err(*) => {} + Ok(..) => fail!("wanted a failure"), + Err(..) => {} } }) @@ -1142,13 +1142,13 @@ mod test { // can't link to yourself match io::result(|| link(&input, &input)) { - Ok(*) => fail!("wanted a failure"), - Err(*) => {} + Ok(..) => fail!("wanted a failure"), + Err(..) => {} } // can't link to something that doesn't exist match io::result(|| link(&tmpdir.join("foo"), &tmpdir.join("bar"))) { - Ok(*) => fail!("wanted a failure"), - Err(*) => {} + Ok(..) => fail!("wanted a failure"), + Err(..) => {} } }) @@ -1162,8 +1162,8 @@ mod test { assert!(stat(&file).perm & io::UserWrite == 0); match io::result(|| chmod(&tmpdir.join("foo"), io::UserRWX)) { - Ok(*) => fail!("wanted a failure"), - Err(*) => {} + Ok(..) => fail!("wanted a failure"), + Err(..) => {} } chmod(&file, io::UserFile); @@ -1218,7 +1218,7 @@ mod test { match io::result(|| File::open_mode(&tmpdir.join("a"), io::Open, io::Read)) { - Ok(*) => fail!(), Err(*) => {} + Ok(..) => fail!(), Err(..) => {} } File::open_mode(&tmpdir.join("b"), io::Open, io::Write).unwrap(); File::open_mode(&tmpdir.join("c"), io::Open, io::ReadWrite).unwrap(); @@ -1233,7 +1233,7 @@ mod test { let mut f = File::open_mode(&tmpdir.join("h"), io::Open, io::Read).unwrap(); match io::result(|| f.write("wut".as_bytes())) { - Ok(*) => fail!(), Err(*) => {} + Ok(..) => fail!(), Err(..) => {} } } assert_eq!(stat(&tmpdir.join("h")).size, 3); @@ -1267,8 +1267,8 @@ mod test { let tmpdir = tmpdir(); match io::result(|| change_file_times(&tmpdir.join("a"), 100, 200)) { - Ok(*) => fail!(), - Err(*) => {} + Ok(..) => fail!(), + Err(..) => {} } } } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 8cc4e7b389b..8b680020fd9 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1047,7 +1047,7 @@ pub trait Buffer: Reader { let mut buf = [0, ..4]; match self.read(buf.mut_slice_to(width)) { Some(n) if n == width => {} - Some(*) | None => return None // read error + Some(..) | None => return None // read error } match str::from_utf8_slice_opt(buf.slice_to(width)) { Some(s) => Some(s.char_at(0)), diff --git a/src/libstd/io/native/file.rs b/src/libstd/io/native/file.rs index 9dd6daf66e9..218040b72d6 100644 --- a/src/libstd/io/native/file.rs +++ b/src/libstd/io/native/file.rs @@ -114,7 +114,7 @@ impl FileDesc { impl io::Reader for FileDesc { fn read(&mut self, buf: &mut [u8]) -> Option { - match self.inner_read(buf) { Ok(n) => Some(n), Err(*) => None } + match self.inner_read(buf) { Ok(n) => Some(n), Err(..) => None } } fn eof(&mut self) -> bool { false } } diff --git a/src/libstd/io/native/process.rs b/src/libstd/io/native/process.rs index 038b6ec0ff2..1b614852737 100644 --- a/src/libstd/io/native/process.rs +++ b/src/libstd/io/native/process.rs @@ -129,7 +129,7 @@ impl rtio::RtioProcess for Process { // and we kill it, then on unix we might ending up killing a // newer process that happens to have the same (re-used) id match self.exit_code { - Some(*) => return Err(io::IoError { + Some(..) => return Err(io::IoError { kind: io::OtherIoError, desc: "can't kill an exited process", detail: None, diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index e089628b9c7..6a97a21673d 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -56,8 +56,8 @@ pub struct SocketAddr { impl ToStr for SocketAddr { fn to_str(&self) -> ~str { match self.ip { - Ipv4Addr(*) => format!("{}:{}", self.ip.to_str(), self.port), - Ipv6Addr(*) => format!("[{}]:{}", self.ip.to_str(), self.port), + Ipv4Addr(..) => format!("{}:{}", self.ip.to_str(), self.port), + Ipv6Addr(..) => format!("[{}]:{}", self.ip.to_str(), self.port), } } } diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 2aa8b0c7ed6..fe0385c9a95 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -247,7 +247,7 @@ impl StdWriter { } } } - File(*) => { + File(..) => { io_error::cond.raise(IoError { kind: OtherIoError, desc: "stream is not a tty", @@ -273,7 +273,7 @@ impl StdWriter { Err(e) => io_error::cond.raise(e), } } - File(*) => { + File(..) => { io_error::cond.raise(IoError { kind: OtherIoError, desc: "stream is not a tty", @@ -286,8 +286,8 @@ impl StdWriter { /// Returns whether this stream is attached to a TTY instance or not. pub fn isatty(&self) -> bool { match self.inner { - TTY(*) => true, - File(*) => false, + TTY(..) => true, + File(..) => false, } } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 7a8b4467fcc..a72bc6b8328 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -57,15 +57,13 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")]; -#[feature(macro_rules, globs, asm, managed_boxes)]; +#[feature(macro_rules, globs, asm, managed_boxes, thread_local)]; // Don't link to std. We are std. #[no_std]; #[deny(non_camel_case_types)]; #[deny(missing_doc)]; -#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot -#[allow(cstack)]; // NOTE: remove after the next snapshot. // When testing libstd, bring in libuv as the I/O backend so tests can print // things and all of the std::io tests have an I/O interface to run on top diff --git a/src/libstd/os.rs b/src/libstd/os.rs index baa4423220c..34331769614 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -386,7 +386,7 @@ pub fn self_exe_path() -> Option { match io::result(|| io::fs::readlink(&Path::new("/proc/self/exe"))) { Ok(Some(path)) => Some(path.as_vec().to_owned()), - Ok(None) | Err(*) => None + Ok(None) | Err(..) => None } } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index d26989c36e6..081673e86cb 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -550,7 +550,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> { _align: uint) -> bool { match self.var_stk.pop() { - SearchingFor(*) => fail!("enum value matched no variant"), + SearchingFor(..) => fail!("enum value matched no variant"), _ => true } } diff --git a/src/libstd/result.rs b/src/libstd/result.rs index ff425a8a73b..afcf092b4f6 100644 --- a/src/libstd/result.rs +++ b/src/libstd/result.rs @@ -178,7 +178,7 @@ impl Result { pub fn iter<'r>(&'r self) -> OptionIterator<&'r T> { match *self { Ok(ref t) => Some(t), - Err(*) => None, + Err(..) => None, }.move_iter() } @@ -186,7 +186,7 @@ impl Result { #[inline] pub fn iter_err<'r>(&'r self) -> OptionIterator<&'r E> { match *self { - Ok(*) => None, + Ok(..) => None, Err(ref t) => Some(t), }.move_iter() } diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs index 8998064990a..418557f659b 100644 --- a/src/libstd/rt/context.rs +++ b/src/libstd/rt/context.rs @@ -97,10 +97,10 @@ impl Context { pub fn swap(out_context: &mut Context, in_context: &Context) { rtdebug!("swapping contexts"); let out_regs: &mut Registers = match out_context { - &Context { regs: ~ref mut r, _ } => r + &Context { regs: ~ref mut r, .. } => r }; let in_regs: &Registers = match in_context { - &Context { regs: ~ref r, _ } => r + &Context { regs: ~ref r, .. } => r }; rtdebug!("noting the stack limit and doing raw swap"); diff --git a/src/libstd/rt/local_ptr.rs b/src/libstd/rt/local_ptr.rs index c50a9778d33..803938589af 100644 --- a/src/libstd/rt/local_ptr.rs +++ b/src/libstd/rt/local_ptr.rs @@ -21,10 +21,9 @@ use unstable::finally::Finally; #[cfg(windows)] // mingw-w32 doesn't like thread_local things #[cfg(target_os = "android")] // see #10686 -#[cfg(stage0)] // only remove this attribute after the next snapshot pub use self::native::*; -#[cfg(not(stage0), not(windows), not(target_os = "android"))] +#[cfg(not(windows), not(target_os = "android"))] pub use self::compiled::*; /// Borrow the thread-local value from thread-local storage. diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 0c69315b27d..78ec32ead3c 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -96,7 +96,7 @@ pub mod shouldnt_be_public { pub use super::select::SelectInner; pub use super::select::{SelectInner, SelectPortInner}; pub use super::local_ptr::native::maybe_tls_key; - #[cfg(not(stage0), not(windows), not(target_os = "android"))] + #[cfg(not(windows), not(target_os = "android"))] pub use super::local_ptr::compiled::RT_TLS_PTR; } diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index 21753d9e4d9..d66bd1e4135 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -588,7 +588,7 @@ impl Scheduler { transmute_mut_region(*next_task.sched.get_mut_ref()); let current_task: &mut Task = match sched.cleanup_job { - Some(CleanupJob { task: ref task, _ }) => { + Some(CleanupJob { task: ref task, .. }) => { let task_ptr: *~Task = task; transmute_mut_region(*transmute_mut_unsafe(task_ptr)) } diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 68164eb9345..e5f7c08912a 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -335,7 +335,7 @@ impl Task { pub fn is_home_no_tls(&self, sched: &~Scheduler) -> bool { match self.task_type { GreenTask(Some(AnySched)) => { false } - GreenTask(Some(Sched(SchedHandle { sched_id: ref id, _}))) => { + GreenTask(Some(Sched(SchedHandle { sched_id: ref id, .. }))) => { *id == sched.sched_id() } GreenTask(None) => { @@ -351,7 +351,7 @@ impl Task { pub fn homed(&self) -> bool { match self.task_type { GreenTask(Some(AnySched)) => { false } - GreenTask(Some(Sched(SchedHandle { _ }))) => { true } + GreenTask(Some(Sched(SchedHandle { .. }))) => { true } GreenTask(None) => { rtabort!("task without home"); } @@ -372,7 +372,7 @@ impl Task { rtdebug!("anysched task in sched check ****"); sched_run_anything } - GreenTask(Some(Sched(SchedHandle { sched_id: ref id, _ }))) => { + GreenTask(Some(Sched(SchedHandle { sched_id: ref id, ..}))) => { rtdebug!("homed task in sched check ****"); *id == sched_id } @@ -470,7 +470,7 @@ impl Coroutine { /// Destroy coroutine and try to reuse stack segment. pub fn recycle(self, stack_pool: &mut StackPool) { match self { - Coroutine { current_stack_segment, _ } => { + Coroutine { current_stack_segment, .. } => { stack_pool.give_segment(current_stack_segment); } } diff --git a/src/libstd/trie.rs b/src/libstd/trie.rs index 8b534d7d3be..97209e99bd6 100644 --- a/src/libstd/trie.rs +++ b/src/libstd/trie.rs @@ -374,7 +374,7 @@ fn chunk(n: uint, idx: uint) -> uint { fn find_mut<'r, T>(child: &'r mut Child, key: uint, idx: uint) -> Option<&'r mut T> { match *child { External(stored, ref mut value) if stored == key => Some(value), - External(*) => None, + External(..) => None, Internal(ref mut x) => find_mut(&mut x.children[chunk(key, idx)], key, idx + 1), Nothing => None } @@ -426,7 +426,7 @@ fn remove(count: &mut uint, child: &mut Child, key: uint, _ => fail!() } } - External(*) => (None, false), + External(..) => (None, false), Internal(ref mut x) => { let ret = remove(&mut x.count, &mut x.children[chunk(key, idx)], key, idx + 1); diff --git a/src/libstd/unstable/intrinsics.rs b/src/libstd/unstable/intrinsics.rs index ea3ed10da4e..89a51a5dddd 100644 --- a/src/libstd/unstable/intrinsics.rs +++ b/src/libstd/unstable/intrinsics.rs @@ -177,7 +177,6 @@ extern "rust-intrinsic" { pub fn abort() -> !; /// Execute a breakpoint trap, for inspection by a debugger. - #[cfg(not(stage0))] pub fn breakpoint(); /// Atomic compare and exchange, sequentially consistent. diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs index 03745c2c348..02b35992f8c 100644 --- a/src/libstd/unstable/sync.rs +++ b/src/libstd/unstable/sync.rs @@ -455,7 +455,7 @@ impl Exclusive { let Exclusive { x: x } = self; // Someday we might need to unkillably unwrap an Exclusive, but not today. let inner = x.unwrap(); - let ExData { data: user_data, _ } = inner; // will destroy the LittleLock + let ExData { data: user_data, .. } = inner; // will destroy the LittleLock user_data } } diff --git a/src/libstd/util.rs b/src/libstd/util.rs index ddcf408189e..d75c60c0bf2 100644 --- a/src/libstd/util.rs +++ b/src/libstd/util.rs @@ -209,7 +209,7 @@ mod bench { let x = [1,2,3,4,5,6]; bh.iter(|| { let _q = match x { - [1,2,3,.._] => 10, + [1,2,3,..] => 10, _ => 11 }; }); 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) { 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 { 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 Container for SmallVector { fn len(&self) -> uint { match *self { Zero => 0, - One(*) => 1, + One(..) => 1, Many(ref vals) => vals.len() } } @@ -53,7 +53,7 @@ impl SmallVector { 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 Iterator for SmallVectorMoveIterator { fn next(&mut self) -> Option { match *self { ZeroIterator => None, - OneIterator(*) => { + OneIterator(..) => { let mut replacement = ZeroIterator; util::swap(self, &mut replacement); match replacement { @@ -114,7 +114,7 @@ impl Iterator for SmallVectorMoveIterator { fn size_hint(&self) -> (uint, Option) { 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>(visitor: &mut V, visitor.visit_explicit_self(&method.explicit_self, env.clone()); } - fk_anon(*) | fk_fn_block(*) => { + fk_anon(..) | fk_fn_block(..) => { } } diff --git a/src/snapshots.txt b/src/snapshots.txt index 59e287daf38..f9d1d1f6cf2 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,11 @@ +S 2013-11-28 859c3ba + freebsd-x86_64 4110bb67408e382623b6c55e997e2c34342dc98d + linux-i386 072e638a6a11f7d00cf2c7b487162d0d2e3b5036 + linux-x86_64 bf6d926e5da26e41f3697aa2e997c270c02a7965 + macos-i386 470635a2cc9b71d05833ca483e0a9ecca1c9f97d + macos-x86_64 f4c78234f13df7e4505b31d01f3b2cc6aa01f384 + winnt-i386 4929d471d01175641e2b797c61450637abcc585f + S 2013-11-10 b5e602a freebsd-x86_64 bdcfcfa63216559765b83fe4056abb953da25da0 linux-i386 0fb5cdff8a46e9a02bcdba100803bb5504b6f332 diff --git a/src/test/compile-fail/match-vec-mismatch.rs b/src/test/compile-fail/match-vec-mismatch.rs index 85ed8761ee9..5eca6546ea9 100644 --- a/src/test/compile-fail/match-vec-mismatch.rs +++ b/src/test/compile-fail/match-vec-mismatch.rs @@ -1,6 +1,6 @@ fn main() { match ~"foo" { - ['f', 'o', .._] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern + ['f', 'o', ..] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern _ => { } } } diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/compile-fail/match-vec-unreachable.rs index b557242af44..54e25aea09b 100644 --- a/src/test/compile-fail/match-vec-unreachable.rs +++ b/src/test/compile-fail/match-vec-unreachable.rs @@ -7,7 +7,7 @@ fn main() { } match ~[~"foo", ~"bar", ~"baz"] { - [a, _, _, .._] => { println(a); } + [a, _, _, ..] => { println(a); } [~"foo", ~"bar", ~"baz", ~"foo", ~"bar"] => { } //~ ERROR unreachable pattern _ => { } } diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/compile-fail/non-exhaustive-match.rs index 9719dd744b7..e728b9c2fd7 100644 --- a/src/test/compile-fail/non-exhaustive-match.rs +++ b/src/test/compile-fail/non-exhaustive-match.rs @@ -36,8 +36,8 @@ fn main() { (b, b) => {} } match ~[Some(42), None, Some(21)] { //~ ERROR non-exhaustive patterns: vectors of length 0 not covered - [Some(*), None, ..tail] => {} - [Some(*), Some(*), ..tail] => {} + [Some(..), None, ..tail] => {} + [Some(..), Some(..), ..tail] => {} [None] => {} } match ~[1] { @@ -51,10 +51,10 @@ fn main() { [] => () } match ~[Some(42), None, Some(21)] { - [Some(*), None, ..tail] => {} - [Some(*), Some(*), ..tail] => {} + [Some(..), None, ..tail] => {} + [Some(..), Some(..), ..tail] => {} [None, None, ..tail] => {} - [None, Some(*), ..tail] => {} + [None, Some(..), ..tail] => {} [Some(_)] => {} [None] => {} [] => {} diff --git a/src/test/compile-fail/pattern-error-continue.rs b/src/test/compile-fail/pattern-error-continue.rs index 09e4380f346..47d0a226a56 100644 --- a/src/test/compile-fail/pattern-error-continue.rs +++ b/src/test/compile-fail/pattern-error-continue.rs @@ -29,7 +29,7 @@ fn main() { _ => () } match 'c' { - S { _ } => (), //~ ERROR mismatched types: expected `char` but found a structure pattern + S { .. } => (), //~ ERROR mismatched types: expected `char` but found a structure pattern _ => () } diff --git a/src/test/debug-info/destructured-fn-argument.rs b/src/test/debug-info/destructured-fn-argument.rs index 73734860648..8af57468b19 100644 --- a/src/test/debug-info/destructured-fn-argument.rs +++ b/src/test/debug-info/destructured-fn-argument.rs @@ -221,7 +221,7 @@ fn ignored_tuple_element((m, _, n): (int, u16, i32)) { zzz(); } -fn ignored_struct_field(Struct { b: o, _ }: Struct) { +fn ignored_struct_field(Struct { b: o, .. }: Struct) { zzz(); } @@ -262,7 +262,7 @@ fn ref_binding_in_tuple((ref ff, gg): (int, (int, int))) { zzz(); } -fn ref_binding_in_struct(Struct { b: ref hh, _ }: Struct) { +fn ref_binding_in_struct(Struct { b: ref hh, .. }: Struct) { zzz(); } diff --git a/src/test/debug-info/destructured-local.rs b/src/test/debug-info/destructured-local.rs index d222ad8b914..cd17906623e 100644 --- a/src/test/debug-info/destructured-local.rs +++ b/src/test/debug-info/destructured-local.rs @@ -157,7 +157,7 @@ fn main() { let (m, _, n) = (14, 15, 16); // ignored struct field - let Struct { b: o, _ } = Struct { a: 17, b: 18 }; + let Struct { b: o, .. } = Struct { a: 17, b: 18 }; // one struct destructured, one not let (Struct { a: p, b: q }, r) = (Struct { a: 19, b: 20 }, Struct { a: 21, b: 22 }); @@ -188,7 +188,7 @@ fn main() { let (ref ff, gg) = (46, (47, 48)); // ref binding in struct - let Struct { b: ref hh, _ } = Struct { a: 49, b: 50 }; + let Struct { b: ref hh, .. } = Struct { a: 49, b: 50 }; // univariant enum let Unit(ii) = Unit(51); diff --git a/src/test/debug-info/lexical-scope-in-match.rs b/src/test/debug-info/lexical-scope-in-match.rs index e5b2f9d9fe5..7cb68e9890d 100644 --- a/src/test/debug-info/lexical-scope-in-match.rs +++ b/src/test/debug-info/lexical-scope-in-match.rs @@ -116,7 +116,7 @@ fn main() { match Struct { x: 239, y: 240 } { // ignored field - Struct { x: shadowed, _ } => { + Struct { x: shadowed, .. } => { zzz(); sentinel(); diff --git a/src/test/run-pass/const-enum-byref-self.rs b/src/test/run-pass/const-enum-byref-self.rs index 098a001cfcd..eaca18be93a 100644 --- a/src/test/run-pass/const-enum-byref-self.rs +++ b/src/test/run-pass/const-enum-byref-self.rs @@ -15,7 +15,7 @@ impl E { pub fn method(&self) { match *self { V => {} - VV(*) => fail!() + VV(..) => fail!() } } } diff --git a/src/test/run-pass/const-enum-byref.rs b/src/test/run-pass/const-enum-byref.rs index 83fafad4f99..ee7e3c7c663 100644 --- a/src/test/run-pass/const-enum-byref.rs +++ b/src/test/run-pass/const-enum-byref.rs @@ -14,7 +14,7 @@ static C: E = V; fn f(a: &E) { match *a { V => {} - VV(*) => fail!() + VV(..) => fail!() } } diff --git a/src/test/run-pass/const-enum-structlike.rs b/src/test/run-pass/const-enum-structlike.rs index 943597fa28f..8b5e98f6eba 100644 --- a/src/test/run-pass/const-enum-structlike.rs +++ b/src/test/run-pass/const-enum-structlike.rs @@ -19,7 +19,7 @@ static C: E = S1 { u: 23 }; pub fn main() { match C { - S0 { _ } => fail!(), + S0 { .. } => fail!(), S1 { u } => assert!(u == 23) } } diff --git a/src/test/run-pass/core-run-destroy.rs b/src/test/run-pass/core-run-destroy.rs index 07d9fb95dcb..37dc48ebda4 100644 --- a/src/test/run-pass/core-run-destroy.rs +++ b/src/test/run-pass/core-run-destroy.rs @@ -58,13 +58,13 @@ fn test_destroy_actually_kills(force: bool) { #[cfg(unix,not(target_os="android"))] fn process_exists(pid: libc::pid_t) -> bool { - let run::ProcessOutput {output, _} = run::process_output("ps", [~"-p", pid.to_str()]); + let run::ProcessOutput {output, ..} = run::process_output("ps", [~"-p", pid.to_str()]); str::from_utf8(output).contains(pid.to_str()) } #[cfg(unix,target_os="android")] fn process_exists(pid: libc::pid_t) -> bool { - let run::ProcessOutput {output, _} = run::process_output("/system/bin/ps", [pid.to_str()]); + let run::ProcessOutput {output, ..} = run::process_output("/system/bin/ps", [pid.to_str()]); str::from_utf8(output).contains(~"root") } diff --git a/src/test/run-pass/func-arg-incomplete-pattern.rs b/src/test/run-pass/func-arg-incomplete-pattern.rs index 93c9d6b50ec..cba12e9199b 100644 --- a/src/test/run-pass/func-arg-incomplete-pattern.rs +++ b/src/test/run-pass/func-arg-incomplete-pattern.rs @@ -6,7 +6,7 @@ struct Foo { y: ~uint, } -fn foo(Foo {x, _}: Foo) -> *uint { +fn foo(Foo {x, ..}: Foo) -> *uint { let addr: *uint = &*x; addr } diff --git a/src/test/run-pass/ignore-all-the-things.rs b/src/test/run-pass/ignore-all-the-things.rs index b3b93c768d1..b176254a878 100644 --- a/src/test/run-pass/ignore-all-the-things.rs +++ b/src/test/run-pass/ignore-all-the-things.rs @@ -13,16 +13,14 @@ struct Bar{a: int, b: int, c: int, d: int} pub fn main() { let Foo(..) = Foo(5, 5, 5, 5); - let Foo(*) = Foo(5, 5, 5, 5); + let Foo(..) = Foo(5, 5, 5, 5); let Bar{..} = Bar{a: 5, b: 5, c: 5, d: 5}; - let Bar{_} = Bar{a: 5, b: 5, c: 5, d: 5}; //let (..) = (5, 5, 5, 5); //let Foo(a, b, ..) = Foo(5, 5, 5, 5); //let Foo(.., d) = Foo(5, 5, 5, 5); //let (a, b, ..) = (5, 5, 5, 5); //let (.., c, d) = (5, 5, 5, 5); let Bar{b: b, ..} = Bar{a: 5, b: 5, c: 5, d: 5}; - let Bar{b: b, _} = Bar{a: 5, b: 5, c: 5, d: 5}; match [5, 5, 5, 5] { [..] => { } } @@ -36,15 +34,15 @@ pub fn main() { [a, .., b] => { } } match [5, 5, 5] { - [.._] => { } + [..] => { } } match [5, 5, 5] { - [a, .._] => { } + [a, ..] => { } } match [5, 5, 5] { - [.._, a] => { } + [.., a] => { } } match [5, 5, 5] { - [a, .._, b] => { } + [a, .., b] => { } } } diff --git a/src/test/run-pass/issue-1701.rs b/src/test/run-pass/issue-1701.rs index 4f3d0dbe133..d8e4d04dded 100644 --- a/src/test/run-pass/issue-1701.rs +++ b/src/test/run-pass/issue-1701.rs @@ -16,10 +16,10 @@ enum animal { cat(pattern), dog(breed), rabbit(name, ear_kind), tiger } fn noise(a: animal) -> Option<~str> { match a { - cat(*) => { Some(~"meow") } - dog(*) => { Some(~"woof") } - rabbit(*) => { None } - tiger(*) => { Some(~"roar") } + cat(..) => { Some(~"meow") } + dog(..) => { Some(~"woof") } + rabbit(..) => { None } + tiger(..) => { Some(~"roar") } } } diff --git a/src/test/run-pass/issue-4875.rs b/src/test/run-pass/issue-4875.rs index 81947791881..9c1e782ffce 100644 --- a/src/test/run-pass/issue-4875.rs +++ b/src/test/run-pass/issue-4875.rs @@ -14,7 +14,7 @@ pub struct Foo { data: T, } -fn foo(Foo{_}: Foo) { +fn foo(Foo{..}: Foo) { } pub fn main() { diff --git a/src/test/run-pass/issue-8351-1.rs b/src/test/run-pass/issue-8351-1.rs index 9aaaa13c799..e82a8a7313e 100644 --- a/src/test/run-pass/issue-8351-1.rs +++ b/src/test/run-pass/issue-8351-1.rs @@ -19,7 +19,7 @@ pub fn main() { let e = Foo{f: 0}; match e { Foo{f: 1} => fail!(), - Foo{_} => (), + Foo{..} => (), _ => fail!(), } } diff --git a/src/test/run-pass/match-enum-struct-1.rs b/src/test/run-pass/match-enum-struct-1.rs index 5ee06e29cb8..a4d8296c872 100644 --- a/src/test/run-pass/match-enum-struct-1.rs +++ b/src/test/run-pass/match-enum-struct-1.rs @@ -18,7 +18,7 @@ enum E { pub fn main() { let e = Foo{f: 1}; match e { - Foo{_} => (), + Foo{..} => (), _ => fail!(), } match e { diff --git a/src/test/run-pass/match-struct-0.rs b/src/test/run-pass/match-struct-0.rs index 67e844c519e..769a5ab5460 100644 --- a/src/test/run-pass/match-struct-0.rs +++ b/src/test/run-pass/match-struct-0.rs @@ -16,7 +16,7 @@ pub fn main() { let f = Foo{f: 1}; match f { Foo{f: 0} => fail!(), - Foo{_} => (), + Foo{..} => (), } match f { Foo{f: 0} => fail!(), diff --git a/src/test/run-pass/nested-exhaustive-match.rs b/src/test/run-pass/nested-exhaustive-match.rs index e5ecd82be1d..fa4bec0271f 100644 --- a/src/test/run-pass/nested-exhaustive-match.rs +++ b/src/test/run-pass/nested-exhaustive-match.rs @@ -12,9 +12,9 @@ struct Foo { foo: bool, bar: Option, baz: int } pub fn main() { match @Foo{foo: true, bar: Some(10), baz: 20} { - @Foo{foo: true, bar: Some(_), _} => {} - @Foo{foo: false, bar: None, _} => {} - @Foo{foo: true, bar: None, _} => {} - @Foo{foo: false, bar: Some(_), _} => {} + @Foo{foo: true, bar: Some(_), ..} => {} + @Foo{foo: false, bar: None, ..} => {} + @Foo{foo: true, bar: None, ..} => {} + @Foo{foo: false, bar: Some(_), ..} => {} } } diff --git a/src/test/run-pass/nested-patterns.rs b/src/test/run-pass/nested-patterns.rs index 95f97029089..ccb6ec59ed1 100644 --- a/src/test/run-pass/nested-patterns.rs +++ b/src/test/run-pass/nested-patterns.rs @@ -18,12 +18,12 @@ struct C { c: int } pub fn main() { match A {a: 10, b: @20} { x@A {a, b: @20} => { assert!(x.a == 10); assert!(a == 10); } - A {b: _b, _} => { fail!(); } + A {b: _b, ..} => { fail!(); } } - let mut x@B {b, _} = B {a: 10, b: C {c: 20}}; + let mut x@B {b, ..} = B {a: 10, b: C {c: 20}}; x.b.c = 30; assert_eq!(b.c, 20); - let mut y@D {d, _} = D {a: 10, d: C {c: 20}}; + let mut y@D {d, ..} = D {a: 10, d: C {c: 20}}; y.d.c = 30; assert_eq!(d.c, 20); } diff --git a/src/test/run-pass/nullable-pointer-iotareduction.rs b/src/test/run-pass/nullable-pointer-iotareduction.rs index 62bd54e4395..acb7fe12360 100644 --- a/src/test/run-pass/nullable-pointer-iotareduction.rs +++ b/src/test/run-pass/nullable-pointer-iotareduction.rs @@ -26,13 +26,13 @@ enum E { Thing(int, T), Nothing((), ((), ()), [i8, ..0]) } impl E { fn is_none(&self) -> bool { match *self { - Thing(*) => false, - Nothing(*) => true + Thing(..) => false, + Nothing(..) => true } } fn get_ref<'r>(&'r self) -> (int, &'r T) { match *self { - Nothing(*) => fail!("E::get_ref(Nothing::<%s>)", stringify!($T)), + Nothing(..) => fail!("E::get_ref(Nothing::<%s>)", stringify!($T)), Thing(x, ref y) => (x, y) } } diff --git a/src/test/run-pass/record-pat.rs b/src/test/run-pass/record-pat.rs index d1b15b9bb7c..ff87cceba19 100644 --- a/src/test/run-pass/record-pat.rs +++ b/src/test/run-pass/record-pat.rs @@ -14,7 +14,7 @@ enum t3 { c(T2, uint), } fn m(input: t3) -> int { match input { - c(T2 {x: a(m), _}, _) => { return m; } + c(T2 {x: a(m), ..}, _) => { return m; } c(T2 {x: b(m), y: y}, z) => { return ((m + z) as int) + y; } } } diff --git a/src/test/run-pass/regions-dependent-addr-of.rs b/src/test/run-pass/regions-dependent-addr-of.rs index d8076f543ec..de619685ca4 100644 --- a/src/test/run-pass/regions-dependent-addr-of.rs +++ b/src/test/run-pass/regions-dependent-addr-of.rs @@ -63,21 +63,21 @@ fn get_v6_a<'v>(a: &'v A, _i: uint) -> &'v int { fn get_v6_b<'v>(a: &'v A, _i: uint) -> &'v int { match *a { - A { value: B { v6: Some(ref v), _ } } => &v.f, + A { value: B { v6: Some(ref v), .. } } => &v.f, _ => fail!() } } fn get_v6_c<'v>(a: &'v A, _i: uint) -> &'v int { match a { - &A { value: B { v6: Some(ref v), _ } } => &v.f, + &A { value: B { v6: Some(ref v), .. } } => &v.f, _ => fail!() } } fn get_v5_ref<'v>(a: &'v A, _i: uint) -> &'v int { match &a.value { - &B {v5: ~C {f: ref v}, _} => v + &B {v5: ~C {f: ref v}, ..} => v } } diff --git a/src/test/run-pass/rtio-processes.rs b/src/test/run-pass/rtio-processes.rs index 00f565324ec..69dc27f216d 100644 --- a/src/test/run-pass/rtio-processes.rs +++ b/src/test/run-pass/rtio-processes.rs @@ -59,8 +59,8 @@ fn smoke_failure() { io: io, }; match io::result(|| Process::new(args)) { - Ok(*) => fail!(), - Err(*) => {} + Ok(..) => fail!(), + Err(..) => {} } } diff --git a/src/test/run-pass/tag.rs b/src/test/run-pass/tag.rs index bb88e1b3f1e..989f911134b 100644 --- a/src/test/run-pass/tag.rs +++ b/src/test/run-pass/tag.rs @@ -22,7 +22,7 @@ impl Eq for colour { } green => { match (*other) { - red(*) => false, + red(..) => false, green => true } } diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs index 2ad21aba6cd..acd1d63a6ed 100644 --- a/src/test/run-pass/vec-matching-autoslice.rs +++ b/src/test/run-pass/vec-matching-autoslice.rs @@ -1,7 +1,7 @@ pub fn main() { let x = @[1, 2, 3]; match x { - [2, .._] => fail!(), + [2, ..] => fail!(), [1, ..tail] => { assert_eq!(tail, [2, 3]); } diff --git a/src/test/run-pass/vec-matching-fixed.rs b/src/test/run-pass/vec-matching-fixed.rs index 3b45182fc3a..ed88dc3008a 100644 --- a/src/test/run-pass/vec-matching-fixed.rs +++ b/src/test/run-pass/vec-matching-fixed.rs @@ -2,17 +2,17 @@ fn a() { let x = [1, 2, 3]; match x { [1, 2, 4] => unreachable!(), - [0, 2, 3, .._] => unreachable!(), - [0, .._, 3] => unreachable!(), - [0, .._] => unreachable!(), + [0, 2, 3, ..] => unreachable!(), + [0, .., 3] => unreachable!(), + [0, ..] => unreachable!(), [1, 2, 3] => (), [_, _, _] => unreachable!(), } match x { - [.._] => (), + [..] => (), } match x { - [_, _, _, .._] => (), + [_, _, _, ..] => (), } match x { [a, b, c] => { diff --git a/src/test/run-pass/vec-matching.rs b/src/test/run-pass/vec-matching.rs index c09fb8d6bc7..16c68afa47b 100644 --- a/src/test/run-pass/vec-matching.rs +++ b/src/test/run-pass/vec-matching.rs @@ -1,9 +1,9 @@ fn a() { let x = ~[1]; match x { - [_, _, _, _, _, .._] => fail!(), - [.._, _, _, _, _] => fail!(), - [_, .._, _, _] => fail!(), + [_, _, _, _, _, ..] => fail!(), + [.., _, _, _, _] => fail!(), + [_, .., _, _] => fail!(), [_, _] => fail!(), [a] => { assert_eq!(a, 1); @@ -51,17 +51,17 @@ fn b() { fn c() { let x = [1]; match x { - [2, .. _] => fail!(), - [.. _] => () + [2, ..] => fail!(), + [..] => () } } fn d() { let x = [1, 2, 3]; let branch = match x { - [1, 1, .. _] => 0, - [1, 2, 3, .. _] => 1, - [1, 2, .. _] => 2, + [1, 1, ..] => 0, + [1, 2, 3, ..] => 1, + [1, 2, ..] => 2, _ => 3 }; assert_eq!(branch, 1); diff --git a/src/test/run-pass/vec-tail-matching.rs b/src/test/run-pass/vec-tail-matching.rs index dc2b3d23b9e..1ab9e17523d 100644 --- a/src/test/run-pass/vec-tail-matching.rs +++ b/src/test/run-pass/vec-tail-matching.rs @@ -16,7 +16,7 @@ pub fn main() { assert!(tail[1].string == ~"baz"); match tail { - [Foo { _ }, _, Foo { _ }, .. _tail] => { + [Foo { .. }, _, Foo { .. }, .. _tail] => { unreachable!(); } [Foo { string: ref a }, Foo { string: ref b }] => {