1
Fork 0

Register new snapshots

This commit is contained in:
Alex Crichton 2013-11-28 12:22:53 -08:00
parent 859c3baf64
commit ab387a6838
182 changed files with 1287 additions and 1334 deletions

View file

@ -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. patterns must equal the type of the head expression.
In a pattern whose head expression has an `enum` type, a placeholder (`_`) stands for a 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: variant. For example:
~~~~ ~~~~
@ -2830,7 +2830,7 @@ let x: List<int> = Cons(10, @Cons(11, @Nil));
match x { match x {
Cons(_, @Nil) => fail!("singleton list"), Cons(_, @Nil) => fail!("singleton list"),
Cons(*) => return, Cons(..) => return,
Nil => fail!("empty list") 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 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`, 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 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 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 its value is sequentially compared to the patterns in the arms until a match

View file

@ -606,8 +606,8 @@ match mypoint {
In general, the field names of a struct do not have to appear in the same 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 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 the fields of a struct, a struct pattern may end with `, ..` (as in
`Name { field1, _ }`) to indicate that you're ignoring all other fields. `Name { field1, .. }`) to indicate that you're ignoring all other fields.
Additionally, struct fields have a shorthand matching form that simply Additionally, struct fields have a shorthand matching form that simply
reuses the field name as the binding name. 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 } # struct Point { x: f64, y: f64 }
# let mypoint = Point { x: 0.0, y: 0.0 }; # let mypoint = Point { x: 0.0, y: 0.0 };
match mypoint { 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 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 introduction form, nullary enum patterns are written without
parentheses. parentheses.
@ -725,7 +725,7 @@ enum Shape {
} }
fn area(sh: Shape) -> f64 { fn area(sh: Shape) -> f64 {
match sh { 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 } => { Rectangle { top_left: top_left, bottom_right: bottom_right } => {
(bottom_right.x - top_left.x) * (top_left.y - bottom_right.y) (bottom_right.x - top_left.x) * (top_left.y - bottom_right.y)
} }
@ -1698,7 +1698,7 @@ a function that returns `Option<T>` instead of `T`.
fn radius(shape: Shape) -> Option<f64> { fn radius(shape: Shape) -> Option<f64> {
match shape { match shape {
Circle(_, radius) => Some(radius), Circle(_, radius) => Some(radius),
Rectangle(*) => None Rectangle(..) => None
} }
} }
~~~~ ~~~~

View file

@ -166,7 +166,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
&ProcRes); &ProcRes);
} }
let ProcRes{ stdout, _ } = ProcRes; let ProcRes{ stdout, .. } = ProcRes;
srcs.push(stdout); srcs.push(stdout);
round += 1; round += 1;
} }

View file

@ -256,7 +256,7 @@ impl<T:Send> MutexArc<T> {
pub fn unwrap(self) -> T { pub fn unwrap(self) -> T {
let MutexArc { x: x } = self; let MutexArc { x: x } = self;
let inner = x.unwrap(); let inner = x.unwrap();
let MutexArcInner { failed: failed, data: data, _ } = inner; let MutexArcInner { failed: failed, data: data, .. } = inner;
if failed { if failed {
fail!("Can't unwrap poisoned MutexArc - another task failed inside!"); fail!("Can't unwrap poisoned MutexArc - another task failed inside!");
} }
@ -504,9 +504,9 @@ impl<T:Freeze + Send> RWArc<T> {
* in write mode. * in write mode.
*/ */
pub fn unwrap(self) -> T { pub fn unwrap(self) -> T {
let RWArc { x: x, _ } = self; let RWArc { x: x, .. } = self;
let inner = x.unwrap(); let inner = x.unwrap();
let RWArcInner { failed: failed, data: data, _ } = inner; let RWArcInner { failed: failed, data: data, .. } = inner;
if failed { if failed {
fail!("Can't unwrap poisoned RWArc - another task failed inside!") fail!("Can't unwrap poisoned RWArc - another task failed inside!")
} }

View file

@ -663,7 +663,7 @@ impl BitvSet {
size += 1; size += 1;
true true
}); });
let Bitv{rep, _} = bitv; let Bitv{rep, ..} = bitv;
match rep { match rep {
Big(b) => BitvSet{ size: size, bitv: b }, Big(b) => BitvSet{ size: size, bitv: b },
Small(SmallBitv{bits}) => Small(SmallBitv{bits}) =>
@ -678,7 +678,7 @@ impl BitvSet {
/// Consumes this set to return the underlying bit vector /// Consumes this set to return the underlying bit vector
pub fn unwrap(self) -> Bitv { pub fn unwrap(self) -> Bitv {
let cap = self.capacity(); let cap = self.capacity();
let BitvSet{bitv, _} = self; let BitvSet{bitv, ..} = self;
return Bitv{ nbits:cap, rep: Big(bitv) }; return Bitv{ nbits:cap, rep: Big(bitv) };
} }

View file

@ -111,8 +111,8 @@ impl<K: Clone + TotalOrd, V: Clone> Node<K, V>{
///Differentiates between leaf and branch nodes. ///Differentiates between leaf and branch nodes.
fn is_leaf(&self) -> bool{ fn is_leaf(&self) -> bool{
match self{ match self{
&LeafNode(*) => true, &LeafNode(..) => true,
&BranchNode(*) => false &BranchNode(..) => false
} }
} }
@ -208,7 +208,7 @@ impl<K: ToStr + TotalOrd, V: ToStr> ToStr for Node<K, V>{
fn to_str(&self) -> ~str{ fn to_str(&self) -> ~str{
match *self{ match *self{
LeafNode(ref leaf) => leaf.to_str(), LeafNode(ref leaf) => leaf.to_str(),
BranchNode(*) => ~"" BranchNode(..) => ~""
} }
} }
} }

View file

@ -241,7 +241,7 @@ impl<T> Deque<T> for DList<T> {
/// ///
/// O(1) /// O(1)
fn pop_front(&mut self) -> Option<T> { fn pop_front(&mut self) -> Option<T> {
self.pop_front_node().map(|~Node{value, _}| value) self.pop_front_node().map(|~Node{value, ..}| value)
} }
/// Add an element last in the list /// Add an element last in the list
@ -255,7 +255,7 @@ impl<T> Deque<T> for DList<T> {
/// ///
/// O(1) /// O(1)
fn pop_back(&mut self) -> Option<T> { fn pop_back(&mut self) -> Option<T> {
self.pop_back_node().map(|~Node{value, _}| value) self.pop_back_node().map(|~Node{value, ..}| value)
} }
} }

View file

@ -549,7 +549,7 @@ pub mod groups {
long_name: long_name, long_name: long_name,
hasarg: hasarg, hasarg: hasarg,
occur: occur, occur: occur,
_ ..
} = (*self).clone(); } = (*self).clone();
match (short_name.len(), long_name.len()) { match (short_name.len(), long_name.len()) {
@ -686,7 +686,7 @@ pub mod groups {
hint: hint, hint: hint,
desc: desc, desc: desc,
hasarg: hasarg, hasarg: hasarg,
_} = (*optref).clone(); ..} = (*optref).clone();
let mut row = " ".repeat(4); let mut row = " ".repeat(4);

View file

@ -154,7 +154,7 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
sort::quick_sort(children, |p1, p2| p2.filename() <= p1.filename()); sort::quick_sort(children, |p1, p2| p2.filename() <= p1.filename());
children children
} }
Err(*) => ~[] Err(..) => ~[]
} }
} }

View file

@ -875,11 +875,11 @@ impl Decoder {
fn expected(&self, expected: &str, found: &Json) -> ! { fn expected(&self, expected: &str, found: &Json) -> ! {
let found_s = match *found { let found_s = match *found {
Null => "null", Null => "null",
List(*) => "list", List(..) => "list",
Object(*) => "object", Object(..) => "object",
Number(*) => "number", Number(..) => "number",
String(*) => "string", String(..) => "string",
Boolean(*) => "boolean" Boolean(..) => "boolean"
}; };
self.err(format!("expected {expct} but found {fnd}: {val}", self.err(format!("expected {expct} but found {fnd}: {val}",
expct=expected, fnd=found_s, val=found.to_str())) expct=expected, fnd=found_s, val=found.to_str()))

View file

@ -38,8 +38,6 @@ Rust extras are part of the standard Rust distribution.
#[deny(non_camel_case_types)]; #[deny(non_camel_case_types)];
#[deny(missing_doc)]; #[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}; use std::str::{StrSlice, OwnedStr};

View file

@ -39,7 +39,7 @@ impl TempDir {
for _ in range(0u, 1000) { for _ in range(0u, 1000) {
let p = tmpdir.join(r.gen_ascii_str(16) + suffix); let p = tmpdir.join(r.gen_ascii_str(16) + suffix);
match io::result(|| fs::mkdir(&p, io::UserRWX)) { match io::result(|| fs::mkdir(&p, io::UserRWX)) {
Err(*) => {} Err(..) => {}
Ok(()) => return Some(TempDir { path: Some(p) }) Ok(()) => return Some(TempDir { path: Some(p) })
} }
} }

View file

@ -97,12 +97,12 @@ pub enum TestFn {
impl TestFn { impl TestFn {
fn padding(&self) -> NamePadding { fn padding(&self) -> NamePadding {
match self { match self {
&StaticTestFn(*) => PadNone, &StaticTestFn(..) => PadNone,
&StaticBenchFn(*) => PadOnRight, &StaticBenchFn(..) => PadOnRight,
&StaticMetricFn(*) => PadOnRight, &StaticMetricFn(..) => PadOnRight,
&DynTestFn(*) => PadNone, &DynTestFn(..) => PadNone,
&DynMetricFn(*) => PadOnRight, &DynMetricFn(..) => PadOnRight,
&DynBenchFn(*) => PadOnRight, &DynBenchFn(..) => PadOnRight,
} }
} }
} }

View file

@ -681,13 +681,13 @@ pub fn strptime(s: &str, format: &str) -> Result<Tm, ~str> {
let mut buf = [0]; let mut buf = [0];
let c = match rdr.read(buf) { let c = match rdr.read(buf) {
Some(*) => buf[0] as u8 as char, Some(..) => buf[0] as u8 as char,
None => break None => break
}; };
match c { match c {
'%' => { '%' => {
let ch = match rdr.read(buf) { let ch = match rdr.read(buf) {
Some(*) => buf[0] as u8 as char, Some(..) => buf[0] as u8 as char,
None => break None => break
}; };
match parse_type(s, pos, ch, &mut tm) { match parse_type(s, pos, ch, &mut tm) {
@ -932,7 +932,7 @@ pub fn strftime(format: &str, tm: &Tm) -> ~str {
loop { loop {
let mut b = [0]; let mut b = [0];
let ch = match rdr.read(b) { let ch = match rdr.read(b) {
Some(*) => b[0], Some(..) => b[0],
None => break, None => break,
}; };
match ch as char { match ch as char {

View file

@ -686,7 +686,7 @@ fn mutate_values<'r,
-> bool { -> bool {
match *node { match *node {
Some(~TreeNode{key: ref key, value: ref mut value, left: ref mut left, 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 !mutate_values(left, |k,v| f(k,v)) { return false }
if !f(key, value) { return false } if !f(key, value) { return false }
if !mutate_values(right, |k,v| f(k,v)) { return false } if !mutate_values(right, |k,v| f(k,v)) { return false }
@ -801,13 +801,13 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
(remove(&mut save.left, key), true) (remove(&mut save.left, key), true)
} else { } else {
let new = save.left.take_unwrap(); let new = save.left.take_unwrap();
let ~TreeNode{value, _} = replace(save, new); let ~TreeNode{value, ..} = replace(save, new);
*save = save.left.take_unwrap(); *save = save.left.take_unwrap();
(Some(value), true) (Some(value), true)
} }
} else if save.right.is_some() { } else if save.right.is_some() {
let new = save.right.take_unwrap(); let new = save.right.take_unwrap();
let ~TreeNode{value, _} = replace(save, new); let ~TreeNode{value, ..} = replace(save, new);
(Some(value), true) (Some(value), true)
} else { } else {
(None, false) (None, false)
@ -843,7 +843,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
} }
} }
return match node.take() { return match node.take() {
Some(~TreeNode{value, _}) => Some(value), None => fail!() Some(~TreeNode{value, ..}) => Some(value), None => fail!()
}; };
} }

View file

@ -74,7 +74,7 @@ fn encode_inner(s: &str, full_url: bool) -> ~str {
let mut buf = [0]; let mut buf = [0];
let ch = match rdr.read(buf) { let ch = match rdr.read(buf) {
None => break, None => break,
Some(*) => buf[0] as char, Some(..) => buf[0] as char,
}; };
match ch { match ch {
@ -138,7 +138,7 @@ fn decode_inner(s: &str, full_url: bool) -> ~str {
let mut buf = [0]; let mut buf = [0];
let ch = match rdr.read(buf) { let ch = match rdr.read(buf) {
None => break, None => break,
Some(*) => buf[0] as char Some(..) => buf[0] as char
}; };
match ch { match ch {
'%' => { '%' => {
@ -199,7 +199,7 @@ fn encode_plus(s: &str) -> ~str {
loop { loop {
let mut buf = [0]; let mut buf = [0];
let ch = match rdr.read(buf) { let ch = match rdr.read(buf) {
Some(*) => buf[0] as char, Some(..) => buf[0] as char,
None => break, None => break,
}; };
match ch { match ch {
@ -253,7 +253,7 @@ pub fn decode_form_urlencoded(s: &[u8]) -> HashMap<~str, ~[~str]> {
loop { loop {
let mut buf = [0]; let mut buf = [0];
let ch = match rdr.read(buf) { let ch = match rdr.read(buf) {
Some(*) => buf[0] as char, Some(..) => buf[0] as char,
None => break, None => break,
}; };
match ch { match ch {
@ -318,7 +318,7 @@ fn split_char_first(s: &str, c: char) -> (~str, ~str) {
loop { loop {
let mut buf = [0]; let mut buf = [0];
let ch = match rdr.read(buf) { let ch = match rdr.read(buf) {
Some(*) => buf[0] as char, Some(..) => buf[0] as char,
None => break, None => break,
}; };
if ch == c { if ch == c {

View file

@ -973,7 +973,7 @@ fn is_writeable(p: &Path) -> bool {
!p.exists() || !p.exists() ||
(match io::result(|| p.stat()) { (match io::result(|| p.stat()) {
Err(*) => false, Err(..) => false,
Ok(m) => m.perm & io::UserWrite == io::UserWrite Ok(m) => m.perm & io::UserWrite == io::UserWrite
}) })
} }

View file

@ -95,7 +95,7 @@ impl Visitor<()> for Context {
ast::view_item_use(ref paths) => { ast::view_item_use(ref paths) => {
for path in paths.iter() { for path in paths.iter() {
match path.node { match path.node {
ast::view_path_glob(*) => { ast::view_path_glob(..) => {
self.gate_feature("globs", path.span, self.gate_feature("globs", path.span,
"glob import statements are \ "glob import statements are \
experimental and possibly buggy"); experimental and possibly buggy");
@ -110,8 +110,6 @@ impl Visitor<()> for Context {
} }
fn visit_item(&mut self, i: @ast::item, _:()) { fn visit_item(&mut self, i: @ast::item, _:()) {
// NOTE: uncomment after snapshot
/*
for attr in i.attrs.iter() { for attr in i.attrs.iter() {
if "thread_local" == attr.name() { if "thread_local" == attr.name() {
self.gate_feature("thread_local", i.span, self.gate_feature("thread_local", i.span,
@ -120,12 +118,11 @@ impl Visitor<()> for Context {
`#[task_local]` mapping to the task model"); `#[task_local]` mapping to the task model");
} }
} }
*/
match i.node { match i.node {
ast::item_enum(ref def, _) => { ast::item_enum(ref def, _) => {
for variant in def.variants.iter() { for variant in def.variants.iter() {
match variant.node.kind { match variant.node.kind {
ast::struct_variant_kind(*) => { ast::struct_variant_kind(..) => {
self.gate_feature("struct_variant", variant.span, self.gate_feature("struct_variant", variant.span,
"enum struct variants are \ "enum struct variants are \
experimental and possibly buggy"); experimental and possibly buggy");

View file

@ -19,8 +19,6 @@
#[crate_type = "lib"]; #[crate_type = "lib"];
#[feature(macro_rules, globs, struct_variant, managed_boxes)]; #[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 extra;
extern mod syntax; extern mod syntax;

View file

@ -128,7 +128,6 @@ pub enum RealPredicate {
// The LLVM TypeKind type - must stay in sync with the def of // The LLVM TypeKind type - must stay in sync with the def of
// LLVMTypeKind in llvm/include/llvm-c/Core.h // LLVMTypeKind in llvm/include/llvm-c/Core.h
#[cfg(not(stage0))]
#[deriving(Eq)] #[deriving(Eq)]
#[repr(C)] #[repr(C)]
pub enum TypeKind { pub enum TypeKind {
@ -150,42 +149,6 @@ pub enum TypeKind {
X86_MMX = 15, 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)] #[repr(C)]
pub enum AtomicBinOp { pub enum AtomicBinOp {
Xchg = 0, Xchg = 0,

View file

@ -503,7 +503,7 @@ pub enum DefLike {
pub fn def_like_to_def(def_like: DefLike) -> ast::Def { pub fn def_like_to_def(def_like: DefLike) -> ast::Def {
match def_like { match def_like {
DlDef(def) => return def, 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") DlField => fail!("found field in def_like_to_def")
} }
} }

View file

@ -623,7 +623,7 @@ fn encode_info_for_mod(ecx: &EncodeContext,
}); });
match item.node { match item.node {
item_impl(*) => { item_impl(..) => {
let (ident, did) = (item.ident, item.id); let (ident, did) = (item.ident, item.id);
debug!("(encoding info for module) ... encoding impl {} \ debug!("(encoding info for module) ... encoding impl {} \
({:?}/{:?})", ({:?}/{:?})",
@ -983,7 +983,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
encode_visibility(ebml_w, vis); encode_visibility(ebml_w, vis);
ebml_w.end_tag(); ebml_w.end_tag();
} }
item_ty(*) => { item_ty(..) => {
add_to_index(); add_to_index();
ebml_w.start_tag(tag_items_data_item); ebml_w.start_tag(tag_items_data_item);
encode_def_id(ebml_w, def_id); 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 for this trait.
encode_inherent_implementations(ecx, ebml_w, def_id); 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); ebml_w.start_tag(tag_items_data_item);
match nitem.node { match nitem.node {
foreign_item_fn(*) => { foreign_item_fn(..) => {
encode_def_id(ebml_w, local_def(nitem.id)); encode_def_id(ebml_w, local_def(nitem.id));
encode_family(ebml_w, purity_fn_family(impure_fn)); encode_family(ebml_w, purity_fn_family(impure_fn));
encode_bounds_and_type(ebml_w, ecx, encode_bounds_and_type(ebml_w, ecx,
@ -1769,7 +1769,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
link_meta, link_meta,
reachable, reachable,
non_inlineable_statics, non_inlineable_statics,
_ ..
} = parms; } = parms;
let type_abbrevs = @mut HashMap::new(); let type_abbrevs = @mut HashMap::new();
let stats = @mut stats; let stats = @mut stats;

View file

@ -138,7 +138,7 @@ pub fn search(filesearch: @FileSearch, pick: pick) {
} }
rslt rslt
} }
Err(*) => FileDoesntMatch, Err(..) => FileDoesntMatch,
} }
}); });
} }

View file

@ -313,7 +313,7 @@ impl fold::ast_fold for NestedItemsDropper {
node: ast::DeclItem(_), node: ast::DeclItem(_),
span: _ span: _
}, _) => None, }, _) => None,
ast::StmtMac(*) => fail!("unexpanded macro in astencode") ast::StmtMac(..) => fail!("unexpanded macro in astencode")
} }
}).collect(); }).collect();
let blk_sans_items = ast::Block { let blk_sans_items = ast::Block {
@ -483,7 +483,7 @@ impl tr for ty::Region {
index, index,
ident), ident),
ty::ReScope(id) => ty::ReScope(xcx.tr_id(id)), 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(ref fr) => {
ty::ReFree(ty::FreeRegion {scope_id: xcx.tr_id(fr.scope_id), ty::ReFree(ty::FreeRegion {scope_id: xcx.tr_id(fr.scope_id),
bound_region: fr.bound_region.tr(xcx)}) bound_region: fr.bound_region.tr(xcx)})

View file

@ -399,12 +399,12 @@ impl<'self> CheckLoanCtxt<'self> {
cmt = b; cmt = b;
} }
mc::cat_rvalue(*) | mc::cat_rvalue(..) |
mc::cat_static_item | mc::cat_static_item |
mc::cat_copied_upvar(*) | mc::cat_copied_upvar(..) |
mc::cat_deref(_, _, mc::unsafe_ptr(*)) | mc::cat_deref(_, _, mc::unsafe_ptr(..)) |
mc::cat_deref(_, _, mc::gc_ptr(*)) | mc::cat_deref(_, _, mc::gc_ptr(..)) |
mc::cat_deref(_, _, mc::region_ptr(*)) => { mc::cat_deref(_, _, mc::region_ptr(..)) => {
assert_eq!(cmt.mutbl, mc::McDeclared); assert_eq!(cmt.mutbl, mc::McDeclared);
return; return;
} }
@ -477,12 +477,12 @@ impl<'self> CheckLoanCtxt<'self> {
} }
mc::cat_copied_upvar(_) | mc::cat_copied_upvar(_) |
mc::cat_rvalue(*) | mc::cat_rvalue(..) |
mc::cat_local(*) | mc::cat_local(..) |
mc::cat_arg(_) | mc::cat_arg(_) |
mc::cat_self(*) | mc::cat_self(..) |
mc::cat_deref(_, _, mc::unsafe_ptr(*)) | mc::cat_deref(_, _, mc::unsafe_ptr(..)) |
mc::cat_static_item(*) | mc::cat_static_item(..) |
mc::cat_deref(_, _, mc::gc_ptr(_)) | mc::cat_deref(_, _, mc::gc_ptr(_)) |
mc::cat_deref(_, _, mc::region_ptr(MutImmutable, _)) => { mc::cat_deref(_, _, mc::region_ptr(MutImmutable, _)) => {
// Aliasability is independent of base cmt // Aliasability is independent of base cmt
@ -654,7 +654,7 @@ impl<'self> CheckLoanCtxt<'self> {
fn check_move_out_from_expr(&self, expr: @ast::Expr) { fn check_move_out_from_expr(&self, expr: @ast::Expr) {
match expr.node { match expr.node {
ast::ExprFnBlock(*) | ast::ExprProc(*) => { ast::ExprFnBlock(..) | ast::ExprProc(..) => {
// moves due to capture clauses are checked // moves due to capture clauses are checked
// in `check_loans_in_fn`, so that we can // in `check_loans_in_fn`, so that we can
// give a better error message // give a better error message
@ -728,14 +728,14 @@ fn check_loans_in_fn<'a>(this: &mut CheckLoanCtxt<'a>,
sp: Span, sp: Span,
id: ast::NodeId) { id: ast::NodeId) {
match *fk { match *fk {
visit::fk_item_fn(*) | visit::fk_item_fn(..) |
visit::fk_method(*) => { visit::fk_method(..) => {
// Don't process nested items. // Don't process nested items.
return; return;
} }
visit::fk_anon(*) | visit::fk_anon(..) |
visit::fk_fn_block(*) => { visit::fk_fn_block(..) => {
check_captured_variables(this, id, sp); check_captured_variables(this, id, sp);
} }
} }
@ -800,7 +800,7 @@ fn check_loans_in_expr<'a>(this: &mut CheckLoanCtxt<'a>,
match expr.node { match expr.node {
ast::ExprSelf | ast::ExprSelf |
ast::ExprPath(*) => { ast::ExprPath(..) => {
if !this.move_data.is_assignee(expr.id) { if !this.move_data.is_assignee(expr.id) {
let cmt = this.bccx.cat_expr_unadjusted(expr); let cmt = this.bccx.cat_expr_unadjusted(expr);
debug!("path cmt={}", cmt.repr(this.tcx())); debug!("path cmt={}", cmt.repr(this.tcx()));

View file

@ -100,11 +100,11 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt,
cmt0: mc::cmt, cmt0: mc::cmt,
cmt: mc::cmt) -> bool { cmt: mc::cmt) -> bool {
match cmt.cat { match cmt.cat {
mc::cat_deref(_, _, mc::region_ptr(*)) | mc::cat_deref(_, _, mc::region_ptr(..)) |
mc::cat_deref(_, _, mc::gc_ptr(*)) | mc::cat_deref(_, _, mc::gc_ptr(..)) |
mc::cat_deref(_, _, mc::unsafe_ptr(*)) | mc::cat_deref(_, _, mc::unsafe_ptr(..)) |
mc::cat_stack_upvar(*) | mc::cat_stack_upvar(..) |
mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Many, _ }) => { mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Many, .. }) => {
bccx.span_err( bccx.span_err(
cmt0.span, cmt0.span,
format!("cannot move out of {}", 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 // Can move out of captured upvars only if the destination closure
// type is 'once'. 1-shot stack closures emit the copied_upvar form // type is 'once'. 1-shot stack closures emit the copied_upvar form
// (see mem_categorization.rs). // (see mem_categorization.rs).
mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Once, _ }) => { mc::cat_copied_upvar(mc::CopiedUpvar { onceness: ast::Once, .. }) => {
true true
} }
@ -132,10 +132,10 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt,
true true
} }
mc::cat_rvalue(*) | mc::cat_rvalue(..) |
mc::cat_local(*) | mc::cat_local(..) |
mc::cat_arg(*) | mc::cat_arg(..) |
mc::cat_self(*) => { mc::cat_self(..) => {
true true
} }

View file

@ -70,13 +70,13 @@ impl<'self> GuaranteeLifetimeContext<'self> {
//! Main routine. Walks down `cmt` until we find the "guarantor". //! Main routine. Walks down `cmt` until we find the "guarantor".
match cmt.cat { match cmt.cat {
mc::cat_rvalue(*) | mc::cat_rvalue(..) |
mc::cat_copied_upvar(*) | // L-Local mc::cat_copied_upvar(..) | // L-Local
mc::cat_local(*) | // L-Local mc::cat_local(..) | // L-Local
mc::cat_arg(*) | // L-Local mc::cat_arg(..) | // L-Local
mc::cat_self(*) | // L-Local mc::cat_self(..) | // L-Local
mc::cat_deref(_, _, mc::region_ptr(*)) | // L-Deref-Borrowed mc::cat_deref(_, _, mc::region_ptr(..)) | // L-Deref-Borrowed
mc::cat_deref(_, _, mc::unsafe_ptr(*)) => { mc::cat_deref(_, _, mc::unsafe_ptr(..)) => {
let scope = self.scope(cmt); let scope = self.scope(cmt);
self.check_scope(scope) self.check_scope(scope)
} }
@ -183,7 +183,7 @@ impl<'self> GuaranteeLifetimeContext<'self> {
//! lvalue. //! lvalue.
cmt.mutbl.is_immutable() || match cmt.guarantor().cat { cmt.mutbl.is_immutable() || match cmt.guarantor().cat {
mc::cat_rvalue(*) => true, mc::cat_rvalue(..) => true,
_ => false _ => false
} }
} }
@ -305,16 +305,16 @@ impl<'self> GuaranteeLifetimeContext<'self> {
mc::cat_arg(id) => { mc::cat_arg(id) => {
self.bccx.moved_variables_set.contains(&id) self.bccx.moved_variables_set.contains(&id)
} }
mc::cat_rvalue(*) | mc::cat_rvalue(..) |
mc::cat_static_item | mc::cat_static_item |
mc::cat_copied_upvar(*) | mc::cat_copied_upvar(..) |
mc::cat_deref(*) => { mc::cat_deref(..) => {
false false
} }
r @ mc::cat_downcast(*) | r @ mc::cat_downcast(..) |
r @ mc::cat_interior(*) | r @ mc::cat_interior(..) |
r @ mc::cat_stack_upvar(*) | r @ mc::cat_stack_upvar(..) |
r @ mc::cat_discr(*) => { r @ mc::cat_discr(..) => {
self.tcx().sess.span_bug( self.tcx().sess.span_bug(
cmt.span, cmt.span,
format!("illegal guarantor category: {:?}", r)); format!("illegal guarantor category: {:?}", r));
@ -344,7 +344,7 @@ impl<'self> GuaranteeLifetimeContext<'self> {
mc::cat_self(local_id) => { mc::cat_self(local_id) => {
self.bccx.tcx.region_maps.encl_region(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 ty::ReStatic
} }
mc::cat_deref(_, _, mc::region_ptr(_, r)) => { mc::cat_deref(_, _, mc::region_ptr(_, r)) => {
@ -352,7 +352,7 @@ impl<'self> GuaranteeLifetimeContext<'self> {
} }
mc::cat_downcast(cmt) | mc::cat_downcast(cmt) |
mc::cat_deref(cmt, _, mc::uniq_ptr) | 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_interior(cmt, _) |
mc::cat_stack_upvar(cmt) | mc::cat_stack_upvar(cmt) |
mc::cat_discr(cmt, _) => { mc::cat_discr(cmt, _) => {

View file

@ -135,12 +135,12 @@ fn gather_loans_in_fn(this: &mut GatherLoanCtxt,
sp: Span, sp: Span,
id: ast::NodeId) { id: ast::NodeId) {
match fk { match fk {
&visit::fk_item_fn(*) | &visit::fk_method(*) => { &visit::fk_item_fn(..) | &visit::fk_method(..) => {
fail!("cannot occur, due to visit_item override"); fail!("cannot occur, due to visit_item override");
} }
// Visit closures as part of the containing item. // 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); this.push_repeating_id(body.id);
visit::walk_fn(this, fk, decl, body, sp, id, ()); visit::walk_fn(this, fk, decl, body, sp, id, ());
this.pop_repeating_id(body.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); this.pop_repeating_id(body.id);
} }
ast::ExprFnBlock(*) | ast::ExprProc(*) => { ast::ExprFnBlock(..) | ast::ExprProc(..) => {
gather_moves::gather_captures(this.bccx, this.move_data, ex); gather_moves::gather_captures(this.bccx, this.move_data, ex);
visit::walk_expr(this, ex, ()); visit::walk_expr(this, ex, ());
} }
@ -353,14 +353,14 @@ impl<'self> GatherLoanCtxt<'self> {
let _i = indenter(); let _i = indenter();
match *adjustment { match *adjustment {
ty::AutoAddEnv(*) => { ty::AutoAddEnv(..) => {
debug!("autoaddenv -- no autoref"); debug!("autoaddenv -- no autoref");
return; return;
} }
ty::AutoDerefRef( ty::AutoDerefRef(
ty::AutoDerefRef { ty::AutoDerefRef {
autoref: None, _ }) => { autoref: None, .. }) => {
debug!("no autoref"); debug!("no autoref");
return; return;
} }
@ -489,9 +489,9 @@ impl<'self> GatherLoanCtxt<'self> {
} }
ty::ReEmpty | ty::ReEmpty |
ty::ReLateBound(*) | ty::ReLateBound(..) |
ty::ReEarlyBound(*) | ty::ReEarlyBound(..) |
ty::ReInfer(*) => { ty::ReInfer(..) => {
self.tcx().sess.span_bug( self.tcx().sess.span_bug(
cmt.span, cmt.span,
format!("Invalid borrow lifetime: {:?}", loan_region)); format!("Invalid borrow lifetime: {:?}", loan_region));

View file

@ -68,7 +68,7 @@ impl<'self> RestrictionsContext<'self> {
} }
match cmt.cat { match cmt.cat {
mc::cat_rvalue(*) => { mc::cat_rvalue(..) => {
// Effectively, rvalues are stored into a // Effectively, rvalues are stored into a
// non-aliasable temporary on the stack. Since they // non-aliasable temporary on the stack. Since they
// are inherently non-aliasable, they can only be // are inherently non-aliasable, they can only be
@ -117,8 +117,8 @@ impl<'self> RestrictionsContext<'self> {
self.extend(result, cmt.mutbl, LpDeref(pk), restrictions) self.extend(result, cmt.mutbl, LpDeref(pk), restrictions)
} }
mc::cat_copied_upvar(*) | // FIXME(#2152) allow mutation of upvars mc::cat_copied_upvar(..) | // FIXME(#2152) allow mutation of upvars
mc::cat_static_item(*) | mc::cat_static_item(..) |
mc::cat_deref(_, _, mc::region_ptr(MutImmutable, _)) | mc::cat_deref(_, _, mc::region_ptr(MutImmutable, _)) |
mc::cat_deref(_, _, mc::gc_ptr(MutImmutable)) => { mc::cat_deref(_, _, mc::gc_ptr(MutImmutable)) => {
// R-Deref-Imm-Borrowed // 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. // We are very trusting when working with unsafe pointers.
Safe Safe
} }

View file

@ -127,13 +127,13 @@ fn borrowck_fn(this: &mut BorrowckCtxt,
sp: Span, sp: Span,
id: ast::NodeId) { id: ast::NodeId) {
match fk { match fk {
&visit::fk_anon(*) | &visit::fk_anon(..) |
&visit::fk_fn_block(*) => { &visit::fk_fn_block(..) => {
// Closures are checked as part of their containing fn item. // Closures are checked as part of their containing fn item.
} }
&visit::fk_item_fn(*) | &visit::fk_item_fn(..) |
&visit::fk_method(*) => { &visit::fk_method(..) => {
debug!("borrowck_fn(id={:?})", id); debug!("borrowck_fn(id={:?})", id);
// Check the body of fn items. // Check the body of fn items.
@ -305,7 +305,7 @@ pub fn opt_loan_path(cmt: mc::cmt) -> Option<@LoanPath> {
//! traverses the CMT. //! traverses the CMT.
match cmt.cat { match cmt.cat {
mc::cat_rvalue(*) | mc::cat_rvalue(..) |
mc::cat_static_item | mc::cat_static_item |
mc::cat_copied_upvar(_) => { mc::cat_copied_upvar(_) => {
None None
@ -497,14 +497,14 @@ impl BorrowckCtxt {
adj: @ty::AutoAdjustment) adj: @ty::AutoAdjustment)
-> mc::cmt { -> mc::cmt {
match *adj { match *adj {
ty::AutoAddEnv(*) => { ty::AutoAddEnv(..) => {
// no autoderefs // no autoderefs
mc::cat_expr_unadjusted(self.tcx, self.method_map, expr) mc::cat_expr_unadjusted(self.tcx, self.method_map, expr)
} }
ty::AutoDerefRef( ty::AutoDerefRef(
ty::AutoDerefRef { ty::AutoDerefRef {
autoderefs: autoderefs, _}) => { autoderefs: autoderefs, ..}) => {
mc::cat_expr_autoderefd(self.tcx, self.method_map, expr, mc::cat_expr_autoderefd(self.tcx, self.method_map, expr,
autoderefs) autoderefs)
} }
@ -657,10 +657,10 @@ impl BorrowckCtxt {
self.cmt_to_str(err.cmt), self.cmt_to_str(err.cmt),
self.mut_to_str(lk)) self.mut_to_str(lk))
} }
err_out_of_root_scope(*) => { err_out_of_root_scope(..) => {
format!("cannot root managed value long enough") format!("cannot root managed value long enough")
} }
err_out_of_scope(*) => { err_out_of_scope(..) => {
format!("borrowed value does not live long enough") format!("borrowed value does not live long enough")
} }
err_freeze_aliasable_const => { err_freeze_aliasable_const => {
@ -733,7 +733,7 @@ impl BorrowckCtxt {
pub fn note_and_explain_bckerr(&self, err: BckError) { pub fn note_and_explain_bckerr(&self, err: BckError) {
let code = err.code; let code = err.code;
match code { match code {
err_mutbl(*) | err_freeze_aliasable_const(*) => {} err_mutbl(..) | err_freeze_aliasable_const(..) => {}
err_out_of_root_scope(super_scope, sub_scope) => { err_out_of_root_scope(super_scope, sub_scope) => {
note_and_explain_region( note_and_explain_region(

View file

@ -211,7 +211,7 @@ impl MoveData {
} }
let index = match *lp { let index = match *lp {
LpVar(*) => { LpVar(..) => {
let index = MovePathIndex(self.paths.len()); let index = MovePathIndex(self.paths.len());
self.paths.push(MovePath { self.paths.push(MovePath {
@ -284,7 +284,7 @@ impl MoveData {
} }
None => { None => {
match *lp { match *lp {
LpVar(*) => { } LpVar(..) => { }
LpExtend(b, _, _) => { LpExtend(b, _, _) => {
self.add_existing_base_paths(b, result); self.add_existing_base_paths(b, result);
} }
@ -394,7 +394,7 @@ impl MoveData {
let path = *self.path_map.get(&path.loan_path); let path = *self.path_map.get(&path.loan_path);
self.kill_moves(path, kill_id, dfcx_moves); 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); let kill_id = tcx.region_maps.encl_scope(id);
dfcx_assign.add_kill(kill_id, assignment_index); dfcx_assign.add_kill(kill_id, assignment_index);
} }
LpExtend(*) => { LpExtend(..) => {
tcx.sess.bug("Var assignment for non var path"); tcx.sess.bug("Var assignment for non var path");
} }
} }

View file

@ -43,7 +43,7 @@ pub fn construct(tcx: ty::ctxt,
}; };
let entry = cfg_builder.add_node(0, []); let entry = cfg_builder.add_node(0, []);
let exit = cfg_builder.block(blk, entry); 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, CFG {exit_map: exit_map,
graph: graph, graph: graph,
entry: entry, entry: entry,
@ -72,7 +72,7 @@ impl CFGBuilder {
self.expr(expr, pred) self.expr(expr, pred)
} }
ast::StmtMac(*) => { ast::StmtMac(..) => {
self.tcx.sess.span_bug(stmt.span, "unexpanded macro"); self.tcx.sess.span_bug(stmt.span, "unexpanded macro");
} }
} }
@ -95,8 +95,8 @@ impl CFGBuilder {
match pat.node { match pat.node {
ast::PatIdent(_, _, None) | ast::PatIdent(_, _, None) |
ast::PatEnum(_, None) | ast::PatEnum(_, None) |
ast::PatLit(*) | ast::PatLit(..) |
ast::PatRange(*) | ast::PatRange(..) |
ast::PatWild | ast::PatWildMulti => { ast::PatWild | ast::PatWildMulti => {
self.add_node(pat.id, [pred]) self.add_node(pat.id, [pred])
} }
@ -239,7 +239,7 @@ impl CFGBuilder {
expr_exit expr_exit
} }
ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"),
ast::ExprLoop(ref body, _) => { ast::ExprLoop(ref body, _) => {
// //
@ -405,13 +405,13 @@ impl CFGBuilder {
} }
ast::ExprLogLevel | ast::ExprLogLevel |
ast::ExprMac(*) | ast::ExprMac(..) |
ast::ExprInlineAsm(*) | ast::ExprInlineAsm(..) |
ast::ExprSelf | ast::ExprSelf |
ast::ExprFnBlock(*) | ast::ExprFnBlock(..) |
ast::ExprProc(*) | ast::ExprProc(..) |
ast::ExprLit(*) | ast::ExprLit(..) |
ast::ExprPath(*) => { ast::ExprPath(..) => {
self.straightline(expr, pred, []) self.straightline(expr, pred, [])
} }
} }

View file

@ -86,9 +86,9 @@ pub fn check_pat(v: &mut CheckCrateVisitor, p: &Pat, _is_const: bool) {
match e.node { match e.node {
ExprVstore( ExprVstore(
@Expr { node: ExprLit(@codemap::Spanned { @Expr { node: ExprLit(@codemap::Spanned {
node: lit_str(*), node: lit_str(..),
_}), ..}),
_ }, .. },
ExprVstoreUniq ExprVstoreUniq
) => true, ) => true,
_ => false _ => false
@ -120,8 +120,8 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
"cannot do allocations in constant expressions"); "cannot do allocations in constant expressions");
return; return;
} }
ExprLit(@codemap::Spanned {node: lit_str(*), _}) => { } ExprLit(@codemap::Spanned {node: lit_str(..), ..}) => { }
ExprBinary(*) | ExprUnary(*) => { ExprBinary(..) | ExprUnary(..) => {
if method_map.contains_key(&e.id) { if method_map.contains_key(&e.id) {
sess.span_err(e.span, "user-defined operators are not \ sess.span_err(e.span, "user-defined operators are not \
allowed in constant expressions"); allowed in constant expressions");
@ -147,7 +147,7 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
items without type parameters"); items without type parameters");
} }
match def_map.find(&e.id) { match def_map.find(&e.id) {
Some(&DefStatic(*)) | Some(&DefStatic(..)) |
Some(&DefFn(_, _)) | Some(&DefFn(_, _)) |
Some(&DefVariant(_, _, _)) | Some(&DefVariant(_, _, _)) |
Some(&DefStruct(_)) => { } Some(&DefStruct(_)) => { }
@ -166,8 +166,8 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
} }
ExprCall(callee, _, NoSugar) => { ExprCall(callee, _, NoSugar) => {
match def_map.find(&callee.id) { match def_map.find(&callee.id) {
Some(&DefStruct(*)) => {} // OK. Some(&DefStruct(..)) => {} // OK.
Some(&DefVariant(*)) => {} // OK. Some(&DefVariant(..)) => {} // OK.
_ => { _ => {
sess.span_err( sess.span_err(
e.span, e.span,
@ -181,12 +181,12 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
ExprVstore(_, ExprVstoreSlice) | ExprVstore(_, ExprVstoreSlice) |
ExprVec(_, MutImmutable) | ExprVec(_, MutImmutable) |
ExprAddrOf(MutImmutable, _) | ExprAddrOf(MutImmutable, _) |
ExprField(*) | ExprField(..) |
ExprIndex(*) | ExprIndex(..) |
ExprTup(*) | ExprTup(..) |
ExprRepeat(*) | ExprRepeat(..) |
ExprStruct(*) => { } ExprStruct(..) => { }
ExprAddrOf(*) => { ExprAddrOf(..) => {
sess.span_err( sess.span_err(
e.span, e.span,
"borrowed pointers in constants may only refer to \ "borrowed pointers in constants may only refer to \
@ -251,7 +251,7 @@ impl Visitor<()> for CheckItemRecursionVisitor {
fn visit_expr(&mut self, e: @Expr, _: ()) { fn visit_expr(&mut self, e: @Expr, _: ()) {
match e.node { 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) => Some(&DefStatic(def_id, _)) if ast_util::is_local(def_id) =>
match self.env.ast_map.get_copy(&def_id.node) { match self.env.ast_map.get_copy(&def_id.node) {
ast_map::node_item(it, _) => { ast_map::node_item(it, _) => {

View file

@ -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 { match *ctor {
vec(n) => Some(format!("vectors of length {}", n).to_managed()), vec(n) => Some(format!("vectors of length {}", n).to_managed()),
_ => None _ => None
@ -274,7 +274,7 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
ty::ty_evec(_, ty::vstore_fixed(n)) => { ty::ty_evec(_, ty::vstore_fixed(n)) => {
is_useful_specialized(cx, m, v, vec(n), n, left_ty) 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| { let max_len = m.rev_iter().fold(0, |max_len, r| {
match r[0].node { match r[0].node {
PatVec(ref before, _, ref after) => { PatVec(ref before, _, ref after) => {
@ -348,13 +348,13 @@ fn pat_ctor_id(cx: &MatchCheckCtxt, p: @Pat) -> Option<ctor> {
PatRange(lo, hi) => { PatRange(lo, hi) => {
Some(range(eval_const_expr(cx.tcx, lo), eval_const_expr(cx.tcx, 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) { match cx.tcx.def_map.find(&pat.id) {
Some(&DefVariant(_, id, _)) => Some(variant(id)), Some(&DefVariant(_, id, _)) => Some(variant(id)),
_ => Some(single) _ => Some(single)
} }
} }
PatBox(_) | PatUniq(_) | PatTup(_) | PatRegion(*) => { PatBox(_) | PatUniq(_) | PatTup(_) | PatRegion(..) => {
Some(single) Some(single)
} }
PatVec(ref before, slice, ref after) => { PatVec(ref before, slice, ref after) => {
@ -372,7 +372,7 @@ fn is_wild(cx: &MatchCheckCtxt, p: @Pat) -> bool {
PatWild | PatWildMulti => { true } PatWild | PatWildMulti => { true }
PatIdent(_, _, _) => { PatIdent(_, _, _) => {
match cx.tcx.def_map.find(&pat.id) { match cx.tcx.def_map.find(&pat.id) {
Some(&DefVariant(_, _, _)) | Some(&DefStatic(*)) => { false } Some(&DefVariant(_, _, _)) | Some(&DefStatic(..)) => { false }
_ => { true } _ => { true }
} }
} }
@ -385,8 +385,8 @@ fn missing_ctor(cx: &MatchCheckCtxt,
left_ty: ty::t) left_ty: ty::t)
-> Option<ctor> { -> Option<ctor> {
match ty::get(left_ty).sty { match ty::get(left_ty).sty {
ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(*) | ty::ty_tup(_) | ty::ty_box(_) | ty::ty_uniq(_) | ty::ty_rptr(..) | ty::ty_tup(_) |
ty::ty_struct(*) => { ty::ty_struct(..) => {
for r in m.iter() { for r in m.iter() {
if !is_wild(cx, r[0]) { return None; } if !is_wild(cx, r[0]) { return None; }
} }
@ -451,7 +451,7 @@ fn missing_ctor(cx: &MatchCheckCtxt,
_ => None _ => None
} }
} }
ty::ty_unboxed_vec(*) | ty::ty_evec(*) => { ty::ty_unboxed_vec(..) | ty::ty_evec(..) => {
// Find the lengths and slices of all vector patterns. // Find the lengths and slices of all vector patterns.
let vec_pat_lens = m.iter().filter_map(|r| { 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 { fn ctor_arity(cx: &MatchCheckCtxt, ctor: &ctor, ty: ty::t) -> uint {
match ty::get(ty).sty { match ty::get(ty).sty {
ty::ty_tup(ref fs) => fs.len(), 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, _) => { ty::ty_enum(eid, _) => {
let id = match *ctor { variant(id) => id, let id = match *ctor { variant(id) => id,
_ => fail!("impossible case") }; _ => 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_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 { match *ctor {
vec(n) => n, vec(n) => n,
_ => 0u _ => 0u
@ -656,8 +656,8 @@ fn specialize(cx: &MatchCheckCtxt,
} }
DefVariant(_, _, _) => None, DefVariant(_, _, _) => None,
DefFn(*) | DefFn(..) |
DefStruct(*) => { DefStruct(..) => {
// FIXME #4731: Is this right? --pcw // FIXME #4731: Is this right? --pcw
let new_args; let new_args;
match args { match args {
@ -847,7 +847,7 @@ fn is_refutable(cx: &MatchCheckCtxt, pat: &Pat) -> bool {
return true; 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) is_refutable(cx, sub)
} }
PatWild | PatWildMulti | PatIdent(_, _, None) => { false } PatWild | PatWildMulti | PatIdent(_, _, None) => { false }
PatLit(@Expr {node: ExprLit(@Spanned { node: lit_nil, _}), _}) => { PatLit(@Expr {node: ExprLit(@Spanned { node: lit_nil, ..}), ..}) => {
// "()" // "()"
false false
} }
@ -872,7 +872,7 @@ fn is_refutable(cx: &MatchCheckCtxt, pat: &Pat) -> bool {
args.iter().any(|a| is_refutable(cx, *a)) args.iter().any(|a| is_refutable(cx, *a))
} }
PatEnum(_,_) => { false } 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| { let check_move: |&Pat, Option<@Pat>| = |p, sub| {
// check legality of moving out of the enum // 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)) { if sub.map_default(false, |p| pat_contains_bindings(def_map, p)) {
tcx.sess.span_err( tcx.sess.span_err(
p.span, p.span,

View file

@ -193,7 +193,7 @@ impl ConstEvalVisitor {
let cn = match e.node { let cn = match e.node {
ast::ExprLit(lit) => { ast::ExprLit(lit) => {
match lit.node { match lit.node {
ast::lit_str(*) | ast::lit_float(*) => general_const, ast::lit_str(..) | ast::lit_float(..) => general_const,
_ => integral_const _ => integral_const
} }
} }
@ -246,7 +246,7 @@ impl ConstEvalVisitor {
// surrounding nonlocal constants. But we don't yet. // surrounding nonlocal constants. But we don't yet.
ast::ExprPath(_) => self.lookup_constness(e), ast::ExprPath(_) => self.lookup_constness(e),
ast::ExprRepeat(*) => general_const, ast::ExprRepeat(..) => general_const,
_ => non_const _ => non_const
}; };

View file

@ -399,7 +399,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
self.walk_expr(expr, in_out, loop_scopes); self.walk_expr(expr, in_out, loop_scopes);
} }
ast::StmtMac(*) => { ast::StmtMac(..) => {
self.tcx().sess.span_bug(stmt.span, "unexpanded macro"); 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); 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, _) => { ast::ExprLoop(ref blk, _) => {
// //
@ -706,8 +706,8 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
} }
ast::ExprLogLevel | ast::ExprLogLevel |
ast::ExprLit(*) | ast::ExprLit(..) |
ast::ExprPath(*) | ast::ExprPath(..) |
ast::ExprSelf => { ast::ExprSelf => {
} }
@ -734,7 +734,7 @@ impl<'self, O:DataFlowOperator> PropagationContext<'self, O> {
self.walk_block(blk, in_out, loop_scopes); self.walk_block(blk, in_out, loop_scopes);
} }
ast::ExprMac(*) => { ast::ExprMac(..) => {
self.tcx().sess.span_bug(expr.span, "unexpanded macro"); self.tcx().sess.span_bug(expr.span, "unexpanded macro");
} }
} }

View file

@ -70,7 +70,7 @@ impl EffectCheckVisitor {
debug!("effect: checking index with base type {}", debug!("effect: checking index with base type {}",
ppaux::ty_to_str(self.tcx, base_type)); ppaux::ty_to_str(self.tcx, base_type));
match ty::get(base_type).sty { match ty::get(base_type).sty {
ty::ty_estr(*) => { ty::ty_estr(..) => {
self.tcx.sess.span_err(e.span, self.tcx.sess.span_err(e.span,
"modification of string types is not allowed"); "modification of string types is not allowed");
} }
@ -106,7 +106,7 @@ impl Visitor<()> for EffectCheckVisitor {
fn visit_block(&mut self, block: &ast::Block, _:()) { fn visit_block(&mut self, block: &ast::Block, _:()) {
let old_unsafe_context = self.unsafe_context; let old_unsafe_context = self.unsafe_context;
let is_unsafe = match block.rules { 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 { if is_unsafe && self.unsafe_context == SafeContext {
self.unsafe_context = UnsafeBlock(block.id) self.unsafe_context = UnsafeBlock(block.id)
@ -154,10 +154,10 @@ impl Visitor<()> for EffectCheckVisitor {
ast::ExprAddrOf(ast::MutMutable, base) => { ast::ExprAddrOf(ast::MutMutable, base) => {
self.check_str_index(base); self.check_str_index(base);
} }
ast::ExprInlineAsm(*) => { ast::ExprInlineAsm(..) => {
self.require_unsafe(expr.span, "use of inline assembly") self.require_unsafe(expr.span, "use of inline assembly")
} }
ast::ExprPath(*) => { ast::ExprPath(..) => {
match ty::resolve_expr(self.tcx, expr) { match ty::resolve_expr(self.tcx, expr) {
ast::DefStatic(_, true) => { ast::DefStatic(_, true) => {
self.require_unsafe(expr.span, "use of mutable static") self.require_unsafe(expr.span, "use of mutable static")

View file

@ -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) { fn find_item(item: @item, ctxt: &mut EntryContext) {
match item.node { match item.node {
item_fn(*) => { item_fn(..) => {
if item.ident.name == special_idents::main.name { if item.ident.name == special_idents::main.name {
match ctxt.ast_map.find(&item.id) { match ctxt.ast_map.find(&item.id) {
Some(&ast_map::node_item(_, path)) => { Some(&ast_map::node_item(_, path)) => {

View file

@ -47,10 +47,10 @@ impl Visitor<int> for CollectFreevarsVisitor {
fn visit_expr(&mut self, expr:@ast::Expr, depth:int) { fn visit_expr(&mut self, expr:@ast::Expr, depth:int) {
match expr.node { match expr.node {
ast::ExprFnBlock(*) | ast::ExprProc(*) => { ast::ExprFnBlock(..) | ast::ExprProc(..) => {
visit::walk_expr(self, expr, depth + 1) visit::walk_expr(self, expr, depth + 1)
} }
ast::ExprPath(*) | ast::ExprSelf => { ast::ExprPath(..) | ast::ExprSelf => {
let mut i = 0; let mut i = 0;
match self.def_map.find(&expr.id) { match self.def_map.find(&expr.id) {
None => fail!("path not found"), None => fail!("path not found"),

View file

@ -216,13 +216,13 @@ fn with_appropriate_checker(cx: &Context,
ty::ty_closure(ty::ClosureTy { ty::ty_closure(ty::ClosureTy {
sigil: OwnedSigil, sigil: OwnedSigil,
bounds: bounds, bounds: bounds,
_ ..
}) => { }) => {
b(|cx, fv| check_for_uniq(cx, fv, bounds)) b(|cx, fv| check_for_uniq(cx, fv, bounds))
} }
ty::ty_closure(ty::ClosureTy { ty::ty_closure(ty::ClosureTy {
sigil: ManagedSigil, sigil: ManagedSigil,
_ ..
}) => { }) => {
// can't happen // can't happen
} }
@ -230,7 +230,7 @@ fn with_appropriate_checker(cx: &Context,
sigil: BorrowedSigil, sigil: BorrowedSigil,
bounds: bounds, bounds: bounds,
region: region, region: region,
_ ..
}) => { }) => {
b(|cx, fv| check_for_block(cx, fv, bounds, 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, sp,
"mutable variables cannot be implicitly captured"); "mutable variables cannot be implicitly captured");
} }
DefLocal(*) | DefArg(*) => { /* ok */ } DefLocal(..) | DefArg(..) => { /* ok */ }
DefUpvar(_, def1, _, _) => { check_imm_free_var(cx, *def1, sp); } DefUpvar(_, def1, _, _) => { check_imm_free_var(cx, *def1, sp); }
DefBinding(*) | DefSelf(*) => { /*ok*/ } DefBinding(..) | DefSelf(..) => { /*ok*/ }
_ => { _ => {
cx.tcx.sess.span_bug( cx.tcx.sess.span_bug(
sp, 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 { pub fn check_durable(tcx: ty::ctxt, ty: ty::t, sp: Span) -> bool {
if !ty::type_is_static(tcx, ty) { if !ty::type_is_static(tcx, ty) {
match ty::get(ty).sty { match ty::get(ty).sty {
ty::ty_param(*) => { ty::ty_param(..) => {
tcx.sess.span_err(sp, "value may contain borrowed \ tcx.sess.span_err(sp, "value may contain borrowed \
pointers; add `'static` bound"); pointers; add `'static` bound");
} }
@ -529,7 +529,7 @@ pub fn check_cast_for_escaping_regions(
// worries. // worries.
let target_ty = ty::expr_ty(cx.tcx, target); let target_ty = ty::expr_ty(cx.tcx, target);
match ty::get(target_ty).sty { match ty::get(target_ty).sty {
ty::ty_trait(*) => {} ty::ty_trait(..) => {}
_ => { return; } _ => { return; }
} }
@ -591,7 +591,7 @@ pub fn check_cast_for_escaping_regions(
fn is_ReScope(r: ty::Region) -> bool { fn is_ReScope(r: ty::Region) -> bool {
match r { match r {
ty::ReScope(*) => true, ty::ReScope(..) => true,
_ => false _ => false
} }
} }

View file

@ -434,7 +434,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<@str> {
Some((key, value)) if "lang" == key => { Some((key, value)) if "lang" == key => {
return Some(value); return Some(value);
} }
Some(*) | None => {} Some(..) | None => {}
} }
} }
@ -446,7 +446,7 @@ pub fn collect_language_items(crate: &ast::Crate,
-> LanguageItems { -> LanguageItems {
let mut collector = LanguageItemCollector::new(session); let mut collector = LanguageItemCollector::new(session);
collector.collect(crate); collector.collect(crate);
let LanguageItemCollector { items, _ } = collector; let LanguageItemCollector { items, .. } = collector;
session.abort_if_errors(); session.abort_if_errors();
items items
} }

View file

@ -542,7 +542,7 @@ fn check_while_true_expr(cx: &Context, e: &ast::Expr) {
ast::ExprWhile(cond, _) => { ast::ExprWhile(cond, _) => {
match cond.node { match cond.node {
ast::ExprLit(@codemap::Spanned { ast::ExprLit(@codemap::Spanned {
node: ast::lit_bool(true), _}) => node: ast::lit_bool(true), ..}) =>
{ {
cx.span_lint(while_true, e.span, cx.span_lint(while_true, e.span,
"denote infinite loops with loop { ... }"); "denote infinite loops with loop { ... }");
@ -720,7 +720,7 @@ fn check_item_ctypes(cx: &Context, it: &ast::item) {
cx.span_lint(ctypes, ty.span, cx.span_lint(ctypes, ty.span,
"found enum type without foreign-function-safe \ "found enum type without foreign-function-safe \
representation annotation in foreign module"); 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) { fn check_heap_item(cx: &Context, it: &ast::item) {
match it.node { match it.node {
ast::item_fn(*) | ast::item_fn(..) |
ast::item_ty(*) | ast::item_ty(..) |
ast::item_enum(*) | ast::item_enum(..) |
ast::item_struct(*) => check_heap_type(cx, it.span, ast::item_struct(..) => check_heap_type(cx, it.span,
ty::node_id_to_type(cx.tcx, ty::node_id_to_type(cx.tcx,
it.id)), it.id)),
_ => () _ => ()
@ -892,7 +892,7 @@ fn check_heap_expr(cx: &Context, e: &ast::Expr) {
fn check_path_statement(cx: &Context, s: &ast::Stmt) { fn check_path_statement(cx: &Context, s: &ast::Stmt) {
match s.node { match s.node {
ast::StmtSemi(@ast::Expr { node: ast::ExprPath(_), _ }, _) => { ast::StmtSemi(@ast::Expr { node: ast::ExprPath(_), .. }, _) => {
cx.span_lint(path_statement, s.span, cx.span_lint(path_statement, s.span,
"path statement with no effect"); "path statement with no effect");
} }
@ -922,10 +922,10 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) {
} }
match it.node { match it.node {
ast::item_ty(*) | ast::item_struct(*) => { ast::item_ty(..) | ast::item_struct(..) => {
check_case(cx, "type", it.ident, it.span) check_case(cx, "type", it.ident, it.span)
} }
ast::item_trait(*) => { ast::item_trait(..) => {
check_case(cx, "trait", it.ident, it.span) check_case(cx, "trait", it.ident, it.span)
} }
ast::item_enum(ref enum_definition, _) => { 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)=> { ref path, _) if pat_util::pat_is_binding(cx.tcx.def_map, p)=> {
// `let mut _a = 1;` doesn't need a warning. // `let mut _a = 1;` doesn't need a warning.
let initial_underscore = match path.segments { let initial_underscore = match path.segments {
[ast::PathSegment { identifier: id, _ }] => { [ast::PathSegment { identifier: id, .. }] => {
cx.tcx.sess.str_of(id).starts_with("_") 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::ExprVstoreUniq) |
ast::ExprVstore(e2, ast::ExprVstoreBox) => { ast::ExprVstore(e2, ast::ExprVstoreBox) => {
match e2.node { match e2.node {
ast::ExprLit(@codemap::Spanned{node: ast::lit_str(*), _}) | ast::ExprLit(@codemap::Spanned{node: ast::lit_str(..), ..}) |
ast::ExprVec(*) => {} ast::ExprVec(..) => {}
_ => return _ => return
} }
} }
@ -1038,7 +1038,7 @@ fn check_unnecessary_allocation(cx: &Context, e: &ast::Expr) {
match cx.tcx.adjustments.find_copy(&e.id) { match cx.tcx.adjustments.find_copy(&e.id) {
Some(@ty::AutoDerefRef(ty::AutoDerefRef { Some(@ty::AutoDerefRef(ty::AutoDerefRef {
autoref: Some(ty::AutoBorrowVec(*)), _ })) => { autoref: Some(ty::AutoBorrowVec(..)), .. })) => {
cx.span_lint(unnecessary_allocation, e.span, cx.span_lint(unnecessary_allocation, e.span,
"unnecessary allocation, the sigil can be removed"); "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 fn check_missing_doc_item(cx: &mut Context, it: &ast::item) { // XXX doesn't need to be mut
let desc = match it.node { let desc = match it.node {
ast::item_fn(*) => "a function", ast::item_fn(..) => "a function",
ast::item_mod(*) => "a module", ast::item_mod(..) => "a module",
ast::item_enum(*) => "an enum", ast::item_enum(..) => "an enum",
ast::item_struct(*) => "a struct", ast::item_struct(..) => "a struct",
ast::item_trait(*) => "a trait", ast::item_trait(..) => "a trait",
_ => return _ => return
}; };
check_missing_doc_attrs(cx, it.id, it.attrs, it.span, desc); 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) => { Some(md) => {
match md.container { match md.container {
// Always check default methods defined on traits. // Always check default methods defined on traits.
ty::TraitContainer(*) => {} ty::TraitContainer(..) => {}
// For methods defined on impls, it depends on whether // For methods defined on impls, it depends on whether
// it is an implementation for a trait or is a plain // it is an implementation for a trait or is a plain
// impl. // impl.
ty::ImplContainer(cid) => { ty::ImplContainer(cid) => {
match ty::impl_trait_ref(cx.tcx, 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 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. /// #[unstable] (or none of them) attributes.
fn check_stability(cx: &Context, e: &ast::Expr) { fn check_stability(cx: &Context, e: &ast::Expr) {
let def = match e.node { let def = match e.node {
ast::ExprMethodCall(*) | ast::ExprMethodCall(..) |
ast::ExprPath(*) | ast::ExprPath(..) |
ast::ExprStruct(*) => { ast::ExprStruct(..) => {
match cx.tcx.def_map.find(&e.id) { match cx.tcx.def_map.find(&e.id) {
Some(&def) => def, Some(&def) => def,
None => return None => return
@ -1178,17 +1178,17 @@ fn check_stability(cx: &Context, e: &ast::Expr) {
let (lint, label) = match stability { let (lint, label) = match stability {
// no stability attributes == Unstable // no stability attributes == Unstable
None => (unstable, "unmarked"), None => (unstable, "unmarked"),
Some(attr::Stability { level: attr::Unstable, _ }) => Some(attr::Stability { level: attr::Unstable, .. }) =>
(unstable, "unstable"), (unstable, "unstable"),
Some(attr::Stability { level: attr::Experimental, _ }) => Some(attr::Stability { level: attr::Experimental, .. }) =>
(experimental, "experimental"), (experimental, "experimental"),
Some(attr::Stability { level: attr::Deprecated, _ }) => Some(attr::Stability { level: attr::Deprecated, .. }) =>
(deprecated, "deprecated"), (deprecated, "deprecated"),
_ => return _ => return
}; };
let msg = match stability { 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, *s)
} }
_ => format!("use of {} item", label) _ => format!("use of {} item", label)

View file

@ -298,7 +298,7 @@ impl IrMaps {
self.num_vars += 1; self.num_vars += 1;
match vk { 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); self.variable_map.insert(node_id, v);
}, },
ImplicitRet => {} ImplicitRet => {}
@ -321,7 +321,7 @@ impl IrMaps {
pub fn variable_name(&mut self, var: Variable) -> @str { pub fn variable_name(&mut self, var: Variable) -> @str {
match self.var_kinds[*var] { match self.var_kinds[*var] {
Local(LocalInfo { ident: nm, _ }) | Arg(_, nm) => { Local(LocalInfo { ident: nm, .. }) | Arg(_, nm) => {
self.tcx.sess.str_of(nm) self.tcx.sess.str_of(nm)
}, },
ImplicitRet => @"<implicit-ret>" ImplicitRet => @"<implicit-ret>"
@ -394,14 +394,14 @@ fn visit_fn(v: &mut LivenessVisitor,
match *fk { match *fk {
visit::fk_method(_, _, method) => { visit::fk_method(_, _, method) => {
match method.explicit_self.node { 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, fn_maps.add_variable(Arg(method.self_id,
special_idents::self_)); special_idents::self_));
} }
sty_static => {} 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, // 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); visit::walk_expr(v, expr, this);
} }
ExprFnBlock(*) | ExprProc(*) => { ExprFnBlock(..) | ExprProc(..) => {
// Interesting control flow (for loops can contain labeled // Interesting control flow (for loops can contain labeled
// breaks or continues) // breaks or continues)
this.add_live_node_for_node(expr.id, ExprNode(expr.span)); 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: // 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)); this.add_live_node_for_node(expr.id, ExprNode(expr.span));
visit::walk_expr(v, expr, this); 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) => { ExprBinary(_, op, _, _) if ast_util::lazy_binop(op) => {
this.add_live_node_for_node(expr.id, ExprNode(expr.span)); this.add_live_node_for_node(expr.id, ExprNode(expr.span));
visit::walk_expr(v, expr, this); visit::walk_expr(v, expr, this);
} }
// otherwise, live nodes are not required: // otherwise, live nodes are not required:
ExprIndex(*) | ExprField(*) | ExprVstore(*) | ExprVec(*) | ExprIndex(..) | ExprField(..) | ExprVstore(..) | ExprVec(..) |
ExprCall(*) | ExprMethodCall(*) | ExprTup(*) | ExprLogLevel | ExprCall(..) | ExprMethodCall(..) | ExprTup(..) | ExprLogLevel |
ExprBinary(*) | ExprAddrOf(*) | ExprBinary(..) | ExprAddrOf(..) |
ExprDoBody(*) | ExprCast(*) | ExprUnary(*) | ExprBreak(_) | ExprDoBody(..) | ExprCast(..) | ExprUnary(..) | ExprBreak(_) |
ExprAgain(_) | ExprLit(_) | ExprRet(*) | ExprBlock(*) | ExprAgain(_) | ExprLit(_) | ExprRet(..) | ExprBlock(..) |
ExprAssign(*) | ExprAssignOp(*) | ExprMac(*) | ExprAssign(..) | ExprAssignOp(..) | ExprMac(..) |
ExprStruct(*) | ExprRepeat(*) | ExprParen(*) | ExprStruct(..) | ExprRepeat(..) | ExprParen(..) |
ExprInlineAsm(*) => { ExprInlineAsm(..) => {
visit::walk_expr(v, expr, this); visit::walk_expr(v, expr, this);
} }
} }
@ -956,7 +956,7 @@ impl Liveness {
return self.propagate_through_expr(expr, succ); return self.propagate_through_expr(expr, succ);
} }
StmtMac(*) => { StmtMac(..) => {
self.tcx.sess.span_bug(stmt.span, "unexpanded macro"); self.tcx.sess.span_bug(stmt.span, "unexpanded macro");
} }
} }
@ -1073,7 +1073,7 @@ impl Liveness {
self.propagate_through_loop(expr, Some(cond), blk, succ) 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 // Note that labels have been resolved, so we don't need to look
// at the label ident // at the label ident
@ -1243,7 +1243,7 @@ impl Liveness {
} }
ExprLogLevel | ExprLogLevel |
ExprLit(*) => { ExprLit(..) => {
succ succ
} }
@ -1251,7 +1251,7 @@ impl Liveness {
self.propagate_through_block(blk, succ) self.propagate_through_block(blk, succ)
} }
ExprMac(*) => { ExprMac(..) => {
self.tcx.sess.span_bug(expr.span, "unexpanded macro"); 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 // no correctness conditions related to liveness
ExprCall(*) | ExprMethodCall(*) | ExprIf(*) | ExprMatch(*) | ExprCall(..) | ExprMethodCall(..) | ExprIf(..) | ExprMatch(..) |
ExprWhile(*) | ExprLoop(*) | ExprIndex(*) | ExprField(*) | ExprWhile(..) | ExprLoop(..) | ExprIndex(..) | ExprField(..) |
ExprVstore(*) | ExprVec(*) | ExprTup(*) | ExprLogLevel | ExprVstore(..) | ExprVec(..) | ExprTup(..) | ExprLogLevel |
ExprBinary(*) | ExprDoBody(*) | ExprBinary(..) | ExprDoBody(..) |
ExprCast(*) | ExprUnary(*) | ExprRet(*) | ExprBreak(*) | ExprCast(..) | ExprUnary(..) | ExprRet(..) | ExprBreak(..) |
ExprAgain(*) | ExprLit(_) | ExprBlock(*) | ExprAgain(..) | ExprLit(_) | ExprBlock(..) |
ExprMac(*) | ExprAddrOf(*) | ExprStruct(*) | ExprRepeat(*) | ExprMac(..) | ExprAddrOf(..) | ExprStruct(..) | ExprRepeat(..) |
ExprParen(*) | ExprFnBlock(*) | ExprProc(*) | ExprPath(*) | ExprParen(..) | ExprFnBlock(..) | ExprProc(..) | ExprPath(..) |
ExprSelf(*) => { ExprSelf(..) => {
visit::walk_expr(this, expr, ()); visit::walk_expr(this, expr, ());
} }
ExprForLoop(*) => fail!("non-desugared expr_for_loop") ExprForLoop(..) => fail!("non-desugared expr_for_loop")
} }
} }

View file

@ -68,11 +68,11 @@ pub enum categorization {
cat_arg(ast::NodeId), // formal argument cat_arg(ast::NodeId), // formal argument
cat_deref(cmt, uint, PointerKind), // deref of a ptr cat_deref(cmt, uint, PointerKind), // deref of a ptr
cat_interior(cmt, InteriorKind), // something interior: field, tuple, etc 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_discr(cmt, ast::NodeId), // match discriminant (see preserve())
cat_self(ast::NodeId), // explicit `self` 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)] #[deriving(Eq)]
@ -159,7 +159,7 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) | ty::ty_trait(_, _, ty::UniqTraitStore, _, _) |
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_estr(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)) Some(deref_ptr(uniq_ptr))
} }
@ -174,7 +174,7 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
ty::ty_estr(ty::vstore_slice(r)) | ty::ty_estr(ty::vstore_slice(r)) |
ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil, ty::ty_closure(ty::ClosureTy {sigil: ast::BorrowedSigil,
region: r, _}) => { region: r, ..}) => {
Some(deref_ptr(region_ptr(ast::MutImmutable, r))) Some(deref_ptr(region_ptr(ast::MutImmutable, r)))
} }
@ -195,8 +195,8 @@ pub fn opt_deref_kind(t: ty::t) -> Option<deref_kind> {
Some(deref_ptr(unsafe_ptr(mt.mutbl))) Some(deref_ptr(unsafe_ptr(mt.mutbl)))
} }
ty::ty_enum(*) | ty::ty_enum(..) |
ty::ty_struct(*) => { // newtype ty::ty_struct(..) => { // newtype
Some(deref_interior(InteriorField(PositionalField(0)))) Some(deref_interior(InteriorField(PositionalField(0))))
} }
@ -346,7 +346,7 @@ impl mem_categorization_ctxt {
self.cat_expr_unadjusted(expr) self.cat_expr_unadjusted(expr)
} }
Some(&@ty::AutoAddEnv(*)) => { Some(&@ty::AutoAddEnv(..)) => {
// Convert a bare fn to a closure by adding NULL env. // Convert a bare fn to a closure by adding NULL env.
// Result is an rvalue. // Result is an rvalue.
let expr_ty = ty::expr_ty_adjusted(self.tcx, expr); let expr_ty = ty::expr_ty_adjusted(self.tcx, expr);
@ -356,7 +356,7 @@ impl mem_categorization_ctxt {
Some( Some(
&@ty::AutoDerefRef( &@ty::AutoDerefRef(
ty::AutoDerefRef { ty::AutoDerefRef {
autoref: Some(_), _})) => { autoref: Some(_), ..})) => {
// Equivalent to &*expr or something similar. // Equivalent to &*expr or something similar.
// Result is an rvalue. // Result is an rvalue.
let expr_ty = ty::expr_ty_adjusted(self.tcx, expr); 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::ExprParen(e) => self.cat_expr_unadjusted(e),
ast::ExprAddrOf(*) | ast::ExprCall(*) | ast::ExprAddrOf(..) | ast::ExprCall(..) |
ast::ExprAssign(*) | ast::ExprAssignOp(*) | ast::ExprAssign(..) | ast::ExprAssignOp(..) |
ast::ExprFnBlock(*) | ast::ExprProc(*) | ast::ExprRet(*) | ast::ExprFnBlock(..) | ast::ExprProc(..) | ast::ExprRet(..) |
ast::ExprDoBody(*) | ast::ExprUnary(*) | ast::ExprDoBody(..) | ast::ExprUnary(..) |
ast::ExprMethodCall(*) | ast::ExprCast(*) | ast::ExprVstore(*) | ast::ExprMethodCall(..) | ast::ExprCast(..) | ast::ExprVstore(..) |
ast::ExprVec(*) | ast::ExprTup(*) | ast::ExprIf(*) | ast::ExprVec(..) | ast::ExprTup(..) | ast::ExprIf(..) |
ast::ExprLogLevel | ast::ExprBinary(*) | ast::ExprWhile(*) | ast::ExprLogLevel | ast::ExprBinary(..) | ast::ExprWhile(..) |
ast::ExprBlock(*) | ast::ExprLoop(*) | ast::ExprMatch(*) | ast::ExprBlock(..) | ast::ExprLoop(..) | ast::ExprMatch(..) |
ast::ExprLit(*) | ast::ExprBreak(*) | ast::ExprMac(*) | ast::ExprLit(..) | ast::ExprBreak(..) | ast::ExprMac(..) |
ast::ExprAgain(*) | ast::ExprStruct(*) | ast::ExprRepeat(*) | ast::ExprAgain(..) | ast::ExprStruct(..) | ast::ExprRepeat(..) |
ast::ExprInlineAsm(*) => { ast::ExprInlineAsm(..) => {
return self.cat_rvalue_node(expr, expr_ty); 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) def: ast::Def)
-> cmt { -> cmt {
match def { match def {
ast::DefFn(*) | ast::DefStaticMethod(*) | ast::DefMod(_) | ast::DefFn(..) | ast::DefStaticMethod(..) | ast::DefMod(_) |
ast::DefForeignMod(_) | ast::DefStatic(_, false) | ast::DefForeignMod(_) | ast::DefStatic(_, false) |
ast::DefUse(_) | ast::DefVariant(*) | ast::DefUse(_) | ast::DefVariant(..) |
ast::DefTrait(_) | ast::DefTy(_) | ast::DefPrimTy(_) | ast::DefTrait(_) | ast::DefTy(_) | ast::DefPrimTy(_) |
ast::DefTyParam(*) | ast::DefStruct(*) | ast::DefTyParam(..) | ast::DefStruct(..) |
ast::DefTyParamBinder(*) | ast::DefRegion(_) | ast::DefTyParamBinder(..) | ast::DefRegion(_) |
ast::DefLabel(_) | ast::DefSelfTy(*) | ast::DefMethod(*) => { ast::DefLabel(_) | ast::DefSelfTy(..) | ast::DefMethod(..) => {
@cmt_ { @cmt_ {
id:id, id:id,
span:span, span:span,
@ -835,7 +835,7 @@ impl mem_categorization_ctxt {
// we can be sure that the binding will remain valid for the // we can be sure that the binding will remain valid for the
// duration of the arm. // 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 // pattern ids and types as compared to *expression* ids and
// types. This is explained briefly. on the definition of the // types. This is explained briefly. on the definition of the
// type `cmt`, so go off and read what it says there, then // type `cmt`, so go off and read what it says there, then
@ -881,7 +881,7 @@ impl mem_categorization_ctxt {
} }
ast::PatEnum(_, None) => { ast::PatEnum(_, None) => {
// variant(*) // variant(..)
} }
ast::PatEnum(_, Some(ref subpats)) => { ast::PatEnum(_, Some(ref subpats)) => {
match self.tcx.def_map.find(&pat.id) { match self.tcx.def_map.find(&pat.id) {
@ -897,7 +897,7 @@ impl mem_categorization_ctxt {
}; };
for (i, &subpat) in subpats.iter().enumerate() { 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 = let subcmt =
self.cat_imm_interior( self.cat_imm_interior(
@ -907,10 +907,10 @@ impl mem_categorization_ctxt {
self.cat_pattern(subcmt, subpat, |x,y| op(x,y)); self.cat_pattern(subcmt, subpat, |x,y| op(x,y));
} }
} }
Some(&ast::DefFn(*)) | Some(&ast::DefFn(..)) |
Some(&ast::DefStruct(*)) => { Some(&ast::DefStruct(..)) => {
for (i, &subpat) in subpats.iter().enumerate() { 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 = let cmt_field =
self.cat_imm_interior( self.cat_imm_interior(
pat, cmt, subpat_ty, pat, cmt, subpat_ty,
@ -918,7 +918,7 @@ impl mem_categorization_ctxt {
self.cat_pattern(cmt_field, subpat, |x,y| op(x,y)); self.cat_pattern(cmt_field, subpat, |x,y| op(x,y));
} }
} }
Some(&ast::DefStatic(*)) => { Some(&ast::DefStatic(..)) => {
for &subpat in subpats.iter() { for &subpat in subpats.iter() {
self.cat_pattern(cmt, subpat, |x,y| op(x,y)); self.cat_pattern(cmt, subpat, |x,y| op(x,y));
} }
@ -942,7 +942,7 @@ impl mem_categorization_ctxt {
ast::PatStruct(_, ref field_pats, _) => { ast::PatStruct(_, ref field_pats, _) => {
// {f1: p1, ..., fN: pN} // {f1: p1, ..., fN: pN}
for fp in field_pats.iter() { 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); let cmt_field = self.cat_field(pat, cmt, fp.ident, field_ty);
self.cat_pattern(cmt_field, fp.pat, |x,y| op(x,y)); self.cat_pattern(cmt_field, fp.pat, |x,y| op(x,y));
} }
@ -951,7 +951,7 @@ impl mem_categorization_ctxt {
ast::PatTup(ref subpats) => { ast::PatTup(ref subpats) => {
// (p1, ..., pN) // (p1, ..., pN)
for (i, &subpat) in subpats.iter().enumerate() { 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 = let subcmt =
self.cat_imm_interior( self.cat_imm_interior(
pat, cmt, subpat_ty, pat, cmt, subpat_ty,
@ -1003,7 +1003,7 @@ impl mem_categorization_ctxt {
cat_copied_upvar(_) => { cat_copied_upvar(_) => {
~"captured outer variable in a heap closure" ~"captured outer variable in a heap closure"
} }
cat_rvalue(*) => { cat_rvalue(..) => {
~"non-lvalue" ~"non-lvalue"
} }
cat_local(_) => { cat_local(_) => {
@ -1012,7 +1012,7 @@ impl mem_categorization_ctxt {
cat_self(_) => { cat_self(_) => {
~"self value" ~"self value"
} }
cat_arg(*) => { cat_arg(..) => {
~"argument" ~"argument"
} }
cat_deref(_, _, pk) => { 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) { match tcx.def_map.get_copy(&node_id) {
ast::DefVariant(_, variant_id, _) => { ast::DefVariant(_, variant_id, _) => {
let r = ty::lookup_struct_fields(tcx, 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. //! determines how long the value in `self` remains live.
match self.cat { match self.cat {
cat_rvalue(*) | cat_rvalue(..) |
cat_static_item | cat_static_item |
cat_copied_upvar(*) | cat_copied_upvar(..) |
cat_local(*) | cat_local(..) |
cat_self(*) | cat_self(..) |
cat_arg(*) | cat_arg(..) |
cat_deref(_, _, unsafe_ptr(*)) | cat_deref(_, _, unsafe_ptr(..)) |
cat_deref(_, _, gc_ptr(*)) | cat_deref(_, _, gc_ptr(..)) |
cat_deref(_, _, region_ptr(*)) => { cat_deref(_, _, region_ptr(..)) => {
self self
} }
cat_downcast(b) | cat_downcast(b) |
@ -1137,18 +1137,18 @@ impl cmt_ {
// aliased and eventually recused. // aliased and eventually recused.
match self.cat { match self.cat {
cat_copied_upvar(CopiedUpvar {onceness: ast::Once, _}) | cat_copied_upvar(CopiedUpvar {onceness: ast::Once, ..}) |
cat_rvalue(*) | cat_rvalue(..) |
cat_local(*) | cat_local(..) |
cat_arg(_) | cat_arg(_) |
cat_self(*) | cat_self(..) |
cat_deref(_, _, unsafe_ptr(*)) | // of course it is aliasable, but... cat_deref(_, _, unsafe_ptr(..)) | // of course it is aliasable, but...
cat_deref(_, _, region_ptr(MutMutable, _)) => { cat_deref(_, _, region_ptr(MutMutable, _)) => {
None None
} }
cat_copied_upvar(CopiedUpvar {onceness: ast::Many, _}) | cat_copied_upvar(CopiedUpvar {onceness: ast::Many, ..}) |
cat_static_item(*) => { cat_static_item(..) => {
Some(AliasableOther) Some(AliasableOther)
} }
@ -1160,11 +1160,11 @@ impl cmt_ {
Some(AliasableBorrowed(m)) Some(AliasableBorrowed(m))
} }
cat_downcast(*) | cat_downcast(..) |
cat_stack_upvar(*) | cat_stack_upvar(..) |
cat_deref(_, _, uniq_ptr) | cat_deref(_, _, uniq_ptr) |
cat_interior(*) | cat_interior(..) |
cat_discr(*) => { cat_discr(..) => {
None None
} }
} }
@ -1185,11 +1185,11 @@ impl Repr for categorization {
fn repr(&self, tcx: ty::ctxt) -> ~str { fn repr(&self, tcx: ty::ctxt) -> ~str {
match *self { match *self {
cat_static_item | cat_static_item |
cat_rvalue(*) | cat_rvalue(..) |
cat_copied_upvar(*) | cat_copied_upvar(..) |
cat_local(*) | cat_local(..) |
cat_self(*) | cat_self(..) |
cat_arg(*) => { cat_arg(..) => {
format!("{:?}", *self) format!("{:?}", *self)
} }
cat_deref(cmt, derefs, ptr) => { cat_deref(cmt, derefs, ptr) => {
@ -1233,8 +1233,8 @@ impl Repr for InteriorKind {
fn element_kind(t: ty::t) -> ElementKind { fn element_kind(t: ty::t) -> ElementKind {
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_evec(*) => VecElement, ty::ty_evec(..) => VecElement,
ty::ty_estr(*) => StrElement, ty::ty_estr(..) => StrElement,
_ => OtherElement _ => OtherElement
} }
} }

View file

@ -322,14 +322,14 @@ impl VisitContext {
let comp_mode = match self.tcx.adjustments.find(&expr.id) { let comp_mode = match self.tcx.adjustments.find(&expr.id) {
Some(&@ty::AutoDerefRef( Some(&@ty::AutoDerefRef(
ty::AutoDerefRef { ty::AutoDerefRef {
autoref: Some(_), _})) => Read, autoref: Some(_), ..})) => Read,
_ => expr_mode _ => expr_mode
}; };
debug!("comp_mode = {:?}", comp_mode); debug!("comp_mode = {:?}", comp_mode);
match expr.node { match expr.node {
ExprPath(*) | ExprSelf => { ExprPath(..) | ExprSelf => {
match comp_mode { match comp_mode {
Move => { Move => {
let def = self.tcx.def_map.get_copy(&expr.id); let def = self.tcx.def_map.get_copy(&expr.id);
@ -372,7 +372,7 @@ impl VisitContext {
Many => Read, Many => Read,
} }
}, },
ty::ty_bare_fn(*) => Read, ty::ty_bare_fn(..) => Read,
ref x => ref x =>
self.tcx.sess.span_bug(callee.span, self.tcx.sess.span_bug(callee.span,
format!("non-function type in moves for expr_call: {:?}", x)), format!("non-function type in moves for expr_call: {:?}", x)),
@ -484,10 +484,10 @@ impl VisitContext {
} }
ExprLogLevel | ExprLogLevel |
ExprInlineAsm(*) | ExprInlineAsm(..) |
ExprBreak(*) | ExprBreak(..) |
ExprAgain(*) | ExprAgain(..) |
ExprLit(*) => {} ExprLit(..) => {}
ExprLoop(ref blk, _) => { ExprLoop(ref blk, _) => {
self.consume_block(blk); self.consume_block(blk);
@ -498,7 +498,7 @@ impl VisitContext {
self.consume_block(blk); self.consume_block(blk);
} }
ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ExprForLoop(..) => fail!("non-desugared expr_for_loop"),
ExprUnary(_, _, lhs) => { ExprUnary(_, _, lhs) => {
if !self.use_overloaded_operator(expr, lhs, []) if !self.use_overloaded_operator(expr, lhs, [])
@ -567,7 +567,7 @@ impl VisitContext {
self.use_expr(base, comp_mode); self.use_expr(base, comp_mode);
} }
ExprMac(*) => { ExprMac(..) => {
self.tcx.sess.span_bug( self.tcx.sess.span_bug(
expr.span, expr.span,
"macro expression remains after expansion"); "macro expression remains after expansion");

View file

@ -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 { pub fn pat_is_variant_or_struct(dm: resolve::DefMap, pat: &Pat) -> bool {
match pat.node { match pat.node {
PatEnum(_, _) | PatIdent(_, _, None) | PatStruct(*) => { PatEnum(_, _) | PatIdent(_, _, None) | PatStruct(..) => {
match dm.find(&pat.id) { match dm.find(&pat.id) {
Some(&DefVariant(*)) | Some(&DefStruct(*)) => true, Some(&DefVariant(..)) | Some(&DefStruct(..)) => true,
_ => false _ => 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 { pub fn pat_is_const(dm: resolve::DefMap, pat: &Pat) -> bool {
match pat.node { match pat.node {
PatIdent(_, _, None) | PatEnum(*) => { PatIdent(_, _, None) | PatEnum(..) => {
match dm.find(&pat.id) { match dm.find(&pat.id) {
Some(&DefStatic(_, false)) => true, Some(&DefStatic(_, false)) => true,
_ => false _ => 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 { pub fn pat_is_binding(dm: resolve::DefMap, pat: &Pat) -> bool {
match pat.node { match pat.node {
PatIdent(*) => { PatIdent(..) => {
!pat_is_variant_or_struct(dm, pat) && !pat_is_variant_or_struct(dm, pat) &&
!pat_is_const(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 { pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: &Pat) -> bool {
match pat.node { match pat.node {
PatIdent(*) => pat_is_binding(dm, pat), PatIdent(..) => pat_is_binding(dm, pat),
PatWild | PatWildMulti => true, PatWild | PatWildMulti => true,
_ => false _ => 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 /// 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 { pub fn pat_contains_bindings(dm: resolve::DefMap, pat: &Pat) -> bool {
let mut contains_bindings = false; let mut contains_bindings = false;
walk_pat(pat, |p| { walk_pat(pat, |p| {

View file

@ -50,7 +50,7 @@ impl Visitor<()> for ParentVisitor {
let prev = self.curparent; let prev = self.curparent;
match item.node { 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 // Enum variants are parented to the enum definition itself beacuse
// they inherit privacy // they inherit privacy
ast::item_enum(ref def, _) => { ast::item_enum(ref def, _) => {
@ -173,7 +173,7 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> {
match item.node { match item.node {
// impls/extern blocks do not break the "public chain" because they // impls/extern blocks do not break the "public chain" because they
// cannot have visibility qualifiers on them anyway // 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 // Private by default, hence we only retain the "public chain" if
// `pub` is explicitly listed. // `pub` is explicitly listed.
@ -221,7 +221,7 @@ impl<'self> Visitor<()> for EmbargoVisitor<'self> {
let public_ty = match ty.node { let public_ty = match ty.node {
ast::ty_path(_, _, id) => { ast::ty_path(_, _, id) => {
match self.tcx.def_map.get_copy(&id) { match self.tcx.def_map.get_copy(&id) {
ast::DefPrimTy(*) => true, ast::DefPrimTy(..) => true,
def => { def => {
let did = def_id_of_def(def); let did = def_id_of_def(def);
!is_local(did) || !is_local(did) ||
@ -404,12 +404,12 @@ impl<'self> PrivacyVisitor<'self> {
// where the method was defined? // where the method was defined?
Some(&ast_map::node_method(ref m, imp, _)) => { Some(&ast_map::node_method(ref m, imp, _)) => {
match ty::impl_trait_ref(self.tcx, imp) { match ty::impl_trait_ref(self.tcx, imp) {
Some(*) => return Allowable, Some(..) => return Allowable,
_ if m.vis == ast::public => return Allowable, _ if m.vis == ast::public => return Allowable,
_ => m.vis _ => m.vis
} }
} }
Some(&ast_map::node_trait_method(*)) => { Some(&ast_map::node_trait_method(..)) => {
return Allowable; return Allowable;
} }
@ -494,15 +494,15 @@ impl<'self> PrivacyVisitor<'self> {
match self.tcx.items.find(&id) { match self.tcx.items.find(&id) {
Some(&ast_map::node_item(item, _)) => { Some(&ast_map::node_item(item, _)) => {
let desc = match item.node { let desc = match item.node {
ast::item_mod(*) => "module", ast::item_mod(..) => "module",
ast::item_trait(*) => "trait", ast::item_trait(..) => "trait",
_ => return false, _ => return false,
}; };
let msg = format!("{} `{}` is private", desc, let msg = format!("{} `{}` is private", desc,
token::ident_to_str(&item.ident)); token::ident_to_str(&item.ident));
self.tcx.sess.span_note(span, msg); self.tcx.sess.span_note(span, msg);
} }
Some(*) | None => {} Some(..) | None => {}
} }
} }
Allowable => return true Allowable => return true
@ -516,7 +516,7 @@ impl<'self> PrivacyVisitor<'self> {
match self.def_privacy(variant_info.id) { match self.def_privacy(variant_info.id) {
Allowable => {} Allowable => {}
ExternallyDenied | DisallowedBy(*) => { ExternallyDenied | DisallowedBy(..) => {
self.tcx.sess.span_err(span, "can only dereference enums \ self.tcx.sess.span_err(span, "can only dereference enums \
with a single, public variant"); with a single, public variant");
} }
@ -569,16 +569,16 @@ impl<'self> PrivacyVisitor<'self> {
} }
}; };
match self.tcx.def_map.get_copy(&path_id) { match self.tcx.def_map.get_copy(&path_id) {
ast::DefStaticMethod(*) => ck("static method"), ast::DefStaticMethod(..) => ck("static method"),
ast::DefFn(*) => ck("function"), ast::DefFn(..) => ck("function"),
ast::DefStatic(*) => ck("static"), ast::DefStatic(..) => ck("static"),
ast::DefVariant(*) => ck("variant"), ast::DefVariant(..) => ck("variant"),
ast::DefTy(*) => ck("type"), ast::DefTy(..) => ck("type"),
ast::DefTrait(*) => ck("trait"), ast::DefTrait(..) => ck("trait"),
ast::DefStruct(*) => ck("struct"), ast::DefStruct(..) => ck("struct"),
ast::DefMethod(_, Some(*)) => ck("trait method"), ast::DefMethod(_, Some(..)) => ck("trait method"),
ast::DefMethod(*) => ck("method"), ast::DefMethod(..) => ck("method"),
ast::DefMod(*) => ck("module"), ast::DefMod(..) => ck("module"),
_ => {} _ => {}
} }
} }
@ -592,8 +592,8 @@ impl<'self> PrivacyVisitor<'self> {
} }
// Trait methods are always all public. The only controlling factor // Trait methods are always all public. The only controlling factor
// is whether the trait itself is accessible or not. // is whether the trait itself is accessible or not.
method_param(method_param { trait_id: trait_id, _ }) | method_param(method_param { trait_id: trait_id, .. }) |
method_object(method_object { trait_id: trait_id, _ }) => { method_object(method_object { trait_id: trait_id, .. }) => {
self.ensure_public(span, trait_id, None, "source trait"); 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, _: ()) { fn visit_view_item(&mut self, a: &ast::view_item, _: ()) {
match a.node { match a.node {
ast::view_item_extern_mod(*) => {} ast::view_item_extern_mod(..) => {}
ast::view_item_use(ref uses) => { ast::view_item_use(ref uses) => {
for vpath in uses.iter() { for vpath in uses.iter() {
match vpath.node { match vpath.node {
@ -793,7 +793,7 @@ impl Visitor<()> for SanePrivacyVisitor {
} }
let orig_in_fn = util::replace(&mut self.in_fn, match item.node { 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 _ => self.in_fn, // otherwise we inherit
}); });
visit::walk_item(self, item, ()); visit::walk_item(self, item, ());
@ -842,14 +842,14 @@ impl SanePrivacyVisitor {
ast::named_field(_, ast::private) => { ast::named_field(_, ast::private) => {
// Fields should really be private by default... // Fields should really be private by default...
} }
ast::named_field(*) | ast::unnamed_field => {} ast::named_field(..) | ast::unnamed_field => {}
} }
} }
}; };
match item.node { match item.node {
// implementations of traits don't need visibility qualifiers because // implementations of traits don't need visibility qualifiers because
// that's controlled by having the trait in scope. // 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, check_inherited(item.span, item.vis,
"visibility qualifiers have no effect on trait \ "visibility qualifiers have no effect on trait \
impls"); impls");
@ -896,7 +896,7 @@ impl SanePrivacyVisitor {
match v.node.kind { match v.node.kind {
ast::struct_variant_kind(ref s) => check_struct(s), 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, check_inherited(m.span, m.vis,
"unnecessary visibility"); "unnecessary visibility");
} }
ast::required(*) => {} ast::required(..) => {}
} }
} }
} }
ast::item_static(*) | ast::item_static(..) |
ast::item_fn(*) | ast::item_mod(*) | ast::item_ty(*) | ast::item_fn(..) | ast::item_mod(..) | ast::item_ty(..) |
ast::item_mac(*) => { ast::item_mac(..) => {
check_not_priv(item.span, item.vis, "items are private by \ check_not_priv(item.span, item.vis, "items are private by \
default"); default");
} }
@ -959,7 +959,7 @@ impl SanePrivacyVisitor {
match v.node.kind { match v.node.kind {
ast::struct_variant_kind(ref s) => check_struct(s), 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) => { ast::item_trait(_, _, ref methods) => {
for m in methods.iter() { for m in methods.iter() {
match *m { match *m {
ast::required(*) => {} ast::required(..) => {}
ast::provided(ref m) => check_inherited(m.span, m.vis), ast::provided(ref m) => check_inherited(m.span, m.vis),
} }
} }
} }
ast::item_static(*) | ast::item_static(..) |
ast::item_fn(*) | ast::item_mod(*) | ast::item_ty(*) | ast::item_fn(..) | ast::item_mod(..) | ast::item_ty(..) |
ast::item_mac(*) => {} ast::item_mac(..) => {}
} }
} }
} }

View file

@ -73,7 +73,7 @@ fn method_might_be_inlined(tcx: ty::ctxt, method: &ast::method,
if is_local(impl_src) { if is_local(impl_src) {
match tcx.items.find(&impl_src.node) { match tcx.items.find(&impl_src.node) {
Some(&ast_map::node_item(item, _)) => item_might_be_inlined(item), 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") 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); self.reachable_symbols.insert(def_id.node);
} }
ast::ExprMethodCall(*) => { ast::ExprMethodCall(..) => {
match self.method_map.find(&expr.id) { match self.method_map.find(&expr.id) {
Some(&typeck::method_map_entry { Some(&typeck::method_map_entry {
origin: typeck::method_static(def_id), origin: typeck::method_static(def_id),
_ ..
}) => { }) => {
if ReachableContext:: if ReachableContext::
def_id_represents_local_inlined_item( def_id_represents_local_inlined_item(
@ -191,7 +191,7 @@ impl ReachableContext {
match tcx.items.find(&node_id) { match tcx.items.find(&node_id) {
Some(&ast_map::node_item(item, _)) => { Some(&ast_map::node_item(item, _)) => {
match item.node { match item.node {
ast::item_fn(*) => item_might_be_inlined(item), ast::item_fn(..) => item_might_be_inlined(item),
_ => false, _ => false,
} }
} }
@ -313,10 +313,10 @@ impl ReachableContext {
// These are normal, nothing reachable about these // These are normal, nothing reachable about these
// inherently and their children are already in the // inherently and their children are already in the
// worklist, as determined by the privacy pass // worklist, as determined by the privacy pass
ast::item_static(*) | ast::item_ty(*) | ast::item_static(..) | ast::item_ty(..) |
ast::item_mod(*) | ast::item_foreign_mod(*) | ast::item_mod(..) | ast::item_foreign_mod(..) |
ast::item_impl(*) | ast::item_trait(*) | ast::item_impl(..) | ast::item_trait(..) |
ast::item_struct(*) | ast::item_enum(*) => {} ast::item_struct(..) | ast::item_enum(..) => {}
_ => { _ => {
self.tcx.sess.span_bug(item.span, self.tcx.sess.span_bug(item.span,
@ -327,7 +327,7 @@ impl ReachableContext {
} }
ast_map::node_trait_method(trait_method, _, _) => { ast_map::node_trait_method(trait_method, _, _) => {
match *trait_method { match *trait_method {
ast::required(*) => { ast::required(..) => {
// Keep going, nothing to get exported // Keep going, nothing to get exported
} }
ast::provided(ref method) => { ast::provided(ref method) => {
@ -341,9 +341,9 @@ impl ReachableContext {
} }
} }
// Nothing to recurse on for these // Nothing to recurse on for these
ast_map::node_foreign_item(*) | ast_map::node_foreign_item(..) |
ast_map::node_variant(*) | ast_map::node_variant(..) |
ast_map::node_struct_ctor(*) => {} ast_map::node_struct_ctor(..) => {}
_ => { _ => {
let ident_interner = token::get_ident_interner(); let ident_interner = token::get_ident_interner();
let desc = ast_map::node_id_to_str(self.tcx.items, let desc = ast_map::node_id_to_str(self.tcx.items,

View file

@ -351,7 +351,7 @@ fn resolve_stmt(visitor: &mut RegionResolutionVisitor,
stmt: @ast::Stmt, stmt: @ast::Stmt,
cx: Context) { cx: Context) {
match stmt.node { match stmt.node {
ast::StmtDecl(*) => { ast::StmtDecl(..) => {
visit::walk_stmt(visitor, stmt, cx); visit::walk_stmt(visitor, stmt, cx);
} }
ast::StmtExpr(_, stmt_id) | ast::StmtExpr(_, stmt_id) |
@ -360,7 +360,7 @@ fn resolve_stmt(visitor: &mut RegionResolutionVisitor,
let expr_cx = Context {parent: Some(stmt_id), ..cx}; let expr_cx = Context {parent: Some(stmt_id), ..cx};
visit::walk_stmt(visitor, stmt, expr_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; let mut new_cx = cx;
new_cx.parent = Some(expr.id); new_cx.parent = Some(expr.id);
match expr.node { match expr.node {
ast::ExprAssignOp(*) | ast::ExprIndex(*) | ast::ExprBinary(*) | ast::ExprAssignOp(..) | ast::ExprIndex(..) | ast::ExprBinary(..) |
ast::ExprUnary(*) | ast::ExprCall(*) | ast::ExprMethodCall(*) => { ast::ExprUnary(..) | ast::ExprCall(..) | ast::ExprMethodCall(..) => {
// FIXME(#6268) Nested method calls // FIXME(#6268) Nested method calls
// //
// The lifetimes for a call or method call look as follows: // 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); // parent_to_expr(new_cx, expr.callee_id);
} }
ast::ExprMatch(*) => { ast::ExprMatch(..) => {
new_cx.var_parent = Some(expr.id); 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) // The body of the fn itself is either a root scope (top-level fn)
// or it continues with the inherited scope (closures). // or it continues with the inherited scope (closures).
let body_cx = match *fk { let body_cx = match *fk {
visit::fk_item_fn(*) | visit::fk_item_fn(..) |
visit::fk_method(*) => { visit::fk_method(..) => {
Context {parent: None, var_parent: None, ..cx} Context {parent: None, var_parent: None, ..cx}
} }
visit::fk_anon(*) | visit::fk_anon(..) |
visit::fk_fn_block(*) => { visit::fk_fn_block(..) => {
cx cx
} }
}; };

View file

@ -1149,7 +1149,7 @@ impl Resolver {
let is_public = item.vis == ast::public; let is_public = item.vis == ast::public;
match item.node { match item.node {
item_mod(*) => { item_mod(..) => {
let (name_bindings, new_parent) = let (name_bindings, new_parent) =
self.add_child(ident, parent, ForbidDuplicateModules, sp); self.add_child(ident, parent, ForbidDuplicateModules, sp);
@ -1165,7 +1165,7 @@ impl Resolver {
ModuleReducedGraphParent(name_bindings.get_module()) ModuleReducedGraphParent(name_bindings.get_module())
} }
item_foreign_mod(*) => parent, item_foreign_mod(..) => parent,
// These items live in the value namespace. // These items live in the value namespace.
item_static(_, m, _) => { item_static(_, m, _) => {
@ -1187,7 +1187,7 @@ impl Resolver {
} }
// These items live in the type namespace. // These items live in the type namespace.
item_ty(*) => { item_ty(..) => {
let (name_bindings, _) = let (name_bindings, _) =
self.add_child(ident, parent, ForbidDuplicateTypes, sp); self.add_child(ident, parent, ForbidDuplicateTypes, sp);
@ -1253,7 +1253,7 @@ impl Resolver {
match ty { match ty {
&Ty { &Ty {
node: ty_path(ref path, _, _), node: ty_path(ref path, _, _),
_ ..
} if path.segments.len() == 1 => { } if path.segments.len() == 1 => {
let name = path_to_ident(path); let name = path_to_ident(path);
@ -1395,7 +1395,7 @@ impl Resolver {
new_parent new_parent
} }
item_mac(*) => { item_mac(..) => {
fail!("item macros unimplemented") fail!("item macros unimplemented")
} }
} }
@ -1622,7 +1622,7 @@ impl Resolver {
DefMod(def_id) | DefForeignMod(def_id) | DefStruct(def_id) | DefMod(def_id) | DefForeignMod(def_id) | DefStruct(def_id) |
DefTy(def_id) => { DefTy(def_id) => {
match child_name_bindings.type_def { 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) \ debug!("(building reduced graph for external crate) \
already created module"); already created module");
module_def.def_id = Some(def_id); module_def.def_id = Some(def_id);
@ -1662,7 +1662,7 @@ impl Resolver {
child_name_bindings.define_value(def, dummy_sp(), is_public); child_name_bindings.define_value(def, dummy_sp(), is_public);
} }
} }
DefFn(*) | DefStaticMethod(*) | DefStatic(*) => { DefFn(..) | DefStaticMethod(..) | DefStatic(..) => {
debug!("(building reduced graph for external \ debug!("(building reduced graph for external \
crate) building value (fn/static) {}", final_ident); crate) building value (fn/static) {}", final_ident);
child_name_bindings.define_value(def, dummy_sp(), is_public); child_name_bindings.define_value(def, dummy_sp(), is_public);
@ -1732,15 +1732,15 @@ impl Resolver {
} }
self.structs.insert(def_id); self.structs.insert(def_id);
} }
DefMethod(*) => { DefMethod(..) => {
debug!("(building reduced graph for external crate) \ debug!("(building reduced graph for external crate) \
ignoring {:?}", def); ignoring {:?}", def);
// Ignored; handled elsewhere. // Ignored; handled elsewhere.
} }
DefSelf(*) | DefArg(*) | DefLocal(*) | DefSelf(..) | DefArg(..) | DefLocal(..) |
DefPrimTy(*) | DefTyParam(*) | DefBinding(*) | DefPrimTy(..) | DefTyParam(..) | DefBinding(..) |
DefUse(*) | DefUpvar(*) | DefRegion(*) | DefUse(..) | DefUpvar(..) | DefRegion(..) |
DefTyParamBinder(*) | DefLabel(*) | DefSelfTy(*) => { DefTyParamBinder(..) | DefLabel(..) | DefSelfTy(..) => {
fail!("didn't expect `{:?}`", def); fail!("didn't expect `{:?}`", def);
} }
} }
@ -1817,7 +1817,7 @@ impl Resolver {
match child_name_bindings.type_def { match child_name_bindings.type_def {
Some(TypeNsDef { Some(TypeNsDef {
module_def: Some(module_def), module_def: Some(module_def),
_ ..
}) => { }) => {
// We already have a module. This // We already have a module. This
// is OK. // is OK.
@ -2211,7 +2211,7 @@ impl Resolver {
assert!(module_.glob_count >= 1); assert!(module_.glob_count >= 1);
module_.glob_count -= 1; module_.glob_count -= 1;
} }
SingleImport(*) => { SingleImport(..) => {
// Ignore. // Ignore.
} }
} }
@ -2278,7 +2278,7 @@ impl Resolver {
// search imports as well. // search imports as well.
let mut used_reexport = false; let mut used_reexport = false;
match (value_result, type_result) { match (value_result, type_result) {
(BoundResult(*), BoundResult(*)) => {} // Continue. (BoundResult(..), BoundResult(..)) => {} // Continue.
_ => { _ => {
// If there is an unresolved glob at this point in the // If there is an unresolved glob at this point in the
// containing module, bail out. We don't know enough to be // containing module, bail out. We don't know enough to be
@ -2365,7 +2365,7 @@ impl Resolver {
// external modules. // external modules.
let mut used_public = false; let mut used_public = false;
match type_result { match type_result {
BoundResult(*) => {} BoundResult(..) => {}
_ => { _ => {
match containing_module.external_module_children match containing_module.external_module_children
.find(&source.name) { .find(&source.name) {
@ -3386,16 +3386,16 @@ impl Resolver {
let is_ty_param; let is_ty_param;
match def_like { match def_like {
DlDef(d @ DefLocal(*)) | DlDef(d @ DefUpvar(*)) | DlDef(d @ DefLocal(..)) | DlDef(d @ DefUpvar(..)) |
DlDef(d @ DefArg(*)) | DlDef(d @ DefBinding(*)) => { DlDef(d @ DefArg(..)) | DlDef(d @ DefBinding(..)) => {
def = d; def = d;
is_ty_param = false; is_ty_param = false;
} }
DlDef(d @ DefTyParam(*)) => { DlDef(d @ DefTyParam(..)) => {
def = d; def = d;
is_ty_param = true; is_ty_param = true;
} }
DlDef(d @ DefSelf(*)) DlDef(d @ DefSelf(..))
if allow_capturing_self == DontAllowCapturingSelf => { if allow_capturing_self == DontAllowCapturingSelf => {
def = d; def = d;
is_ty_param = false; is_ty_param = false;
@ -3666,7 +3666,7 @@ impl Resolver {
*foreign_item, *foreign_item,
())); ()));
} }
foreign_item_static(*) => { foreign_item_static(..) => {
visit::walk_foreign_item(this, visit::walk_foreign_item(this,
*foreign_item, *foreign_item,
()); ());
@ -3688,13 +3688,13 @@ impl Resolver {
NoSelfBinding); NoSelfBinding);
} }
item_static(*) => { item_static(..) => {
self.with_constant_rib(|this| { self.with_constant_rib(|this| {
visit::walk_item(this, item, ()); visit::walk_item(this, item, ());
}); });
} }
item_mac(*) => { item_mac(..) => {
fail!("item macros unimplemented") fail!("item macros unimplemented")
} }
} }
@ -3734,7 +3734,7 @@ impl Resolver {
f(self); f(self);
match type_parameters { match type_parameters {
HasTypeParameters(*) => { HasTypeParameters(..) => {
self.type_ribs.pop(); self.type_ribs.pop();
} }
@ -4282,7 +4282,7 @@ impl Resolver {
"an enum variant"); "an enum variant");
self.record_def(pattern.id, (def, lp)); self.record_def(pattern.id, (def, lp));
} }
FoundStructOrEnumVariant(*) => { FoundStructOrEnumVariant(..) => {
self.resolve_error(pattern.span, self.resolve_error(pattern.span,
format!("declaration of `{}` \ format!("declaration of `{}` \
shadows an enum \ shadows an enum \
@ -4301,7 +4301,7 @@ impl Resolver {
"a constant"); "a constant");
self.record_def(pattern.id, (def, lp)); self.record_def(pattern.id, (def, lp));
} }
FoundConst(*) => { FoundConst(..) => {
self.resolve_error(pattern.span, self.resolve_error(pattern.span,
"only irrefutable patterns \ "only irrefutable patterns \
allowed here"); allowed here");
@ -4384,11 +4384,11 @@ impl Resolver {
PatIdent(binding_mode, ref path, _) => { PatIdent(binding_mode, ref path, _) => {
// This must be an enum variant, struct, or constant. // This must be an enum variant, struct, or constant.
match self.resolve_path(pat_id, path, ValueNS, false) { match self.resolve_path(pat_id, path, ValueNS, false) {
Some(def @ (DefVariant(*), _)) | Some(def @ (DefVariant(..), _)) |
Some(def @ (DefStruct(*), _)) => { Some(def @ (DefStruct(..), _)) => {
self.record_def(pattern.id, def); self.record_def(pattern.id, def);
} }
Some(def @ (DefStatic(*), _)) => { Some(def @ (DefStatic(..), _)) => {
self.enforce_default_binding_mode( self.enforce_default_binding_mode(
pattern, pattern,
binding_mode, binding_mode,
@ -4419,10 +4419,10 @@ impl Resolver {
PatEnum(ref path, _) => { PatEnum(ref path, _) => {
// This must be an enum variant, struct or const. // This must be an enum variant, struct or const.
match self.resolve_path(pat_id, path, ValueNS, false) { match self.resolve_path(pat_id, path, ValueNS, false) {
Some(def @ (DefFn(*), _)) | Some(def @ (DefFn(..), _)) |
Some(def @ (DefVariant(*), _)) | Some(def @ (DefVariant(..), _)) |
Some(def @ (DefStruct(*), _)) | Some(def @ (DefStruct(..), _)) |
Some(def @ (DefStatic(*), _)) => { Some(def @ (DefStatic(..), _)) => {
self.record_def(pattern.id, def); self.record_def(pattern.id, def);
} }
Some(_) => { Some(_) => {
@ -4516,7 +4516,7 @@ impl Resolver {
// considered as not having a private component because // considered as not having a private component because
// the lookup happened only within the current module. // the lookup happened only within the current module.
match def.def { match def.def {
def @ DefVariant(*) | def @ DefStruct(*) => { def @ DefVariant(..) | def @ DefStruct(..) => {
return FoundStructOrEnumVariant(def, AllPublic); return FoundStructOrEnumVariant(def, AllPublic);
} }
def @ DefStatic(_, false) => { def @ DefStatic(_, false) => {
@ -4655,7 +4655,7 @@ impl Resolver {
None => {} None => {}
} }
} }
Some(*) | None => {} // Continue. Some(..) | None => {} // Continue.
} }
// Finally, search through external children. // Finally, search through external children.
@ -4975,7 +4975,7 @@ impl Resolver {
// First-class methods are not supported yet; error // First-class methods are not supported yet; error
// out here. // out here.
match def { match def {
(DefMethod(*), _) => { (DefMethod(..), _) => {
self.resolve_error(expr.span, self.resolve_error(expr.span,
"first-class methods \ "first-class methods \
are not supported"); 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)) => { ExprBreak(Some(label)) | ExprAgain(Some(label)) => {
match self.search_ribs(self.label_ribs, label, expr.span, match self.search_ribs(self.label_ribs, label, expr.span,
@ -5192,7 +5192,7 @@ impl Resolver {
let i = self.lang_items.not_trait(); let i = self.lang_items.not_trait();
self.add_fixed_trait_for_expr(expr.id, i); self.add_fixed_trait_for_expr(expr.id, i);
} }
ExprIndex(*) => { ExprIndex(..) => {
let i = self.lang_items.index_trait(); let i = self.lang_items.index_trait();
self.add_fixed_trait_for_expr(expr.id, i); self.add_fixed_trait_for_expr(expr.id, i);
} }
@ -5345,7 +5345,7 @@ impl Resolver {
descr: &str) { descr: &str) {
match pat_binding_mode { match pat_binding_mode {
BindByValue(_) => {} BindByValue(_) => {}
BindByRef(*) => { BindByRef(..) => {
self.resolve_error( self.resolve_error(
pat.span, pat.span,
format!("cannot use `ref` binding mode with {}", format!("cannot use `ref` binding mode with {}",
@ -5375,7 +5375,7 @@ impl Resolver {
if vi.span == dummy_sp() { return } if vi.span == dummy_sp() { return }
match vi.node { match vi.node {
view_item_extern_mod(*) => {} // ignore view_item_extern_mod(..) => {} // ignore
view_item_use(ref path) => { view_item_use(ref path) => {
for p in path.iter() { for p in path.iter() {
match p.node { match p.node {
@ -5486,7 +5486,7 @@ pub fn resolve_crate(session: Session,
let mut resolver = Resolver(session, lang_items, crate.span); let mut resolver = Resolver(session, lang_items, crate.span);
resolver.resolve(crate); resolver.resolve(crate);
let Resolver { def_map, export_map2, trait_map, last_private, let Resolver { def_map, export_map2, trait_map, last_private,
external_exports, _ } = resolver; external_exports, .. } = resolver;
CrateMap { CrateMap {
def_map: def_map, def_map: def_map,
exp_map2: export_map2, exp_map2: export_map2,

View file

@ -60,11 +60,11 @@ impl<'self> Visitor<&'self ScopeChain<'self>> for LifetimeContext {
item: @ast::item, item: @ast::item,
_: &'self ScopeChain<'self>) { _: &'self ScopeChain<'self>) {
let scope = match item.node { let scope = match item.node {
ast::item_fn(*) | // fn lifetimes get added in visit_fn below ast::item_fn(..) | // fn lifetimes get added in visit_fn below
ast::item_mod(*) | ast::item_mod(..) |
ast::item_mac(*) | ast::item_mac(..) |
ast::item_foreign_mod(*) | ast::item_foreign_mod(..) |
ast::item_static(*) => { ast::item_static(..) => {
RootScope RootScope
} }
ast::item_ty(_, ref generics) | 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); visit::walk_fn(self, fk, fd, b, s, n, &scope1);
debug!("popping fn scope id={} due to item/method", n); 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); 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, ty: &ast::Ty,
scope: &'self ScopeChain<'self>) { scope: &'self ScopeChain<'self>) {
match ty.node { match ty.node {
ast::ty_closure(@ast::TyClosure { lifetimes: ref lifetimes, _ }) | ast::ty_closure(@ast::TyClosure { lifetimes: ref lifetimes, .. }) |
ast::ty_bare_fn(@ast::TyBareFn { lifetimes: ref lifetimes, _ }) => { ast::ty_bare_fn(@ast::TyBareFn { lifetimes: ref lifetimes, .. }) => {
let scope1 = FnScope(ty.id, lifetimes, scope); let scope1 = FnScope(ty.id, lifetimes, scope);
self.check_lifetime_names(lifetimes); self.check_lifetime_names(lifetimes);
debug!("pushing fn scope id={} due to type", ty.id); debug!("pushing fn scope id={} due to type", ty.id);

View file

@ -358,7 +358,7 @@ fn variant_opt(bcx: @mut Block, pat_id: ast::NodeId)
} }
unreachable!(); unreachable!();
} }
ast::DefFn(*) | ast::DefFn(..) |
ast::DefStruct(_) => { ast::DefStruct(_) => {
return lit(UnitLikeStructLit(pat_id)); return lit(UnitLikeStructLit(pat_id));
} }
@ -618,7 +618,7 @@ fn enter_opt<'r>(bcx: @mut Block,
let mut i = 0; let mut i = 0;
enter_match(bcx, tcx.def_map, m, col, val, |p| { enter_match(bcx, tcx.def_map, m, col, val, |p| {
let answer = match p.node { let answer = match p.node {
ast::PatEnum(*) | ast::PatEnum(..) |
ast::PatIdent(_, _, None) if pat_is_const(tcx.def_map, p) => { ast::PatIdent(_, _, None) if pat_is_const(tcx.def_map, p) => {
let const_def = tcx.def_map.get_copy(&p.id); let const_def = tcx.def_map.get_copy(&p.id);
let const_def_id = ast_util::def_id_of_def(const_def); 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 // submatch. Thus, including a default match would
// cause the default match to fire spuriously. // cause the default match to fire spuriously.
match *opt { match *opt {
vec_len(*) => None, vec_len(..) => None,
_ => Some(vec::from_elem(variant_size, dummy)) _ => 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) => { ast::PatLit(l) => {
add_to_set(ccx.tcx, &mut found, lit(ExprLit(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 // This is one of: an enum variant, a unit-like struct, or a
// variable binding. // variable binding.
match ccx.tcx.def_map.find(&cur.id) { match ccx.tcx.def_map.find(&cur.id) {
Some(&ast::DefVariant(*)) => { Some(&ast::DefVariant(..)) => {
add_to_set(ccx.tcx, &mut found, add_to_set(ccx.tcx, &mut found,
variant_opt(bcx, cur.id)); variant_opt(bcx, cur.id));
} }
Some(&ast::DefStruct(*)) => { Some(&ast::DefStruct(..)) => {
add_to_set(ccx.tcx, &mut found, add_to_set(ccx.tcx, &mut found,
lit(UnitLikeStructLit(cur.id))); 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 // This could be one of: a tuple-like enum variant, a
// struct-like enum variant, or a struct. // struct-like enum variant, or a struct.
match ccx.tcx.def_map.find(&cur.id) { match ccx.tcx.def_map.find(&cur.id) {
Some(&ast::DefFn(*)) | Some(&ast::DefFn(..)) |
Some(&ast::DefVariant(*)) => { Some(&ast::DefVariant(..)) => {
add_to_set(ccx.tcx, &mut found, add_to_set(ccx.tcx, &mut found,
variant_opt(bcx, cur.id)); variant_opt(bcx, cur.id));
} }
@ -1078,7 +1078,7 @@ fn collect_record_or_struct_fields(bcx: @mut Block,
match br.pats[col].node { match br.pats[col].node {
ast::PatStruct(_, ref fs, _) => { ast::PatStruct(_, ref fs, _) => {
match ty::get(node_id_type(bcx, br.pats[col].id)).sty { match ty::get(node_id_type(bcx, br.pats[col].id)).sty {
ty::ty_struct(*) => { ty::ty_struct(..) => {
extend(&mut fields, *fs); extend(&mut fields, *fs);
found = true; found = true;
} }
@ -1168,8 +1168,8 @@ fn any_tuple_struct_pat(bcx: @mut Block, m: &[Match], col: uint) -> bool {
match pat.node { match pat.node {
ast::PatEnum(_, Some(_)) => { ast::PatEnum(_, Some(_)) => {
match bcx.tcx().def_map.find(&pat.id) { match bcx.tcx().def_map.find(&pat.id) {
Some(&ast::DefFn(*)) | Some(&ast::DefFn(..)) |
Some(&ast::DefStruct(*)) => true, Some(&ast::DefStruct(..)) => true,
_ => false _ => false
} }
} }
@ -1599,7 +1599,7 @@ fn compile_submatch_continue(mut bcx: @mut Block,
let pat_ty = node_id_type(bcx, pat_id); let pat_ty = node_id_type(bcx, pat_id);
let llbox = Load(bcx, val); let llbox = Load(bcx, val);
let unboxed = match ty::get(pat_ty).sty { 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]) _ => GEPi(bcx, llbox, [0u, abi::box_field_body])
}; };
compile_submatch(bcx, enter_uniq(bcx, dm, m, col, val), 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); test_val = Load(bcx, val);
kind = compare; kind = compare;
}, },
vec_len(*) => { vec_len(..) => {
let vt = tvec::vec_types(bcx, node_id_type(bcx, pat_id)); let vt = tvec::vec_types(bcx, node_id_type(bcx, pat_id));
let unboxed = load_if_immediate(bcx, val, vt.vec_ty); let unboxed = load_if_immediate(bcx, val, vt.vec_ty);
let (_, len) = tvec::get_base_and_len(bcx, unboxed, 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) t, ast::BiGe)
} }
range_result( range_result(
Result {val: vbegin, _}, Result {val: vbegin, ..},
Result {bcx, val: vend}) => { Result {bcx, val: vend}) => {
let Result {bcx, val: llge} = let Result {bcx, val: llge} =
compare_scalar_types( compare_scalar_types(
@ -1748,7 +1748,7 @@ fn compile_submatch_continue(mut bcx: @mut Block,
rslt(bcx, value) rslt(bcx, value)
} }
range_result( range_result(
Result {val: vbegin, _}, Result {val: vbegin, ..},
Result {bcx, val: vend}) => { Result {bcx, val: vend}) => {
let llge = let llge =
compare_scalar_values( compare_scalar_values(
@ -2172,8 +2172,8 @@ fn bind_irrefutable_pat(bcx: @mut Block,
} }
} }
} }
Some(&ast::DefFn(*)) | Some(&ast::DefFn(..)) |
Some(&ast::DefStruct(*)) => { Some(&ast::DefStruct(..)) => {
match *sub_pats { match *sub_pats {
None => { None => {
// This is a unit-like struct. Nothing to do here. // 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 pat_ty = node_id_type(bcx, pat.id);
let llbox = Load(bcx, val); let llbox = Load(bcx, val);
let unboxed = match ty::get(pat_ty).sty { 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]) _ => GEPi(bcx, llbox, [0u, abi::box_field_body])
}; };
bcx = bind_irrefutable_pat(bcx, inner, unboxed, binding_mode); 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); let loaded_val = Load(bcx, val);
bcx = bind_irrefutable_pat(bcx, inner, loaded_val, binding_mode); bcx = bind_irrefutable_pat(bcx, inner, loaded_val, binding_mode);
} }
ast::PatVec(*) => { ast::PatVec(..) => {
bcx.tcx().sess.span_bug( bcx.tcx().sess.span_bug(
pat.span, pat.span,
format!("vector patterns are never irrefutable!")); format!("vector patterns are never irrefutable!"));

View file

@ -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] } struct Case { discr: Disr, tys: ~[ty::t] }
impl Case { impl Case {
fn is_zerolen(&self, cx: &mut CrateContext) -> bool { 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) { pub fn finish_type_of(cx: &mut CrateContext, r: &Repr, llty: &mut Type) {
match *r { match *r {
CEnum(*) | General(*) => { } CEnum(..) | General(..) => { }
Univariant(ref st, _) | NullablePointer{ nonnull: ref st, _ } => Univariant(ref st, _) | NullablePointer{ nonnull: ref st, .. } =>
llty.set_struct_body(struct_llfields(cx, st, false), st.packed) 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 { fn generic_type_of(cx: &mut CrateContext, r: &Repr, name: Option<&str>, sizing: bool) -> Type {
match *r { match *r {
CEnum(ity, _, _) => ll_inttype(cx, ity), CEnum(ity, _, _) => ll_inttype(cx, ity),
Univariant(ref st, _) | NullablePointer{ nonnull: ref st, _ } => { Univariant(ref st, _) | NullablePointer{ nonnull: ref st, .. } => {
match name { match name {
None => Type::struct_(struct_llfields(cx, st, sizing), st.packed), None => Type::struct_(struct_llfields(cx, st, sizing), st.packed),
Some(name) => { assert_eq!(sizing, false); Type::named_struct(name) } 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) pub fn trans_switch(bcx: @mut Block, r: &Repr, scrutinee: ValueRef)
-> (_match::branch_kind, Option<ValueRef>) { -> (_match::branch_kind, Option<ValueRef>) {
match *r { match *r {
CEnum(*) | General(*) => { CEnum(..) | General(..) => {
(_match::switch, Some(trans_get_discr(bcx, r, scrutinee, None))) (_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))) (_match::switch, Some(nullable_bitdiscr(bcx, nonnull, nndiscr, ptrfield, scrutinee)))
} }
Univariant(*) => { Univariant(..) => {
(_match::single, None) (_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); val = load_discr(bcx, ity, ptr, 0, (cases.len() - 1) as Disr);
signed = ity.is_signed(); signed = ity.is_signed();
} }
Univariant(*) => { Univariant(..) => {
val = C_u8(0); val = C_u8(0);
signed = false; signed = false;
} }
NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => {
val = nullable_bitdiscr(bcx, nonnull, nndiscr, ptrfield, scrutinee); val = nullable_bitdiscr(bcx, nonnull, nndiscr, ptrfield, scrutinee);
signed = false; 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), _match::single_result(rslt(bcx, C_integral(ll_inttype(bcx.ccx(), ity),
discr as u64, true))) discr as u64, true)))
} }
Univariant(*) => { Univariant(..) => {
bcx.ccx().sess.bug("no cases for univariants or structs") bcx.ccx().sess.bug("no cases for univariants or structs")
} }
NullablePointer{ _ } => { NullablePointer{ .. } => {
assert!(discr == 0 || discr == 1); assert!(discr == 0 || discr == 1);
_match::single_result(rslt(bcx, C_i1(discr != 0))) _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), Store(bcx, C_bool(true),
GEPi(bcx, val, [0, st.fields.len() - 1])) GEPi(bcx, val, [0, st.fields.len() - 1]))
} }
Univariant(*) => { Univariant(..) => {
assert_eq!(discr, 0); assert_eq!(discr, 0);
} }
NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => {
if discr != nndiscr { if discr != nndiscr {
let llptrptr = GEPi(bcx, val, [0, ptrfield]); let llptrptr = GEPi(bcx, val, [0, ptrfield]);
let llptrty = type_of::type_of(bcx.ccx(), nonnull.fields[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 { pub fn num_args(r: &Repr, discr: Disr) -> uint {
match *r { match *r {
CEnum(*) => 0, CEnum(..) => 0,
Univariant(ref st, dtor) => { Univariant(ref st, dtor) => {
assert_eq!(discr, 0); assert_eq!(discr, 0);
st.fields.len() - (if dtor { 1 } else { 0 }) st.fields.len() - (if dtor { 1 } else { 0 })
} }
General(_, ref cases) => cases[discr].fields.len() - 1, 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() } 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 // decide to do some kind of cdr-coding-like non-unique repr
// someday), it will need to return a possibly-new bcx as well. // someday), it will need to return a possibly-new bcx as well.
match *r { match *r {
CEnum(*) => { CEnum(..) => {
bcx.ccx().sess.bug("element access in C-like enum") bcx.ccx().sess.bug("element access in C-like enum")
} }
Univariant(ref st, _dtor) => { 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) => { General(_, ref cases) => {
struct_field_ptr(bcx, &cases[discr], val, ix + 1, true) 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) { if (discr == nndiscr) {
struct_field_ptr(bcx, nonnull, val, ix, false) struct_field_ptr(bcx, nonnull, val, ix, false)
} else { } else {
@ -718,7 +720,7 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: Disr,
let contents = build_const_struct(ccx, st, vals); let contents = build_const_struct(ccx, st, vals);
C_struct(contents, st.packed) C_struct(contents, st.packed)
} }
NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, _ } => { NullablePointer{ nonnull: ref nonnull, nndiscr, ptrfield, .. } => {
if discr == nndiscr { if discr == nndiscr {
C_struct(build_const_struct(ccx, nonnull, vals), false) C_struct(build_const_struct(ccx, nonnull, vals), false)
} else { } else {
@ -789,18 +791,18 @@ pub fn const_get_discrim(ccx: &mut CrateContext, r: &Repr, val: ValueRef)
match *r { match *r {
CEnum(ity, _, _) => { CEnum(ity, _, _) => {
match ity { match ity {
attr::SignedInt(*) => const_to_int(val) as Disr, attr::SignedInt(..) => const_to_int(val) as Disr,
attr::UnsignedInt(*) => const_to_uint(val) as Disr attr::UnsignedInt(..) => const_to_uint(val) as Disr
} }
} }
General(ity, _) => { General(ity, _) => {
match ity { match ity {
attr::SignedInt(*) => const_to_int(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 attr::UnsignedInt(..) => const_to_uint(const_get_elt(ccx, val, [0])) as Disr
} }
} }
Univariant(*) => 0, Univariant(..) => 0,
NullablePointer{ nndiscr, ptrfield, _ } => { NullablePointer{ nndiscr, ptrfield, .. } => {
if is_null(const_struct_field(ccx, val, ptrfield)) { if is_null(const_struct_field(ccx, val, ptrfield)) {
/* subtraction as uint is ok because nndiscr is either 0 or 1 */ /* subtraction as uint is ok because nndiscr is either 0 or 1 */
(1 - nndiscr) as Disr (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, pub fn const_get_field(ccx: &mut CrateContext, r: &Repr, val: ValueRef,
_discr: Disr, ix: uint) -> ValueRef { _discr: Disr, ix: uint) -> ValueRef {
match *r { match *r {
CEnum(*) => ccx.sess.bug("element access in C-like enum const"), CEnum(..) => ccx.sess.bug("element access in C-like enum const"),
Univariant(*) => const_struct_field(ccx, val, ix), Univariant(..) => const_struct_field(ccx, val, ix),
General(*) => const_struct_field(ccx, val, ix + 1), General(..) => const_struct_field(ccx, val, ix + 1),
NullablePointer{ _ } => const_struct_field(ccx, val, ix) NullablePointer{ .. } => const_struct_field(ccx, val, ix)
} }
} }

View file

@ -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 // `~` pointer return values never alias because ownership is transferred
ty::ty_uniq(*) | ty::ty_uniq(..) |
ty::ty_evec(_, ty::vstore_uniq) => { ty::ty_evec(_, ty::vstore_uniq) => {
unsafe { unsafe {
llvm::LLVMAddReturnAttribute(llfn, lib::llvm::NoAliasAttribute as c_uint); 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) }; let llarg = unsafe { llvm::LLVMGetParam(llfn, (offset + i) as c_uint) };
match ty::get(arg_ty).sty { match ty::get(arg_ty).sty {
// `~` pointer parameters never alias because ownership is transferred // `~` pointer parameters never alias because ownership is transferred
ty::ty_uniq(*) | ty::ty_uniq(..) |
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, _}) => { ty::ty_closure(ty::ClosureTy {sigil: ast::OwnedSigil, ..}) => {
unsafe { unsafe {
llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint); 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; let mut cx = cx;
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_struct(*) => { ty::ty_struct(..) => {
let repr = adt::represent_type(cx.ccx(), t); let repr = adt::represent_type(cx.ccx(), t);
expr::with_field_tys(cx.tcx(), t, None, |discr, field_tys| { expr::with_field_tys(cx.tcx(), t, None, |discr, field_tys| {
for (i, field_ty) in field_tys.iter().enumerate() { 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) => { Some(Rust) | Some(RustIntrinsic) => {
get_extern_rust_fn(ccx, fn_ty.sig.inputs, fn_ty.sig.output, name, did) 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 c = foreign::llvm_calling_convention(ccx, fn_ty.abis);
let cconv = c.unwrap_or(lib::llvm::CCallConv); let cconv = c.unwrap_or(lib::llvm::CCallConv);
let llty = type_of_fn_from_ty(ccx, t); 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 { cur_scope = match cur_scope {
Some(inf) => { Some(inf) => {
match inf.node_info { match inf.node_info {
Some(NodeInfo { id, _ }) if id == scope_id => { Some(NodeInfo { id, .. }) if id == scope_id => {
return bcx_sid return bcx_sid
} }
// FIXME(#6268, #6248) hacky cleanup for nested method calls // 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 return bcx_sid
} }
_ => inf.parent _ => 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::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; return bcx;
@ -2261,7 +2261,7 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
trans_struct_def(ccx, struct_def); trans_struct_def(ccx, struct_def);
} }
} }
ast::item_trait(*) => { ast::item_trait(..) => {
// Inside of this trait definition, we won't be actually translating any // Inside of this trait definition, we won't be actually translating any
// functions, but the trait still needs to be walked. Otherwise default // functions, but the trait still needs to be walked. Otherwise default
// methods with items will not get translated and will cause ICE's when // 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; foreign = true;
match ni.node { match ni.node {
ast::foreign_item_fn(*) => { ast::foreign_item_fn(..) => {
let path = vec::append((*pth).clone(), [path_name(ni.ident)]); let path = vec::append((*pth).clone(), [path_name(ni.ident)]);
foreign::register_foreign_item_fn(ccx, abis, &path, ni) 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 // Treat the crate map static specially in order to
// a weak-linkage-like functionality where it's // a weak-linkage-like functionality where it's
// dynamically resolved at runtime. If we're // dynamically resolved at runtime. If we're
@ -3157,7 +3157,7 @@ pub fn trans_crate(sess: session::Session,
decl_gc_metadata(ccx, llmod_id); decl_gc_metadata(ccx, llmod_id);
fill_crate_map(ccx, ccx.crate_map); 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 // 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 // linkage but that ends up causing the linker to look for a
// __rust_crate_map_toplevel symbol (extra underscore) which it will // __rust_crate_map_toplevel symbol (extra underscore) which it will

View file

@ -95,11 +95,11 @@ pub fn trans(bcx: @mut Block, expr: &ast::Expr) -> Callee {
fn datum_callee(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); let DatumBlock {bcx, datum} = expr::trans_to_datum(bcx, expr);
match ty::get(datum.ty).sty { match ty::get(datum.ty).sty {
ty::ty_bare_fn(*) => { ty::ty_bare_fn(..) => {
let llval = datum.to_appropriate_llval(bcx); let llval = datum.to_appropriate_llval(bcx);
return Callee {bcx: bcx, data: Fn(FnData {llfn: llval})}; return Callee {bcx: bcx, data: Fn(FnData {llfn: llval})};
} }
ty::ty_closure(*) => { ty::ty_closure(..) => {
return Callee {bcx: bcx, data: Closure(datum)}; 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) => { ast::DefStruct(def_id) => {
fn_callee(bcx, trans_fn_ref(bcx, def_id, ref_expr.id)) fn_callee(bcx, trans_fn_ref(bcx, def_id, ref_expr.id))
} }
ast::DefStatic(*) | ast::DefStatic(..) |
ast::DefArg(*) | ast::DefArg(..) |
ast::DefLocal(*) | ast::DefLocal(..) |
ast::DefBinding(*) | ast::DefBinding(..) |
ast::DefUpvar(*) | ast::DefUpvar(..) |
ast::DefSelf(*) => { ast::DefSelf(..) => {
datum_callee(bcx, ref_expr) datum_callee(bcx, ref_expr)
} }
ast::DefMod(*) | ast::DefForeignMod(*) | ast::DefTrait(*) | ast::DefMod(..) | ast::DefForeignMod(..) | ast::DefTrait(..) |
ast::DefTy(*) | ast::DefPrimTy(*) | ast::DefTy(..) | ast::DefPrimTy(..) |
ast::DefUse(*) | ast::DefTyParamBinder(*) | ast::DefUse(..) | ast::DefTyParamBinder(..) |
ast::DefRegion(*) | ast::DefLabel(*) | ast::DefTyParam(*) | ast::DefRegion(..) | ast::DefLabel(..) | ast::DefTyParam(..) |
ast::DefSelfTy(*) | ast::DefMethod(*) => { ast::DefSelfTy(..) | ast::DefMethod(..) => {
bcx.tcx().sess.span_bug( bcx.tcx().sess.span_bug(
ref_expr.span, ref_expr.span,
format!("Cannot translate def {:?} \ 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. // The `noalias` attribute on the return value is useful to a function ptr caller.
match ty::get(ret_ty).sty { match ty::get(ret_ty).sty {
// `~` pointer return values never alias because ownership is transferred // `~` pointer return values never alias because ownership is transferred
ty::ty_uniq(*) | ty::ty_uniq(..) |
ty::ty_evec(_, ty::vstore_uniq) => { ty::ty_evec(_, ty::vstore_uniq) => {
attrs.push((0, NoAliasAttribute)); attrs.push((0, NoAliasAttribute));
} }

View file

@ -71,7 +71,7 @@ pub fn type_is_immediate(ccx: &mut CrateContext, ty: ty::t) -> bool {
} }
match ty::get(ty).sty { match ty::get(ty).sty {
ty::ty_bot => true, 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); let llty = sizing_type_of(ccx, ty);
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type) 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 { cur_scope = match cur_scope {
Some(inf) => match scope_id { Some(inf) => match scope_id {
Some(wanted) => match inf.node_info { 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={})", debug!("in_scope_cx: selected cur={} (cx={})",
cur.to_str(), cx.to_str()); cur.to_str(), cx.to_str());
f(inf); f(inf);
@ -1054,11 +1054,11 @@ pub enum MonoDataClass {
pub fn mono_data_classify(t: ty::t) -> MonoDataClass { pub fn mono_data_classify(t: ty::t) -> MonoDataClass {
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_float(_) => MonoFloat, ty::ty_float(_) => MonoFloat,
ty::ty_rptr(*) | ty::ty_uniq(*) | ty::ty_rptr(..) | ty::ty_uniq(..) |
ty::ty_box(*) | ty::ty_opaque_box(*) | ty::ty_box(..) | ty::ty_opaque_box(..) |
ty::ty_estr(ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) | 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_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? // Is that everything? Would closures or slices qualify?
_ => MonoBits _ => MonoBits
} }

View file

@ -133,10 +133,10 @@ fn const_deref(cx: &mut CrateContext, v: ValueRef, t: ty::t, explicit: bool)
Some(ref mt) => { Some(ref mt) => {
assert!(mt.mutbl != ast::MutMutable); assert!(mt.mutbl != ast::MutMutable);
let dv = match ty::get(t).sty { let dv = match ty::get(t).sty {
ty::ty_ptr(*) | ty::ty_rptr(*) => { ty::ty_ptr(..) | ty::ty_rptr(..) => {
const_deref_ptr(cx, v) const_deref_ptr(cx, v)
} }
ty::ty_enum(*) | ty::ty_struct(*) => { ty::ty_enum(..) | ty::ty_struct(..) => {
const_deref_newtype(cx, v, t) 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) { match cx.tcx.items.get_copy(&def_id.node) {
ast_map::node_item(@ast::item { 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); 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 = llvm::LLVMConstIntGetZExtValue(len) as u64;
let len = match ty::get(bt).sty { let len = match ty::get(bt).sty {
ty::ty_estr(*) => {assert!(len > 0); len - 1}, ty::ty_estr(..) => {assert!(len > 0); len - 1},
_ => len _ => len
}; };
if iv >= len { if iv >= len {
@ -533,7 +533,7 @@ fn const_expr_unadjusted(cx: @mut CrateContext,
match sub.node { match sub.node {
ast::ExprLit(ref lit) => { ast::ExprLit(ref lit) => {
match lit.node { 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") } _ => { cx.sess.span_bug(e.span, "bad const-slice lit") }
} }
} }

View file

@ -238,7 +238,7 @@ pub fn trans_break_cont(bcx: @mut Block,
loop_break: Some(brk), loop_break: Some(brk),
loop_label: l, loop_label: l,
parent, parent,
_ ..
}) => { }) => {
// If we're looking for a labeled loop, check the label... // If we're looking for a labeled loop, check the label...
target = if to_end { target = if to_end {

View file

@ -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"); cx.sess.span_bug(span, "debuginfo::create_captured_var_metadata() - NodeId not found");
} }
Some(ast_map::node_local(ident)) => ident, 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) 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 // Extract the span of the self argument from the method's AST
let fnitem = bcx.ccx().tcx.items.get_copy(&bcx.fcx.id); let fnitem = bcx.ccx().tcx.items.get_copy(&bcx.fcx.id);
let span = match fnitem { 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 explicit_self.span
} }
ast_map::node_trait_method( ast_map::node_trait_method(
@ast::provided( @ast::provided(
@ast::method { @ast::method {
explicit_self: explicit_self, explicit_self: explicit_self,
_ ..
}), }),
_, _,
_) => { _) => {
@ -570,7 +570,7 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
generics: ref generics, generics: ref generics,
body: ref top_level_block, body: ref top_level_block,
span: span, span: span,
_ ..
}, },
_, _,
_) => { _) => {
@ -603,15 +603,15 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
generics: ref generics, generics: ref generics,
body: ref top_level_block, body: ref top_level_block,
span: span, span: span,
_ ..
}), }),
_, _,
_) => { _) => {
(ident, fn_decl, generics, top_level_block, span, true) (ident, fn_decl, generics, top_level_block, span, true)
} }
ast_map::node_foreign_item(@ast::foreign_item { _ }, _, _, _) | ast_map::node_foreign_item(@ast::foreign_item { .. }, _, _, _) |
ast_map::node_variant(*) | ast_map::node_variant(..) |
ast_map::node_struct_ctor(*) => { ast_map::node_struct_ctor(..) => {
return FunctionWithoutDebugInfo; return FunctionWithoutDebugInfo;
} }
_ => cx.sess.bug(format!("create_function_debug_context: \ _ => 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) name_to_append_suffix_to: &mut ~str)
-> DIArray { -> DIArray {
let self_type = match param_substs { 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 _ => None
}; };
@ -798,13 +798,13 @@ pub fn create_function_debug_context(cx: &mut CrateContext,
// Handle other generic parameters // Handle other generic parameters
let actual_types = match param_substs { let actual_types = match param_substs {
Some(@param_substs { tys: ref types, _ }) => types, Some(@param_substs { tys: ref types, .. }) => types,
None => { None => {
return create_DIArray(DIB(cx), template_params); 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]; let actual_type = actual_types[index];
// Add actual type name to <...> clause of function name // Add actual type name to <...> clause of function name
let actual_type_name = ppaux::ty_to_str(cx.tcx, actual_type); 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) default: uint)
-> uint { -> uint {
match *top_level_block { 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 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 span_start(cx, expr.span).line
} }
_ => default _ => default
@ -1171,7 +1171,7 @@ impl RecursiveTypeDescription {
fn metadata(&self) -> DICompositeType { fn metadata(&self) -> DICompositeType {
match *self { match *self {
UnfinishedMetadata { metadata_stub, _ } => metadata_stub, UnfinishedMetadata { metadata_stub, .. } => metadata_stub,
FinalMetadata(metadata) => metadata FinalMetadata(metadata) => metadata
} }
} }
@ -1517,7 +1517,7 @@ fn prepare_enum_metadata(cx: &mut CrateContext,
} as @MemberDescriptionFactory, } as @MemberDescriptionFactory,
} }
} }
adt::NullablePointer { nonnull: ref struct_def, nndiscr, _ } => { adt::NullablePointer { nonnull: ref struct_def, nndiscr, .. } => {
let (metadata_stub, let (metadata_stub,
variant_llvm_type, variant_llvm_type,
member_description_factory) = describe_variant(cx, 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 containing_scope = namespace_for_item(cx, def_id, warning_span).scope;
let definition_span = if def_id.crate == ast::LOCAL_CRATE { let definition_span = if def_id.crate == ast::LOCAL_CRATE {
let definition_span = match cx.tcx.items.find(&def_id.node) { 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 => { ref node => {
cx.sess.span_warn(warning_span, cx.sess.span_warn(warning_span,
format!("debuginfo::get_namespace_and_span_for_item() \ 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::StmtDecl(@ref decl, _) => walk_decl(cx, decl, scope_stack, scope_map),
ast::StmtExpr(@ref exp, _) | ast::StmtExpr(@ref exp, _) |
ast::StmtSemi(@ref exp, _) => walk_expr(cx, exp, scope_stack, scope_map), 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_stack: &mut ~[ScopeStackEntry],
scope_map: &mut HashMap<ast::NodeId, DIScope>) { scope_map: &mut HashMap<ast::NodeId, DIScope>) {
match *decl { 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); scope_map.insert(local.id, scope_stack.last().scope_metadata);
walk_pattern(cx, local.pat, scope_stack, scope_map); 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, _) => { ast::PatStruct(_, ref field_pats, _) => {
scope_map.insert(pat.id, scope_stack.last().scope_metadata); 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); 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::ExprFnBlock(ast::fn_decl { inputs: ref inputs, .. }, ref block) |
ast::ExprProc(ast::fn_decl { inputs: ref inputs, _ }, ref block) => { ast::ExprProc(ast::fn_decl { inputs: ref inputs, .. }, ref block) => {
with_new_scope(cx, with_new_scope(cx,
block.span, block.span,
scope_stack, scope_stack,
scope_map, scope_map,
|cx, 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); 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::expr_loop_body(@ref inner_exp) |
ast::ExprDoBody(@ref inner_exp) => { ast::ExprDoBody(@ref inner_exp) => {
let inner_expr_is_expr_fn_block = match *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 _ => false
}; };
@ -2680,7 +2680,7 @@ fn populate_scope_map(cx: &mut CrateContext,
} }
ast::ExprStruct(_, ref fields, ref base_exp) => { 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); 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, ast::ExprInlineAsm(ast::inline_asm { inputs: ref inputs,
outputs: ref outputs, outputs: ref outputs,
_ }) => { .. }) => {
// inputs, outputs: ~[(@str, @expr)] // inputs, outputs: ~[(@str, @expr)]
for &(_, @ref exp) in inputs.iter() { for &(_, @ref exp) in inputs.iter() {
walk_expr(cx, exp, scope_stack, scope_map); walk_expr(cx, exp, scope_stack, scope_map);

View file

@ -193,7 +193,7 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
}; };
debug!("unadjusted datum: {}", datum.to_str(bcx.ccx())); debug!("unadjusted datum: {}", datum.to_str(bcx.ccx()));
match *adjustment { match *adjustment {
AutoAddEnv(*) => { AutoAddEnv(..) => {
datum = unpack_datum!(bcx, add_env(bcx, expr, datum)); datum = unpack_datum!(bcx, add_env(bcx, expr, datum));
} }
AutoDerefRef(ref adj) => { AutoDerefRef(ref adj) => {
@ -209,24 +209,24 @@ pub fn trans_to_datum(bcx: @mut Block, expr: &ast::Expr) -> DatumBlock {
None => { None => {
datum datum
} }
Some(AutoUnsafe(*)) | // region + unsafe ptrs have same repr Some(AutoUnsafe(..)) | // region + unsafe ptrs have same repr
Some(AutoPtr(*)) => { Some(AutoPtr(..)) => {
unpack_datum!(bcx, auto_ref(bcx, datum)) unpack_datum!(bcx, auto_ref(bcx, datum))
} }
Some(AutoBorrowVec(*)) => { Some(AutoBorrowVec(..)) => {
unpack_datum!(bcx, auto_slice(bcx, adj.autoderefs, unpack_datum!(bcx, auto_slice(bcx, adj.autoderefs,
expr, datum)) expr, datum))
} }
Some(AutoBorrowVecRef(*)) => { Some(AutoBorrowVecRef(..)) => {
unpack_datum!(bcx, auto_slice_and_ref(bcx, adj.autoderefs, unpack_datum!(bcx, auto_slice_and_ref(bcx, adj.autoderefs,
expr, datum)) expr, datum))
} }
Some(AutoBorrowFn(*)) => { Some(AutoBorrowFn(..)) => {
let adjusted_ty = ty::adjust_ty(bcx.tcx(), expr.span, let adjusted_ty = ty::adjust_ty(bcx.tcx(), expr.span,
datum.ty, Some(adjustment)); datum.ty, Some(adjustment));
unpack_datum!(bcx, auto_borrow_fn(bcx, adjusted_ty, datum)) unpack_datum!(bcx, auto_borrow_fn(bcx, adjusted_ty, datum))
} }
Some(AutoBorrowObj(*)) => { Some(AutoBorrowObj(..)) => {
unpack_datum!(bcx, auto_borrow_obj( unpack_datum!(bcx, auto_borrow_obj(
bcx, adj.autoderefs, expr, datum)) 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_ptr = GEPi(bcx, source_llval, [0u, abi::trt_field_box]);
let source_data = Load(bcx, source_data_ptr); // always a ptr let source_data = Load(bcx, source_data_ptr); // always a ptr
let target_data = match source_store { let target_data = match source_store {
ty::BoxTraitStore(*) => { ty::BoxTraitStore(..) => {
// For deref of @T or @mut T, create a dummy datum and // For deref of @T or @mut T, create a dummy datum and
// use the datum's deref method. This is more work // use the datum's deref method. This is more work
// than just calling GEPi ourselves, but it ensures // 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)); autoderefs));
derefd_datum.to_rptr(bcx).to_value_llval(bcx) 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, // For a ~T box, there may or may not be a header,
// depending on whether the type T references managed // depending on whether the type T references managed
// boxes. However, since we do not *know* the type T // 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); Load(bcx, borrow_offset_ptr);
InBoundsGEP(bcx, llopaque, [borrow_offset]) InBoundsGEP(bcx, llopaque, [borrow_offset])
} }
ty::RegionTraitStore(*) => { ty::RegionTraitStore(..) => {
source_data 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(); args.iter().enumerate().map(|(i, arg)| (i, *arg)).collect();
return trans_adt(bcx, repr, 0, numbered_fields, None, dest); 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); return tvec::trans_lit_str(bcx, expr, s, dest);
} }
ast::ExprVstore(contents, ast::ExprVstoreSlice) | ast::ExprVstore(contents, ast::ExprVstoreSlice) |
ast::ExprVstore(contents, ast::ExprVstoreMutSlice) => { ast::ExprVstore(contents, ast::ExprVstoreMutSlice) => {
return tvec::trans_slice_vstore(bcx, expr, contents, dest); 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); return tvec::trans_fixed_vstore(bcx, expr, expr, dest);
} }
ast::ExprFnBlock(ref decl, ref body) | 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); let repr = adt::represent_type(ccx, ty);
adt::trans_start_init(bcx, repr, lldest, 0); 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); let fn_data = callee::trans_fn_ref(bcx, def_id, ref_expr.id);
Store(bcx, fn_data.llfn, lldest); Store(bcx, fn_data.llfn, lldest);
} }
@ -1672,14 +1672,14 @@ pub enum cast_kind {
pub fn cast_type_kind(t: ty::t) -> cast_kind { pub fn cast_type_kind(t: ty::t) -> cast_kind {
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_char => cast_integral, ty::ty_char => cast_integral,
ty::ty_float(*) => cast_float, ty::ty_float(..) => cast_float,
ty::ty_ptr(*) => cast_pointer, ty::ty_ptr(..) => cast_pointer,
ty::ty_rptr(*) => cast_pointer, ty::ty_rptr(..) => cast_pointer,
ty::ty_bare_fn(*) => cast_pointer, ty::ty_bare_fn(..) => cast_pointer,
ty::ty_int(*) => cast_integral, ty::ty_int(..) => cast_integral,
ty::ty_uint(*) => cast_integral, ty::ty_uint(..) => cast_integral,
ty::ty_bool => cast_integral, ty::ty_bool => cast_integral,
ty::ty_enum(*) => cast_enum, ty::ty_enum(..) => cast_enum,
_ => cast_other _ => cast_other
} }
} }

View file

@ -98,7 +98,7 @@ pub fn llvm_calling_convention(ccx: &mut CrateContext,
C => lib::llvm::CCallConv, C => lib::llvm::CCallConv,
Win64 => lib::llvm::X86_64_Win64, 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, Cdecl => lib::llvm::CCallConv,
Aapcs => 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"); let _icx = push_ctxt("foreign::trans_foreign_mod");
for &foreign_item in foreign_mod.items.iter() { for &foreign_item in foreign_mod.items.iter() {
match foreign_item.node { 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) { let (abis, mut path) = match ccx.tcx.items.get_copy(&foreign_item.id) {
ast_map::node_foreign_item(_, abis, _, path) => (abis, (*path).clone()), ast_map::node_foreign_item(_, abis, _, path) => (abis, (*path).clone()),
_ => fail!("Unable to find foreign item in tcx.items table.") _ => fail!("Unable to find foreign item in tcx.items table.")

View file

@ -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 { if field == abi::tydesc_field_take_glue {
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_unboxed_vec(*) | ty::ty_unboxed_vec(..) |
ty::ty_uniq(*) | ty::ty_uniq(..) |
ty::ty_estr(ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) |
ty::ty_evec(_, ty::vstore_uniq) => { return ty::mk_u32(); } 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 { if field == abi::tydesc_field_free_glue {
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_bare_fn(*) | ty::ty_bare_fn(..) |
ty::ty_closure(*) | ty::ty_closure(..) |
ty::ty_box(*) | ty::ty_box(..) |
ty::ty_opaque_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_uniq) | ty::ty_estr(ty::vstore_uniq) |
ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) | 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(); } _ => { return ty::mk_u32(); }
} }
} }
@ -373,7 +373,7 @@ pub fn make_free_glue(bcx: @mut Block, v: ValueRef, t: ty::t) -> @mut Block {
None); None);
trans_free(bcx, v) trans_free(bcx, v)
} }
ty::ty_uniq(*) => { ty::ty_uniq(..) => {
uniq::make_free_glue(bcx, v, t) uniq::make_free_glue(bcx, v, t)
} }
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) | 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 { let has_header = match ty::get(t).sty {
ty::ty_box(*) => true, ty::ty_box(..) => true,
ty::ty_uniq(*) => ty::type_contents(ccx.tcx, t).owns_managed(), ty::ty_uniq(..) => ty::type_contents(ccx.tcx, t).owns_managed(),
_ => false _ => false
}; };

View file

@ -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 // however, so we use the available_externally linkage which llvm
// provides // provides
match item.node { match item.node {
ast::item_static(*) => { ast::item_static(..) => {
let g = get_item_val(ccx, item.id); let g = get_item_val(ccx, item.id);
// see the comment in get_item_val() as to why this check is // see the comment in get_item_val() as to why this check is
// performed here. // performed here.

View file

@ -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 = ty::node_id_to_type(ccx.tcx, method.self_id);
let self_ty = match param_substs { let self_ty = match param_substs {
None => self_ty, 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) 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"); 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 // make a local copy for trait if needed
let self_ty = expr_ty_adjusted(bcx, self_expr); let self_ty = expr_ty_adjusted(bcx, self_expr);
let self_scratch = match ty::get(self_ty).sty { 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)) unpack_datum!(bcx, expr::trans_to_datum(bcx, self_expr))
} }
_ => { _ => {

View file

@ -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_method(m, _, pt) => (pt, m.ident, m.span),
ast_map::node_foreign_item(i, abis, _, pt) if abis.is_intrinsic() ast_map::node_foreign_item(i, abis, _, pt) if abis.is_intrinsic()
=> (pt, i.ident, i.span), => (pt, i.ident, i.span),
ast_map::node_foreign_item(*) => { ast_map::node_foreign_item(..) => {
// Foreign externs don't have to be monomorphized. // Foreign externs don't have to be monomorphized.
return (get_item_val(ccx, fn_id.node), true); 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(_), _, _) => { ast_map::node_trait_method(@ast::required(_), _, _) => {
ccx.tcx.sess.bug("Can't monomorphize a required trait method") 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") 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") 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_arg(..) => ccx.tcx.sess.bug("Can't monomorphize an arg"),
ast_map::node_block(*) => { ast_map::node_block(..) => {
ccx.tcx.sess.bug("Can't monomorphize a 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") 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") ccx.tcx.sess.bug("Can't monomorphize a callee-scope")
} }
ast_map::node_struct_ctor(_, i, pt) => (pt, i.ident, i.span) 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 { let lldecl = match map_node {
ast_map::node_item(i@@ast::item { ast_map::node_item(i@@ast::item {
node: ast::item_fn(ref decl, _, _, _, ref body), node: ast::item_fn(ref decl, _, _, _, ref body),
_ ..
}, _) => { }, _) => {
let d = mk_lldecl(); let d = mk_lldecl();
set_llvm_fn_attrs(i.attrs, d); set_llvm_fn_attrs(i.attrs, d);
@ -223,7 +223,7 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
[]); []);
d d
} }
ast_map::node_item(*) => { ast_map::node_item(..) => {
ccx.tcx.sess.bug("Can't monomorphize this kind of item") ccx.tcx.sess.bug("Can't monomorphize this kind of item")
} }
ast_map::node_foreign_item(i, _, _, _) => { 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 // Ugh -- but this ensures any new variants won't be forgotten
ast_map::node_expr(*) | ast_map::node_expr(..) |
ast_map::node_stmt(*) | ast_map::node_stmt(..) |
ast_map::node_trait_method(*) | ast_map::node_trait_method(..) |
ast_map::node_arg(*) | ast_map::node_arg(..) |
ast_map::node_block(*) | ast_map::node_block(..) |
ast_map::node_callee_scope(*) | ast_map::node_callee_scope(..) |
ast_map::node_local(*) => { ast_map::node_local(..) => {
ccx.tcx.sess.bug(format!("Can't monomorphize a {:?}", map_node)) ccx.tcx.sess.bug(format!("Can't monomorphize a {:?}", map_node))
} }
}; };

View file

@ -355,7 +355,7 @@ impl Reflector {
let extra = ~[self.c_uint(p.idx)]; let extra = ~[self.c_uint(p.idx)];
self.visit("param", extra) self.visit("param", extra)
} }
ty::ty_self(*) => self.leaf("self"), ty::ty_self(..) => self.leaf("self"),
ty::ty_type => self.leaf("type"), ty::ty_type => self.leaf("type"),
ty::ty_opaque_box => self.leaf("opaque_box"), ty::ty_opaque_box => self.leaf("opaque_box"),
ty::ty_opaque_closure_ptr(ck) => { ty::ty_opaque_closure_ptr(ck) => {

View file

@ -359,7 +359,7 @@ pub fn write_content(bcx: @mut Block,
let _indenter = indenter(); let _indenter = indenter();
match content_expr.node { match content_expr.node {
ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), _ }) => { ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), .. }) => {
match dest { match dest {
Ignore => { Ignore => {
return bcx; 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 //! Figure out the number of elements we need to store this content
match content_expr.node { match content_expr.node {
ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), _ }) => { ast::ExprLit(@codemap::Spanned { node: ast::lit_str(s, _), .. }) => {
s.len() s.len()
}, },
ast::ExprVec(ref es, _) => es.len(), ast::ExprVec(ref es, _) => es.len(),

View file

@ -283,7 +283,7 @@ impl Type {
let box_ty = match store { let box_ty = match store {
ty::BoxTraitStore => Type::opaque_box(ctx), ty::BoxTraitStore => Type::opaque_box(ctx),
ty::UniqTraitStore => Type::unique(ctx, &Type::i8()), ty::UniqTraitStore => Type::unique(ctx, &Type::i8()),
ty::RegionTraitStore(*) => Type::i8() ty::RegionTraitStore(..) => Type::i8()
}; };
Type::struct_([tydesc_ptr, box_ty.ptr_to()], false) Type::struct_([tydesc_ptr, box_ty.ptr_to()], false)
} }

View file

@ -118,21 +118,21 @@ pub fn sizing_type_of(cx: &mut CrateContext, t: ty::t) -> Type {
ty::ty_estr(ty::vstore_box) | ty::ty_estr(ty::vstore_box) |
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_evec(_, ty::vstore_uniq) |
ty::ty_evec(_, ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) |
ty::ty_box(*) | ty::ty_box(..) |
ty::ty_opaque_box | ty::ty_opaque_box |
ty::ty_uniq(*) | ty::ty_uniq(..) |
ty::ty_ptr(*) | ty::ty_ptr(..) |
ty::ty_rptr(*) | ty::ty_rptr(..) |
ty::ty_type | 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_estr(ty::vstore_slice(..)) |
ty::ty_evec(_, ty::vstore_slice(*)) => { ty::ty_evec(_, ty::vstore_slice(..)) => {
Type::struct_([Type::i8p(), Type::i8p()], false) Type::struct_([Type::i8p(), Type::i8p()], false)
} }
ty::ty_bare_fn(*) => Type::i8p(), ty::ty_bare_fn(..) => Type::i8p(),
ty::ty_closure(*) => Type::struct_([Type::i8p(), Type::i8p()], false), ty::ty_closure(..) => Type::struct_([Type::i8p(), Type::i8p()], false),
ty::ty_trait(_, _, store, _, _) => Type::opaque_trait(cx, store), ty::ty_trait(_, _, store, _, _) => Type::opaque_trait(cx, store),
ty::ty_estr(ty::vstore_fixed(size)) => Type::array(&Type::i8(), size as u64), 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) 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); let repr = adt::represent_type(cx, t);
adt::sizing_type_of(cx, repr) adt::sizing_type_of(cx, repr)
} }
ty::ty_struct(*) => { ty::ty_struct(..) => {
if ty::type_is_simd(cx.tcx, t) { if ty::type_is_simd(cx.tcx, t) {
let et = ty::simd_type(cx.tcx, t); let et = ty::simd_type(cx.tcx, t);
let n = ty::simd_size(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)) 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_trait(_, _, store, _, _) => Type::opaque_trait(cx, store),
ty::ty_type => cx.tydesc_type.ptr_to(), ty::ty_type => cx.tydesc_type.ptr_to(),
ty::ty_tup(*) => { ty::ty_tup(..) => {
let repr = adt::represent_type(cx, t); let repr = adt::represent_type(cx, t);
adt::type_of(cx, repr) 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) adt::incomplete_type_of(cx, repr, name)
} }
} }
ty::ty_self(*) => cx.tcx.sess.unimpl("type_of: ty_self"), 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_infer(..) => cx.tcx.sess.bug("type_of with ty_infer"),
ty::ty_param(*) => cx.tcx.sess.bug("type_of with ty_param"), 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_err(..) => cx.tcx.sess.bug("type_of with ty_err")
}; };
debug!("--> mapped t={} {:?} to llty={}", 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. // If this was an enum or struct, fill in the type now.
match ty::get(t).sty { 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); let repr = adt::represent_type(cx, t);
adt::finish_type_of(cx, repr, &mut llty); adt::finish_type_of(cx, repr, &mut llty);
} }

View file

@ -512,8 +512,8 @@ pub enum Region {
impl Region { impl Region {
pub fn is_bound(&self) -> bool { pub fn is_bound(&self) -> bool {
match self { match self {
&ty::ReEarlyBound(*) => true, &ty::ReEarlyBound(..) => true,
&ty::ReLateBound(*) => true, &ty::ReLateBound(..) => true,
_ => false _ => 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 { pub fn type_is_self(ty: t) -> bool {
match get(ty).sty { match get(ty).sty {
ty_self(*) => true, ty_self(..) => true,
_ => false _ => false
} }
} }
pub fn type_is_structural(ty: t) -> bool { pub fn type_is_structural(ty: t) -> bool {
match get(ty).sty { 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_fixed(_)) | ty_estr(vstore_fixed(_)) |
ty_evec(_, vstore_slice(_)) | ty_estr(vstore_slice(_)) ty_evec(_, vstore_slice(_)) | ty_estr(vstore_slice(_))
=> true, => true,
@ -1647,7 +1647,7 @@ pub fn type_is_scalar(ty: t) -> bool {
match get(ty).sty { match get(ty).sty {
ty_nil | ty_bool | ty_char | ty_int(_) | ty_float(_) | ty_uint(_) | ty_nil | ty_bool | ty_char | ty_int(_) | ty_float(_) | ty_uint(_) |
ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) | ty_type | ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) | ty_type |
ty_bare_fn(*) | ty_ptr(_) => true, ty_bare_fn(..) | ty_ptr(_) => true,
_ => false _ => false
} }
} }
@ -2296,7 +2296,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
type_requires(cx, seen, r_ty, mt.ty) type_requires(cx, seen, r_ty, mt.ty)
} }
ty_ptr(*) => { ty_ptr(..) => {
false // unsafe ptrs can always be NULL 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 { pub fn type_is_trait(ty: t) -> bool {
match get(ty).sty { match get(ty).sty {
ty_trait(*) => true, ty_trait(..) => true,
_ => false _ => false
} }
} }
@ -2422,7 +2422,7 @@ pub fn type_is_char(ty: t) -> bool {
pub fn type_is_bare_fn(ty: t) -> bool { pub fn type_is_bare_fn(ty: t) -> bool {
match get(ty).sty { match get(ty).sty {
ty_bare_fn(*) => true, ty_bare_fn(..) => true,
_ => false _ => false
} }
} }
@ -2448,7 +2448,7 @@ pub fn type_is_signed(ty: t) -> bool {
pub fn type_is_machine(ty: t) -> bool { pub fn type_is_machine(ty: t) -> bool {
match get(ty).sty { match get(ty).sty {
ty_int(ast::ty_i) | ty_uint(ast::ty_u) => false, 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 _ => 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; result = false;
} }
ty_infer(*) | ty_self(*) | ty_err => { ty_infer(..) | ty_self(..) | ty_err => {
cx.sess.bug("non concrete type in type_is_pod"); 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 { typeck::method_param(typeck::method_param {
trait_id: trt_id, trait_id: trt_id,
method_num: n_mth, _}) | method_num: n_mth, ..}) |
typeck::method_object(typeck::method_object { typeck::method_object(typeck::method_object {
trait_id: trt_id, trait_id: trt_id,
method_num: n_mth, _}) => { method_num: n_mth, ..}) => {
// ...trait methods bounds, in contrast, include only the // ...trait methods bounds, in contrast, include only the
// method bounds, so we must preprend the tps from the // method bounds, so we must preprend the tps from the
// trait itself. This ought to be harmonized. // 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 // generated via DPS. However, assign_op (e.g., `x += y`) is an
// exception, as its result is always unit. // exception, as its result is always unit.
return match expr.node { return match expr.node {
ast::ExprAssignOp(*) => RvalueStmtExpr, ast::ExprAssignOp(..) => RvalueStmtExpr,
_ => RvalueDpsExpr _ => RvalueDpsExpr
}; };
} }
match expr.node { match expr.node {
ast::ExprPath(*) | ast::ExprSelf => { ast::ExprPath(..) | ast::ExprSelf => {
match resolve_expr(tcx, expr) { match resolve_expr(tcx, expr) {
ast::DefVariant(*) | ast::DefStruct(*) => RvalueDpsExpr, ast::DefVariant(..) | ast::DefStruct(..) => RvalueDpsExpr,
// Fn pointers are just scalar values. // 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 // Note: there is actually a good case to be made that
// def_args, particularly those of immediate type, ought to // def_args, particularly those of immediate type, ought to
// considered rvalues. // considered rvalues.
ast::DefStatic(*) | ast::DefStatic(..) |
ast::DefBinding(*) | ast::DefBinding(..) |
ast::DefUpvar(*) | ast::DefUpvar(..) |
ast::DefArg(*) | ast::DefArg(..) |
ast::DefLocal(*) | ast::DefLocal(..) |
ast::DefSelf(*) => LvalueExpr, ast::DefSelf(..) => LvalueExpr,
def => { def => {
tcx.sess.span_bug(expr.span, format!( tcx.sess.span_bug(expr.span, format!(
@ -3100,30 +3100,30 @@ pub fn expr_kind(tcx: ctxt,
} }
ast::ExprUnary(_, ast::UnDeref, _) | ast::ExprUnary(_, ast::UnDeref, _) |
ast::ExprField(*) | ast::ExprField(..) |
ast::ExprIndex(*) => { ast::ExprIndex(..) => {
LvalueExpr LvalueExpr
} }
ast::ExprCall(*) | ast::ExprCall(..) |
ast::ExprMethodCall(*) | ast::ExprMethodCall(..) |
ast::ExprStruct(*) | ast::ExprStruct(..) |
ast::ExprTup(*) | ast::ExprTup(..) |
ast::ExprIf(*) | ast::ExprIf(..) |
ast::ExprMatch(*) | ast::ExprMatch(..) |
ast::ExprFnBlock(*) | ast::ExprFnBlock(..) |
ast::ExprProc(*) | ast::ExprProc(..) |
ast::ExprDoBody(*) | ast::ExprDoBody(..) |
ast::ExprBlock(*) | ast::ExprBlock(..) |
ast::ExprRepeat(*) | ast::ExprRepeat(..) |
ast::ExprLit(@codemap::Spanned {node: lit_str(*), _}) | ast::ExprLit(@codemap::Spanned {node: lit_str(..), ..}) |
ast::ExprVstore(_, ast::ExprVstoreSlice) | ast::ExprVstore(_, ast::ExprVstoreSlice) |
ast::ExprVstore(_, ast::ExprVstoreMutSlice) | ast::ExprVstore(_, ast::ExprVstoreMutSlice) |
ast::ExprVec(*) => { ast::ExprVec(..) => {
RvalueDpsExpr RvalueDpsExpr
} }
ast::ExprCast(*) => { ast::ExprCast(..) => {
match tcx.node_types.find(&(expr.id as uint)) { match tcx.node_types.find(&(expr.id as uint)) {
Some(&t) => { Some(&t) => {
if type_is_trait(t) { if type_is_trait(t) {
@ -3149,24 +3149,24 @@ pub fn expr_kind(tcx: ctxt,
} }
} }
ast::ExprBreak(*) | ast::ExprBreak(..) |
ast::ExprAgain(*) | ast::ExprAgain(..) |
ast::ExprRet(*) | ast::ExprRet(..) |
ast::ExprWhile(*) | ast::ExprWhile(..) |
ast::ExprLoop(*) | ast::ExprLoop(..) |
ast::ExprAssign(*) | ast::ExprAssign(..) |
ast::ExprInlineAsm(*) | ast::ExprInlineAsm(..) |
ast::ExprAssignOp(*) => { ast::ExprAssignOp(..) => {
RvalueStmtExpr RvalueStmtExpr
} }
ast::ExprForLoop(*) => fail!("non-desugared expr_for_loop"), ast::ExprForLoop(..) => fail!("non-desugared expr_for_loop"),
ast::ExprLogLevel | ast::ExprLogLevel |
ast::ExprLit(_) | // Note: lit_str is carved out above ast::ExprLit(_) | // Note: lit_str is carved out above
ast::ExprUnary(*) | ast::ExprUnary(..) |
ast::ExprAddrOf(*) | ast::ExprAddrOf(..) |
ast::ExprBinary(*) | ast::ExprBinary(..) |
ast::ExprVstore(_, ast::ExprVstoreBox) | ast::ExprVstore(_, ast::ExprVstoreBox) |
ast::ExprVstore(_, ast::ExprVstoreMutBox) | ast::ExprVstore(_, ast::ExprVstoreMutBox) |
ast::ExprVstore(_, ast::ExprVstoreUniq) => { ast::ExprVstore(_, ast::ExprVstoreUniq) => {
@ -3175,7 +3175,7 @@ pub fn expr_kind(tcx: ctxt,
ast::ExprParen(e) => expr_kind(tcx, method_map, e), ast::ExprParen(e) => expr_kind(tcx, method_map, e),
ast::ExprMac(*) => { ast::ExprMac(..) => {
tcx.sess.span_bug( tcx.sess.span_bug(
expr.span, expr.span,
"macro expression remains after expansion"); "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) => { ast::StmtDecl(_, id) | StmtExpr(_, id) | StmtSemi(_, id) => {
return 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)) cx.sess.str_of(values.found))
} }
terr_arg_count => ~"incorrect number of function parameters", terr_arg_count => ~"incorrect number of function parameters",
terr_regions_does_not_outlive(*) => { terr_regions_does_not_outlive(..) => {
format!("lifetime mismatch") format!("lifetime mismatch")
} }
terr_regions_not_same(*) => { terr_regions_not_same(..) => {
format!("lifetimes are not the same") format!("lifetimes are not the same")
} }
terr_regions_no_overlap(*) => { terr_regions_no_overlap(..) => {
format!("lifetimes do not intersect") format!("lifetimes do not intersect")
} }
terr_regions_insufficiently_polymorphic(br, _) => { 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) { match cx.items.find(&id.node) {
Some(&ast_map::node_item(@ast::item { Some(&ast_map::node_item(@ast::item {
node: item_trait(_, _, ref ms), node: item_trait(_, _, ref ms),
_ ..
}, _)) => }, _)) =>
match ast_util::split_trait_methods(*ms) { match ast_util::split_trait_methods(*ms) {
(_, p) => p.map(|m| method(cx, ast_util::local_def(m.id))) (_, 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) { match cx.items.find(&id.node) {
Some(&ast_map::node_item(@ast::item { Some(&ast_map::node_item(@ast::item {
node: ast::item_impl(_, ref opt_trait, _, _), node: ast::item_impl(_, ref opt_trait, _, _),
_}, ..},
_)) => { _)) => {
match opt_trait { match opt_trait {
&Some(ref t) => Some(ty::node_id_to_trait_ref(cx, t.ref_id)), &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) { match cx.items.get_copy(&id.node) {
ast_map::node_item(@ast::item { ast_map::node_item(@ast::item {
node: ast::item_enum(ref enum_definition, _), node: ast::item_enum(ref enum_definition, _),
_ ..
}, _) => { }, _) => {
let mut last_discriminant: Option<Disr> = None; let mut last_discriminant: Option<Disr> = None;
@enum_definition.variants.iter().map(|variant| { @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 { pub fn each_attr(tcx: ctxt, did: DefId, f: |@MetaItem| -> bool) -> bool {
if is_local(did) { if is_local(did) {
match tcx.items.find(&did.node) { 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)), attrs.iter().advance(|attr| f(attr.node.value)),
_ => tcx.sess.bug(format!("has_attr: {:?} is not an item", _ => tcx.sess.bug(format!("has_attr: {:?} is not an item",
did)) did))
@ -4022,7 +4022,7 @@ pub fn lookup_field_type(tcx: ctxt,
} }
else { else {
match tcx.tcache.find(&id) { match tcx.tcache.find(&id) {
Some(&ty_param_bounds_and_ty {ty, _}) => ty, Some(&ty_param_bounds_and_ty {ty, ..}) => ty,
None => { None => {
let tpt = csearch::get_field_type(tcx, struct_id, id); let tpt = csearch::get_field_type(tcx, struct_id, id);
tcx.tcache.insert(id, tpt); 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 { fn fold_vstore(&mut self, vstore: vstore) -> vstore {
match vstore { match vstore {
vstore_fixed(*) | vstore_uniq | vstore_box => vstore, vstore_fixed(..) | vstore_uniq | vstore_box => vstore,
vstore_slice(_) => vstore_slice(ReStatic) vstore_slice(_) => vstore_slice(ReStatic)
} }
} }
@ -4307,7 +4307,7 @@ pub fn eval_repeat_count<T: ExprTyProvider>(tcx: &T, count_expr: &ast::Expr) ->
return 0; return 0;
} }
}, },
Err(*) => { Err(..) => {
tcx.ty_ctxt().sess.span_err(count_expr.span, tcx.ty_ctxt().sess.span_err(count_expr.span,
"expected constant integer for repeat count \ "expected constant integer for repeat count \
but found variable"); but found variable");
@ -4574,11 +4574,11 @@ pub fn hash_crate_independent(tcx: ctxt, t: t, local_hash: @str) -> u64 {
ReStatic => {} ReStatic => {}
ReEmpty | ReEmpty |
ReEarlyBound(*) | ReEarlyBound(..) |
ReLateBound(*) | ReLateBound(..) |
ReFree(*) | ReFree(..) |
ReScope(*) | ReScope(..) |
ReInfer(*) => { ReInfer(..) => {
tcx.sess.bug("non-static region found when hashing a type") tcx.sess.bug("non-static region found when hashing a type")
} }
} }

View file

@ -192,7 +192,7 @@ pub fn super_fold_sty<T:TypeFolder>(this: &mut T,
ty::ty_float(_) | ty::ty_type | ty::ty_float(_) | ty::ty_type |
ty::ty_opaque_closure_ptr(_) | ty::ty_opaque_closure_ptr(_) |
ty::ty_err | ty::ty_opaque_box | ty::ty_infer(_) | ty::ty_err | ty::ty_opaque_box | ty::ty_infer(_) |
ty::ty_param(*) | ty::ty_self(_) => { ty::ty_param(..) | ty::ty_self(_) => {
(*sty).clone() (*sty).clone()
} }
} }

View file

@ -329,7 +329,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
ty::vstore_slice(r) => { ty::vstore_slice(r) => {
ty::RegionTraitStore(r) ty::RegionTraitStore(r)
} }
ty::vstore_fixed(*) => { ty::vstore_fixed(..) => {
tcx.sess.span_err( tcx.sess.span_err(
path.span, path.span,
"@trait, ~trait or &trait are the only supported \ "@trait, ~trait or &trait are the only supported \
@ -459,7 +459,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
// Kind bounds on path types are only supported for traits. // Kind bounds on path types are only supported for traits.
match a_def { match a_def {
// But don't emit the error if the user meant to do a trait anyway. // But don't emit the error if the user meant to do a trait anyway.
ast::DefTrait(*) => { }, ast::DefTrait(..) => { },
_ if bounds.is_some() => _ if bounds.is_some() =>
tcx.sess.span_err(ast_ty.span, tcx.sess.span_err(ast_ty.span,
"kind bounds can only be used on trait types"), "kind bounds can only be used on trait types"),
@ -810,6 +810,6 @@ fn conv_builtin_bounds(tcx: ty::ctxt, ast_bounds: &Option<OptVec<ast::TyParamBou
let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundStatic); set let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundStatic); set
} }
// &'r Trait is sugar for &'r Trait:<no-bounds>. // &'r Trait is sugar for &'r Trait:<no-bounds>.
(&None, ty::RegionTraitStore(*)) => ty::EmptyBuiltinBounds(), (&None, ty::RegionTraitStore(..)) => ty::EmptyBuiltinBounds(),
} }
} }

View file

@ -355,7 +355,7 @@ pub fn check_struct_pat(pcx: &pat_ctxt, pat_id: ast::NodeId, span: Span,
if supplied_def_id == struct_id => { if supplied_def_id == struct_id => {
// OK. // OK.
} }
Some(&ast::DefStruct(*)) | Some(&ast::DefVariant(*)) => { Some(&ast::DefStruct(..)) | Some(&ast::DefVariant(..)) => {
let name = pprust::path_to_str(path, tcx.sess.intr()); let name = pprust::path_to_str(path, tcx.sess.intr());
tcx.sess.span_err(span, tcx.sess.span_err(span,
format!("mismatched types: expected `{}` but found `{}`", 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, check_struct_pat_fields(pcx, span, path, fields, class_fields,
variant_id, substitutions, etc); 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()); let name = pprust::path_to_str(path, tcx.sess.intr());
tcx.sess.span_err(span, tcx.sess.span_err(span,
format!("mismatched types: expected `{}` but \ 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); fcx.write_ty(pat.id, b_ty);
} }
ast::PatEnum(*) | ast::PatEnum(..) |
ast::PatIdent(*) if pat_is_const(tcx.def_map, pat) => { 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_did = ast_util::def_id_of_def(tcx.def_map.get_copy(&pat.id));
let const_tpt = ty::lookup_item_type(tcx, const_did); let const_tpt = ty::lookup_item_type(tcx, const_did);
demand::suptype(fcx, pat.span, expected, const_tpt.ty); demand::suptype(fcx, pat.span, expected, const_tpt.ty);

View file

@ -324,7 +324,7 @@ impl<'self> LookupContext<'self> {
ty_param(p) => { ty_param(p) => {
self.push_inherent_candidates_from_param(self_ty, 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 // Call is of the form "self.foo()" and appears in one
// of a trait's default method implementations. // of a trait's default method implementations.
self.push_inherent_candidates_from_self(self_ty); 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 // This case should probably be handled similarly to
// Trait instances. // Trait instances.
None None
@ -760,13 +760,13 @@ impl<'self> LookupContext<'self> {
let tcx = self.tcx(); let tcx = self.tcx();
match ty::get(self_ty).sty { 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(IntVar(_)) |
ty_infer(FloatVar(_)) | ty_infer(FloatVar(_)) |
ty_self(_) | ty_param(*) | ty_nil | ty_bot | ty_bool | ty_self(_) | ty_param(..) | ty_nil | ty_bot | ty_bool |
ty_char | ty_int(*) | ty_uint(*) | ty_char | ty_int(..) | ty_uint(..) |
ty_float(*) | ty_enum(*) | ty_ptr(*) | ty_struct(*) | ty_tup(*) | ty_float(..) | ty_enum(..) | ty_ptr(..) | ty_struct(..) | ty_tup(..) |
ty_estr(*) | ty_evec(*) | ty_trait(*) | ty_closure(*) => { ty_estr(..) | ty_evec(..) | ty_trait(..) | ty_closure(..) => {
self.search_for_some_kind_of_autorefd_method( self.search_for_some_kind_of_autorefd_method(
AutoPtr, autoderefs, [MutImmutable, MutMutable], AutoPtr, autoderefs, [MutImmutable, MutMutable],
|m,r| ty::mk_rptr(tcx, r, ty::mt {ty:self_ty, mutbl:m})) |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); assert!(candidate.method_ty.explicit_self != sty_static);
let transformed_self_ty = match candidate.origin { let transformed_self_ty = match candidate.origin {
method_object(*) => { method_object(..) => {
// For annoying reasons, we've already handled the // For annoying reasons, we've already handled the
// substitution for object calls. // substitution for object calls.
candidate.method_ty.transformed_self_ty.unwrap() candidate.method_ty.transformed_self_ty.unwrap()
@ -1066,7 +1066,7 @@ impl<'self> LookupContext<'self> {
ast::sty_value(_) => { ast::sty_value(_) => {
ty::mk_err() // error reported in `enforce_object_limitations()` 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 = let transformed_self_ty =
method_ty.transformed_self_ty.clone().unwrap(); method_ty.transformed_self_ty.clone().unwrap();
match ty::get(transformed_self_ty).sty { match ty::get(transformed_self_ty).sty {
@ -1108,10 +1108,10 @@ impl<'self> LookupContext<'self> {
*/ */
match candidate.origin { match candidate.origin {
method_static(*) | method_param(*) => { method_static(..) | method_param(..) => {
return; // not a call to a trait instance return; // not a call to a trait instance
} }
method_object(*) => {} method_object(..) => {}
} }
match candidate.method_ty.explicit_self { match candidate.method_ty.explicit_self {
@ -1129,7 +1129,7 @@ impl<'self> LookupContext<'self> {
through an object"); 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 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 // XXX: does this properly enforce this on everything now
// that self has been merged in? -sully // that self has been merged in? -sully
method_param(method_param { trait_id: trait_id, _ }) | method_param(method_param { trait_id: trait_id, .. }) |
method_object(method_object { trait_id: trait_id, _ }) => { method_object(method_object { trait_id: trait_id, .. }) => {
bad = self.tcx().destructor_for_type.contains_key(&trait_id); bad = self.tcx().destructor_for_type.contains_key(&trait_id);
} }
} }

View file

@ -198,7 +198,7 @@ impl PurityState {
purity => { purity => {
let (purity, def) = match blk.rules { 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), ast::DefaultBlock => (purity, self.def),
}; };
PurityState{ def: 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)); let trait_def = ty::lookup_trait_def(ccx.tcx, local_def(it.id));
for trait_method in (*trait_methods).iter() { for trait_method in (*trait_methods).iter() {
match *trait_method { match *trait_method {
required(*) => { required(..) => {
// Nothing to do, since required methods don't have // Nothing to do, since required methods don't have
// bodies to check. // 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); check_struct(ccx, it.id, it.span);
} }
ast::item_ty(ref t, ref generics) => { 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; let tcx = fcx.ccx.tcx;
match lit.node { match lit.node {
ast::lit_str(*) => ty::mk_estr(tcx, ty::vstore_slice(ty::ReStatic)), ast::lit_str(..) => ty::mk_estr(tcx, ty::vstore_slice(ty::ReStatic)),
ast::lit_binary(*) => { ast::lit_binary(..) => {
ty::mk_evec(tcx, ty::mt{ ty: ty::mk_u8(), mutbl: ast::MutImmutable }, ty::mk_evec(tcx, ty::mt{ ty: ty::mk_u8(), mutbl: ast::MutImmutable },
ty::vstore_slice(ty::ReStatic)) 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() { for (i, arg) in args.iter().take(t).enumerate() {
let is_block = match arg.node { let is_block = match arg.node {
ast::ExprFnBlock(*) | ast::ExprFnBlock(..) |
ast::ExprProc(*) | ast::ExprProc(..) |
ast::ExprDoBody(*) => true, ast::ExprDoBody(..) => true,
_ => false _ => false
}; };
@ -1874,8 +1874,8 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
}; };
let fn_sig = match *fn_sty { let fn_sig = match *fn_sty {
ty::ty_bare_fn(ty::BareFnTy {sig: ref sig, _}) | ty::ty_bare_fn(ty::BareFnTy {sig: ref sig, ..}) |
ty::ty_closure(ty::ClosureTy {sig: ref sig, _}) => sig, ty::ty_closure(ty::ClosureTy {sig: ref sig, ..}) => sig,
_ => { _ => {
fcx.type_error_message(call_expr.span, |actual| { fcx.type_error_message(call_expr.span, |actual| {
format!("expected function but \ format!("expected function but \
@ -2573,7 +2573,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
match expr.node { match expr.node {
ast::ExprVstore(ev, vst) => { ast::ExprVstore(ev, vst) => {
let typ = match ev.node { 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); let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
ty::mk_estr(tcx, tt) ty::mk_estr(tcx, tt)
} }
@ -2723,13 +2723,13 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
} }
None => { None => {
match *sty { match *sty {
ty::ty_enum(*) => { ty::ty_enum(..) => {
tcx.sess.span_err( tcx.sess.span_err(
expr.span, expr.span,
"can only dereference enums with a single variant which \ "can only dereference enums with a single variant which \
has a single argument"); has a single argument");
} }
ty::ty_struct(*) => { ty::ty_struct(..) => {
tcx.sess.span_err( tcx.sess.span_err(
expr.span, expr.span,
"can only dereference structs with one anonymous field"); "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); fcx.write_nil(id);
} }
} }
ast::ExprForLoop(*) => ast::ExprForLoop(..) =>
fail!("non-desugared expr_for_loop"), fail!("non-desugared expr_for_loop"),
ast::ExprLoop(ref body, _) => { ast::ExprLoop(ref body, _) => {
check_block_no_value(fcx, (body)); check_block_no_value(fcx, (body));
@ -3012,7 +3012,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
else { else {
match ty::get(t_1).sty { match ty::get(t_1).sty {
// This will be looked up later on // This will be looked up later on
ty::ty_trait(*) => (), ty::ty_trait(..) => (),
_ => { _ => {
if ty::type_is_nil(t_e) { 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_bot |= ty::type_is_bot(expr_ty);
saw_err |= ty::type_is_error(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 { if saw_bot {
fcx.write_bot(node_id); 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); let s_ty = fcx.node_ty(s_id);
if last_was_bot && !warned && match s.node { if last_was_bot && !warned && match s.node {
ast::StmtDecl(@codemap::Spanned { node: ast::DeclLocal(_), ast::StmtDecl(@codemap::Spanned { node: ast::DeclLocal(_),
_}, _) | ..}, _) |
ast::StmtExpr(_, _) | ast::StmtSemi(_, _) => { ast::StmtExpr(_, _) | ast::StmtSemi(_, _) => {
true true
} }
@ -3656,28 +3656,28 @@ pub fn ty_param_bounds_and_ty_for_def(fcx: @mut FnCtxt,
ast::DefTrait(_) | ast::DefTrait(_) |
ast::DefTy(_) | ast::DefTy(_) |
ast::DefPrimTy(_) | ast::DefPrimTy(_) |
ast::DefTyParam(*)=> { ast::DefTyParam(..)=> {
fcx.ccx.tcx.sess.span_bug(sp, "expected value but found type"); 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"); 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"); 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"); 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"); 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"); 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"); 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"); 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| { ty::walk_ty(ty, |t| {
match ty::get(t).sty { match ty::get(t).sty {
ty::ty_param(param_ty {idx, _}) => { ty::ty_param(param_ty {idx, ..}) => {
debug!("Found use of ty param \\#{}", idx); debug!("Found use of ty param \\#{}", idx);
tps_used[idx] = true; tps_used[idx] = true;
} }

View file

@ -164,7 +164,7 @@ pub fn regionck_fn(fcx: @mut FnCtxt, blk: &ast::Block) {
} }
impl Visitor<()> for Rcx { 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 // However, right now we run into an issue whereby some free
// regions are not properly related if they appear within the // regions are not properly related if they appear within the
// types of arguments that must be inferred. This could be // 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); } 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); } 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 // operators is a hopeless mess and I can't figure out how to
// represent it. - ndm // represent it. - ndm
// //
// ast::expr_assign_op(*) | // ast::expr_assign_op(..) |
ast::ExprIndex(*) | ast::ExprIndex(..) |
ast::ExprBinary(*) | ast::ExprBinary(..) |
ast::ExprUnary(*) if has_method_map => { ast::ExprUnary(..) if has_method_map => {
tcx.region_maps.record_cleanup_scope(expr.id); tcx.region_maps.record_cleanup_scope(expr.id);
} }
ast::ExprBinary(_, ast::BiAnd, lhs, rhs) | 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(lhs.id);
tcx.region_maps.record_cleanup_scope(rhs.id); tcx.region_maps.record_cleanup_scope(rhs.id);
} }
ast::ExprCall(*) | ast::ExprCall(..) |
ast::ExprMethodCall(*) => { ast::ExprMethodCall(..) => {
tcx.region_maps.record_cleanup_scope(expr.id); tcx.region_maps.record_cleanup_scope(expr.id);
} }
ast::ExprMatch(_, ref arms) => { ast::ExprMatch(_, ref arms) => {
@ -427,7 +427,7 @@ fn visit_expr(rcx: &mut Rcx, expr: @ast::Expr) {
visit::walk_expr(rcx, expr, ()); visit::walk_expr(rcx, expr, ());
} }
ast::ExprFnBlock(*) | ast::ExprProc(*) => { ast::ExprFnBlock(..) | ast::ExprProc(..) => {
check_expr_fn_block(rcx, expr); check_expr_fn_block(rcx, expr);
} }
@ -462,7 +462,7 @@ fn check_expr_fn_block(rcx: &mut Rcx,
match ty::get(function_type).sty { match ty::get(function_type).sty {
ty::ty_closure( ty::ty_closure(
ty::ClosureTy { ty::ClosureTy {
sigil: ast::BorrowedSigil, region: region, _}) => { sigil: ast::BorrowedSigil, region: region, ..}) => {
if get_freevars(tcx, expr.id).is_empty() { if get_freevars(tcx, expr.id).is_empty() {
// No free variables means that the environment // No free variables means that the environment
// will be NULL at runtime and hence the closure // 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); let callee_ty = rcx.resolve_node_type(callee_id);
match ty::get(callee_ty).sty { match ty::get(callee_ty).sty {
ty::ty_bare_fn(*) => { } ty::ty_bare_fn(..) => { }
ty::ty_closure(ref closure_ty) => { ty::ty_closure(ref closure_ty) => {
rcx.fcx.mk_subr(true, infer::InvokeClosure(callee_expr.span), rcx.fcx.mk_subr(true, infer::InvokeClosure(callee_expr.span),
call_region, closure_ty.region); call_region, closure_ty.region);
@ -1004,7 +1004,7 @@ pub mod guarantor {
guarantor(rcx, e) guarantor(rcx, e)
} }
ast::ExprPath(*) | ast::ExprSelf => { ast::ExprPath(..) | ast::ExprSelf => {
// Either a variable or constant and hence resides // Either a variable or constant and hence resides
// in constant memory or on the stack frame. Either way, // in constant memory or on the stack frame. Either way,
// not guaranteed by a region pointer. // not guaranteed by a region pointer.
@ -1013,39 +1013,39 @@ pub mod guarantor {
// All of these expressions are rvalues and hence their // All of these expressions are rvalues and hence their
// value is not guaranteed by a region pointer. // value is not guaranteed by a region pointer.
ast::ExprInlineAsm(*) | ast::ExprInlineAsm(..) |
ast::ExprMac(*) | ast::ExprMac(..) |
ast::ExprLit(_) | ast::ExprLit(_) |
ast::ExprUnary(*) | ast::ExprUnary(..) |
ast::ExprAddrOf(*) | ast::ExprAddrOf(..) |
ast::ExprBinary(*) | ast::ExprBinary(..) |
ast::ExprVstore(*) | ast::ExprVstore(..) |
ast::ExprBreak(*) | ast::ExprBreak(..) |
ast::ExprAgain(*) | ast::ExprAgain(..) |
ast::ExprRet(*) | ast::ExprRet(..) |
ast::ExprLogLevel | ast::ExprLogLevel |
ast::ExprWhile(*) | ast::ExprWhile(..) |
ast::ExprLoop(*) | ast::ExprLoop(..) |
ast::ExprAssign(*) | ast::ExprAssign(..) |
ast::ExprAssignOp(*) | ast::ExprAssignOp(..) |
ast::ExprCast(*) | ast::ExprCast(..) |
ast::ExprCall(*) | ast::ExprCall(..) |
ast::ExprMethodCall(*) | ast::ExprMethodCall(..) |
ast::ExprStruct(*) | ast::ExprStruct(..) |
ast::ExprTup(*) | ast::ExprTup(..) |
ast::ExprIf(*) | ast::ExprIf(..) |
ast::ExprMatch(*) | ast::ExprMatch(..) |
ast::ExprFnBlock(*) | ast::ExprFnBlock(..) |
ast::ExprProc(*) | ast::ExprProc(..) |
ast::ExprDoBody(*) | ast::ExprDoBody(..) |
ast::ExprBlock(*) | ast::ExprBlock(..) |
ast::ExprRepeat(*) | ast::ExprRepeat(..) |
ast::ExprVec(*) => { ast::ExprVec(..) => {
assert!(!ty::expr_is_lval( assert!(!ty::expr_is_lval(
rcx.fcx.tcx(), rcx.fcx.inh.method_map, expr)); rcx.fcx.tcx(), rcx.fcx.inh.method_map, expr));
None 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); debug!("before adjustments, cat={:?}", expr_ct.cat);
match rcx.fcx.inh.adjustments.find(&expr.id) { match rcx.fcx.inh.adjustments.find(&expr.id) {
Some(&@ty::AutoAddEnv(*)) => { Some(&@ty::AutoAddEnv(..)) => {
// This is basically an rvalue, not a pointer, no regions // This is basically an rvalue, not a pointer, no regions
// involved. // involved.
expr_ct.cat = ExprCategorization { expr_ct.cat = ExprCategorization {
@ -1166,14 +1166,14 @@ pub mod guarantor {
ty::ty_estr(ty::vstore_slice(r)) => { ty::ty_estr(ty::vstore_slice(r)) => {
BorrowedPointer(r) BorrowedPointer(r)
} }
ty::ty_uniq(*) | ty::ty_uniq(..) |
ty::ty_estr(ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) |
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) | ty::ty_trait(_, _, ty::UniqTraitStore, _, _) |
ty::ty_evec(_, ty::vstore_uniq) => { ty::ty_evec(_, ty::vstore_uniq) => {
OwnedPointer OwnedPointer
} }
ty::ty_box(*) | ty::ty_box(..) |
ty::ty_ptr(*) | ty::ty_ptr(..) |
ty::ty_evec(_, ty::vstore_box) | ty::ty_evec(_, ty::vstore_box) |
ty::ty_trait(_, _, ty::BoxTraitStore, _, _) | ty::ty_trait(_, _, ty::BoxTraitStore, _, _) |
ty::ty_estr(ty::vstore_box) => { 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); let r = ty::ty_region(rcx.fcx.tcx(), pat.span, rptr_ty);
link_ref_bindings_in_pat(rcx, p, Some(r)); link_ref_bindings_in_pat(rcx, p, Some(r));
} }
ast::PatLit(*) => {} ast::PatLit(..) => {}
ast::PatRange(*) => {} ast::PatRange(..) => {}
ast::PatVec(ref before, ref slice, ref after) => { ast::PatVec(ref before, ref slice, ref after) => {
let vec_ty = rcx.resolve_node_type(pat.id); let vec_ty = rcx.resolve_node_type(pat.id);
let vstore = ty::ty_vstore(vec_ty); let vstore = ty::ty_vstore(vec_ty);

View file

@ -248,7 +248,7 @@ fn lookup_vtable(vcx: &VtableContext,
// If the type is self or a param, we look at the trait/supertrait // 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. // bounds to see if they include the trait we are looking for.
let vtable_opt = match ty::get(ty).sty { 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] = let type_param_bounds: &[@ty::TraitRef] =
vcx.param_env.type_param_bounds[n].trait_bounds; vcx.param_env.type_param_bounds[n].trait_bounds;
lookup_vtable_from_bounds(vcx, lookup_vtable_from_bounds(vcx,
@ -559,7 +559,7 @@ pub fn early_resolve_expr(ex: @ast::Expr,
let cx = fcx.ccx; let cx = fcx.ccx;
match ex.node { match ex.node {
ast::ExprPath(*) => { ast::ExprPath(..) => {
fcx.opt_node_ty_substs(ex.id, |substs| { fcx.opt_node_ty_substs(ex.id, |substs| {
debug!("vtable resolution on parameter bounds for expr {}", debug!("vtable resolution on parameter bounds for expr {}",
ex.repr(fcx.tcx())); ex.repr(fcx.tcx()));
@ -631,7 +631,7 @@ pub fn early_resolve_expr(ex: @ast::Expr,
match (&ty::get(ty).sty, store) { match (&ty::get(ty).sty, store) {
(&ty::ty_box(mt), ty::BoxTraitStore) | (&ty::ty_box(mt), ty::BoxTraitStore) |
(&ty::ty_uniq(mt), ty::UniqTraitStore) | (&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) => { if !mutability_allowed(mt.mutbl, target_mutbl) => {
fcx.tcx().sess.span_err(ex.span, fcx.tcx().sess.span_err(ex.span,
format!("types differ in mutability")); 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_box(mt), ty::BoxTraitStore) |
(&ty::ty_uniq(mt), ty::UniqTraitStore) | (&ty::ty_uniq(mt), ty::UniqTraitStore) |
(&ty::ty_rptr(_, mt), ty::RegionTraitStore(*)) => { (&ty::ty_rptr(_, mt), ty::RegionTraitStore(..)) => {
let location_info = let location_info =
&location_info_for_expr(ex); &location_info_for_expr(ex);
let vcx = fcx.vtable_context(); let vcx = fcx.vtable_context();

View file

@ -75,15 +75,15 @@ pub fn get_base_type(inference_context: @mut InferCtxt,
} }
match get(resolved_type).sty { match get(resolved_type).sty {
ty_enum(*) | ty_trait(*) | ty_struct(*) => { ty_enum(..) | ty_trait(..) | ty_struct(..) => {
debug!("(getting base type) found base type"); debug!("(getting base type) found base type");
Some(resolved_type) Some(resolved_type)
} }
ty_nil | ty_bot | ty_bool | ty_char | ty_int(*) | ty_uint(*) | ty_float(*) | 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_estr(..) | ty_evec(..) | ty_bare_fn(..) | ty_closure(..) | ty_tup(..) |
ty_infer(*) | ty_param(*) | ty_self(*) | ty_type | ty_opaque_box | ty_infer(..) | ty_param(..) | ty_self(..) | ty_type | ty_opaque_box |
ty_opaque_closure_ptr(*) | ty_unboxed_vec(*) | ty_err | ty_box(_) | ty_opaque_closure_ptr(..) | ty_unboxed_vec(..) | ty_err | ty_box(_) |
ty_uniq(_) | ty_ptr(_) | ty_rptr(_, _) => { ty_uniq(_) | ty_ptr(_) | ty_rptr(_, _) => {
debug!("(getting base type) no base type; found {:?}", debug!("(getting base type) no base type; found {:?}",
get(original_type).sty); get(original_type).sty);
@ -562,7 +562,7 @@ impl CoherenceChecker {
} }
Some(&node_item(item, _)) => { Some(&node_item(item, _)) => {
match item.node { match item.node {
item_struct(*) | item_enum(*) => true, item_struct(..) | item_enum(..) => true,
_ => false, _ => false,
} }
} }

View file

@ -74,7 +74,7 @@ impl visit::Visitor<()> for CollectItemTypesVisitor {
pub fn collect_item_types(ccx: @mut CrateCtxt, crate: &ast::Crate) { pub fn collect_item_types(ccx: @mut CrateCtxt, crate: &ast::Crate) {
fn collect_intrinsic_type(ccx: &CrateCtxt, fn collect_intrinsic_type(ccx: &CrateCtxt,
lang_item: ast::DefId) { 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.get_item_ty(lang_item);
ccx.tcx.intrinsic_defs.insert(lang_item, ty); 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) { match tcx.items.get_copy(&trait_id) {
ast_map::node_item(@ast::item { ast_map::node_item(@ast::item {
node: ast::item_trait(ref generics, _, ref ms), node: ast::item_trait(ref generics, _, ref ms),
_ ..
}, _) => { }, _) => {
let trait_ty_generics = let trait_ty_generics =
ty_generics(ccx, generics, 0); 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); tcx.tcache.insert(local_def(it.id), tpt);
return tpt; return tpt;
} }
ast::item_trait(*) => { ast::item_trait(..) => {
tcx.sess.span_bug( tcx.sess.span_bug(
it.span, it.span,
format!("Invoked ty_of_item on trait")); 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); tcx.tcache.insert(local_def(it.id), tpt);
return tpt; return tpt;
} }
ast::item_impl(*) | ast::item_mod(_) | ast::item_impl(..) | ast::item_mod(_) |
ast::item_foreign_mod(_) => fail!(), ast::item_foreign_mod(_) => fail!(),
ast::item_mac(*) => fail!("item macros unimplemented") ast::item_mac(..) => fail!("item macros unimplemented")
} }
} }

View file

@ -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| { return self.unpack_actual_value(a, |sty_a| {
self.coerce_borrowed_fn(a, sty_a, b) 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| { return self.unpack_actual_value(a, |sty_a| {
self.coerce_borrowed_object(a, sty_a, b, m) self.coerce_borrowed_object(a, sty_a, b, m)
}); });

View file

@ -472,7 +472,7 @@ impl ErrorReportingHelpers for InferCtxt {
infer::BoundRegionInTypeOrImpl(_) => { infer::BoundRegionInTypeOrImpl(_) => {
format!(" for region in type/impl") format!(" for region in type/impl")
} }
infer::BoundRegionInCoherence(*) => { infer::BoundRegionInCoherence(..) => {
format!(" for coherence check") format!(" for coherence check")
} }
}; };

View file

@ -192,10 +192,10 @@ going on:
fn weird() { fn weird() {
let mut x: ~Foo = ~Foo { ... }; let mut x: ~Foo = ~Foo { ... };
'a: add(&mut (*x).f, '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 `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 second argument also borrows the field `f`. Now, in the current borrow
checker, the first borrow is given the lifetime of the call to checker, the first borrow is given the lifetime of the call to
@ -248,7 +248,7 @@ this similar but unsound example:
} }
fn weird() { fn weird() {
let mut x: ~Foo = ~Foo { ... }; 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 In this case, the second argument to `add` actually consumes `x`, thus

View file

@ -244,10 +244,10 @@ impl RegionVarBindings {
debug!("RegionVarBindings: make_subregion({:?}, {:?})", sub, sup); debug!("RegionVarBindings: make_subregion({:?}, {:?})", sub, sup);
match (sub, sup) { match (sub, sup) {
(ReEarlyBound(*), _) | (ReEarlyBound(..), _) |
(ReLateBound(*), _) | (ReLateBound(..), _) |
(_, ReEarlyBound(*)) | (_, ReEarlyBound(..)) |
(_, ReLateBound(*)) => { (_, ReLateBound(..)) => {
self.tcx.sess.span_bug( self.tcx.sess.span_bug(
origin.span(), origin.span(),
format!("Cannot relate bound region: {} <= {}", format!("Cannot relate bound region: {} <= {}",
@ -493,10 +493,10 @@ impl RegionVarBindings {
fn lub_concrete_regions(&self, a: Region, b: Region) -> Region { fn lub_concrete_regions(&self, a: Region, b: Region) -> Region {
match (a, b) { match (a, b) {
(ReLateBound(*), _) | (ReLateBound(..), _) |
(_, ReLateBound(*)) | (_, ReLateBound(..)) |
(ReEarlyBound(*), _) | (ReEarlyBound(..), _) |
(_, ReEarlyBound(*)) => { (_, ReEarlyBound(..)) => {
self.tcx.sess.bug( self.tcx.sess.bug(
format!("Cannot relate bound region: LUB({}, {})", format!("Cannot relate bound region: LUB({}, {})",
a.repr(self.tcx), a.repr(self.tcx),
@ -553,8 +553,8 @@ impl RegionVarBindings {
// For these types, we cannot define any additional // For these types, we cannot define any additional
// relationship: // relationship:
(ReInfer(ReSkolemized(*)), _) | (ReInfer(ReSkolemized(..)), _) |
(_, ReInfer(ReSkolemized(*))) => { (_, ReInfer(ReSkolemized(..))) => {
if a == b {a} else {ReStatic} if a == b {a} else {ReStatic}
} }
} }
@ -597,10 +597,10 @@ impl RegionVarBindings {
-> cres<Region> { -> cres<Region> {
debug!("glb_concrete_regions({:?}, {:?})", a, b); debug!("glb_concrete_regions({:?}, {:?})", a, b);
match (a, b) { match (a, b) {
(ReLateBound(*), _) | (ReLateBound(..), _) |
(_, ReLateBound(*)) | (_, ReLateBound(..)) |
(ReEarlyBound(*), _) | (ReEarlyBound(..), _) |
(_, ReEarlyBound(*)) => { (_, ReEarlyBound(..)) => {
self.tcx.sess.bug( self.tcx.sess.bug(
format!("Cannot relate bound region: GLB({}, {})", format!("Cannot relate bound region: GLB({}, {})",
a.repr(self.tcx), a.repr(self.tcx),
@ -649,8 +649,8 @@ impl RegionVarBindings {
// For these types, we cannot define any additional // For these types, we cannot define any additional
// relationship: // relationship:
(ReInfer(ReSkolemized(*)), _) | (ReInfer(ReSkolemized(..)), _) |
(_, ReInfer(ReSkolemized(*))) => { (_, ReInfer(ReSkolemized(..))) => {
if a == b { if a == b {
Ok(a) Ok(a)
} else { } else {
@ -779,11 +779,11 @@ impl RegionVarBindings {
} }
} }
} }
ConstrainVarSubReg(*) => { ConstrainVarSubReg(..) => {
// This is a contraction constraint. Ignore it. // This is a contraction constraint. Ignore it.
false false
} }
ConstrainRegSubReg(*) => { ConstrainRegSubReg(..) => {
// No region variables involved. Ignore. // No region variables involved. Ignore.
false false
} }
@ -831,7 +831,7 @@ impl RegionVarBindings {
var_data: &mut [VarData]) { var_data: &mut [VarData]) {
self.iterate_until_fixed_point("Contraction", |constraint| { self.iterate_until_fixed_point("Contraction", |constraint| {
match *constraint { match *constraint {
ConstrainRegSubVar(*) => { ConstrainRegSubVar(..) => {
// This is an expansion constraint. Ignore. // This is an expansion constraint. Ignore.
false false
} }
@ -848,7 +848,7 @@ impl RegionVarBindings {
let a_data = &mut var_data[a_vid.to_uint()]; let a_data = &mut var_data[a_vid.to_uint()];
self.contract_node(a_vid, a_data, b_region) self.contract_node(a_vid, a_data, b_region)
} }
ConstrainRegSubReg(*) => { ConstrainRegSubReg(..) => {
// No region variables involved. Ignore. // No region variables involved. Ignore.
false false
} }
@ -934,9 +934,9 @@ impl RegionVarBindings {
{ {
for (constraint, _) in self.constraints.iter() { for (constraint, _) in self.constraints.iter() {
let (sub, sup) = match *constraint { let (sub, sup) = match *constraint {
ConstrainVarSubVar(*) | ConstrainVarSubVar(..) |
ConstrainRegSubVar(*) | ConstrainRegSubVar(..) |
ConstrainVarSubReg(*) => { ConstrainVarSubReg(..) => {
continue; continue;
} }
ConstrainRegSubReg(sub, sup) => { ConstrainRegSubReg(sub, sup) => {
@ -1065,7 +1065,7 @@ impl RegionVarBindings {
dummy_idx, dummy_idx,
*constraint); *constraint);
} }
ConstrainRegSubReg(*) => { ConstrainRegSubReg(..) => {
// Relations between two concrete regions do not // Relations between two concrete regions do not
// require an edge in the graph. // require an edge in the graph.
} }
@ -1214,7 +1214,7 @@ impl RegionVarBindings {
process_edges(self, &mut state, graph, node_idx, dir); 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); return (result, dup_found);
fn process_edges(this: &RegionVarBindings, fn process_edges(this: &RegionVarBindings,
@ -1243,7 +1243,7 @@ impl RegionVarBindings {
}); });
} }
ConstrainRegSubReg(*) => {} ConstrainRegSubReg(..) => {}
} }
true true
}); });

View file

@ -126,14 +126,14 @@ impl Env {
} }
return match it.node { return match it.node {
ast::item_const(*) | ast::item_fn(*) | ast::item_const(..) | ast::item_fn(..) |
ast::item_foreign_mod(*) | ast::item_ty(*) => { ast::item_foreign_mod(..) | ast::item_ty(..) => {
None None
} }
ast::item_enum(*) | ast::item_struct(*) | ast::item_enum(..) | ast::item_struct(..) |
ast::item_trait(*) | ast::item_impl(*) | ast::item_trait(..) | ast::item_impl(..) |
ast::item_mac(*) => { ast::item_mac(..) => {
None None
} }

View file

@ -344,7 +344,7 @@ fn check_main_fn_ty(ccx: &CrateCtxt,
let tcx = ccx.tcx; let tcx = ccx.tcx;
let main_t = ty::node_id_to_type(tcx, main_id); let main_t = ty::node_id_to_type(tcx, main_id);
match ty::get(main_t).sty { match ty::get(main_t).sty {
ty::ty_bare_fn(*) => { ty::ty_bare_fn(..) => {
match tcx.items.find(&main_id) { match tcx.items.find(&main_id) {
Some(&ast_map::node_item(it,_)) => { Some(&ast_map::node_item(it,_)) => {
match it.node { match it.node {

View file

@ -338,7 +338,7 @@ impl<'self> Visitor<()> for TermsContext<'self> {
// tcx, we rely on the fact that all inferreds for a particular // tcx, we rely on the fact that all inferreds for a particular
// item are assigned continuous indices. // item are assigned continuous indices.
match item.node { match item.node {
ast::item_trait(*) => { ast::item_trait(..) => {
self.add_inferred(item.id, SelfParam, 0, item.id); self.add_inferred(item.id, SelfParam, 0, item.id);
} }
_ => { } _ => { }
@ -372,13 +372,13 @@ impl<'self> Visitor<()> for TermsContext<'self> {
visit::walk_item(self, item, ()); visit::walk_item(self, item, ());
} }
ast::item_impl(*) | ast::item_impl(..) |
ast::item_static(*) | ast::item_static(..) |
ast::item_fn(*) | ast::item_fn(..) |
ast::item_mod(*) | ast::item_mod(..) |
ast::item_foreign_mod(*) | ast::item_foreign_mod(..) |
ast::item_ty(*) | ast::item_ty(..) |
ast::item_mac(*) => { ast::item_mac(..) => {
visit::walk_item(self, item, ()); 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); let struct_fields = ty::lookup_struct_fields(tcx, did);
for field_info in struct_fields.iter() { for field_info in struct_fields.iter() {
assert_eq!(field_info.id.crate, ast::LOCAL_CRATE); 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); let methods = ty::trait_methods(tcx, did);
for method in methods.iter() { for method in methods.iter() {
match method.transformed_self_ty { match method.transformed_self_ty {
@ -493,13 +493,13 @@ impl<'self> Visitor<()> for ConstraintContext<'self> {
} }
} }
ast::item_static(*) | ast::item_static(..) |
ast::item_fn(*) | ast::item_fn(..) |
ast::item_mod(*) | ast::item_mod(..) |
ast::item_foreign_mod(*) | ast::item_foreign_mod(..) |
ast::item_ty(*) | ast::item_ty(..) |
ast::item_impl(*) | ast::item_impl(..) |
ast::item_mac(*) => { ast::item_mac(..) => {
visit::walk_item(self, item, ()); visit::walk_item(self, item, ());
} }
} }
@ -659,7 +659,7 @@ impl<'self> ConstraintContext<'self> {
substs, variance); 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); assert_eq!(def_id.crate, ast::LOCAL_CRATE);
match self.terms_cx.inferred_map.find(&def_id.node) { match self.terms_cx.inferred_map.find(&def_id.node) {
Some(&index) => { Some(&index) => {
@ -679,19 +679,19 @@ impl<'self> ConstraintContext<'self> {
self.add_constraint(index, variance); 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); 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); let contra = self.contravariant(variance);
self.add_constraints_from_region(region, contra); self.add_constraints_from_region(region, contra);
self.add_constraints_from_sig(sig, variance); self.add_constraints_from_sig(sig, variance);
} }
ty::ty_infer(*) | ty::ty_err | ty::ty_type | ty::ty_infer(..) | ty::ty_err | ty::ty_type |
ty::ty_opaque_box | ty::ty_opaque_closure_ptr(*) | ty::ty_opaque_box | ty::ty_opaque_closure_ptr(..) |
ty::ty_unboxed_vec(*) => { ty::ty_unboxed_vec(..) => {
self.tcx().sess.bug( self.tcx().sess.bug(
format!("Unexpected type encountered in \ format!("Unexpected type encountered in \
variance inference: {}", variance inference: {}",
@ -770,12 +770,12 @@ impl<'self> ConstraintContext<'self> {
ty::ReStatic => { } ty::ReStatic => { }
ty::ReLateBound(*) => { ty::ReLateBound(..) => {
// We do not infer variance for region parameters on // We do not infer variance for region parameters on
// methods or in fn types. // methods or in fn types.
} }
ty::ReFree(*) | ty::ReScope(*) | ty::ReInfer(*) | ty::ReFree(..) | ty::ReScope(..) | ty::ReInfer(..) |
ty::ReEmpty => { ty::ReEmpty => {
// We don't expect to see anything but 'static or bound // We don't expect to see anything but 'static or bound
// regions when visiting member types or method types. // regions when visiting member types or method types.
@ -822,7 +822,7 @@ struct SolveContext<'self> {
} }
fn solve_constraints(constraints_cx: ConstraintContext) { 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 solutions = vec::from_elem(terms_cx.num_inferred(), ty::Bivariant);
let mut solutions_cx = SolveContext { let mut solutions_cx = SolveContext {
terms_cx: terms_cx, terms_cx: terms_cx,

View file

@ -71,7 +71,7 @@ impl<'self> Visitor<()> for LoopQueryVisitor<'self> {
match e.node { match e.node {
// Skip inner loops, since a break in the inner loop isn't a // Skip inner loops, since a break in the inner loop isn't a
// break inside the outer loop // break inside the outer loop
ast::ExprLoop(*) | ast::ExprWhile(*) => {} ast::ExprLoop(..) | ast::ExprWhile(..) => {}
_ => visit::walk_expr(self, e, ()) _ => visit::walk_expr(self, e, ())
} }
} }

View file

@ -81,11 +81,11 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region)
} }
Some(&ast_map::node_expr(expr)) => { Some(&ast_map::node_expr(expr)) => {
match expr.node { match expr.node {
ast::ExprCall(*) => explain_span(cx, "call", expr.span), ast::ExprCall(..) => explain_span(cx, "call", expr.span),
ast::ExprMethodCall(*) => { ast::ExprMethodCall(..) => {
explain_span(cx, "method call", expr.span) 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) _ => 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) explain_span(cx, "statement", stmt.span)
} }
Some(&ast_map::node_item(it, _)) if (match it.node { 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) explain_span(cx, "function body", it.span)
} }
Some(_) | None => { Some(_) | None => {
@ -119,7 +119,7 @@ pub fn explain_region_and_span(cx: ctxt, region: ty::Region)
(format!("{} {}", prefix, msg), opt_span) (format!("{} {}", prefix, msg), opt_span)
} }
Some(&ast_map::node_item(it, _)) if match it.node { 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); let (msg, opt_span) = explain_span(cx, "impl", it.span);
(format!("{} {}", prefix, msg), opt_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, // I believe these cases should not occur (except when debugging,
// perhaps) // perhaps)
ty::ReInfer(_) | ty::ReEarlyBound(*) | ty::ReLateBound(*) => { ty::ReInfer(_) | ty::ReEarlyBound(..) | ty::ReLateBound(..) => {
(format!("lifetime {:?}", region), None) (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)) => { Some(&ast_map::node_expr(expr)) => {
match expr.node { match expr.node {
ast::ExprCall(*) => { ast::ExprCall(..) => {
format!("<call at {}>", format!("<call at {}>",
cx.sess.codemap.span_to_str(expr.span)) cx.sess.codemap.span_to_str(expr.span))
} }
ast::ExprMatch(*) => { ast::ExprMatch(..) => {
format!("<match at {}>", format!("<match at {}>",
cx.sess.codemap.span_to_str(expr.span)) cx.sess.codemap.span_to_str(expr.span))
} }
ast::ExprAssignOp(*) | ast::ExprAssignOp(..) |
ast::ExprUnary(*) | ast::ExprUnary(..) |
ast::ExprBinary(*) | ast::ExprBinary(..) |
ast::ExprIndex(*) => { ast::ExprIndex(..) => {
format!("<method at {}>", format!("<method at {}>",
cx.sess.codemap.span_to_str(expr.span)) 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) } 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) => { ty_enum(did, ref substs) | ty_struct(did, ref substs) => {
let path = ty::item_path(cx, did); let path = ty::item_path(cx, did);
let base = ast_map::path_to_str(path, cx.sess.intr()); 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 // and otherwise fallback to just printing the crate/node pair
if self.crate == ast::LOCAL_CRATE { if self.crate == ast::LOCAL_CRATE {
match tcx.items.find(&self.node) { match tcx.items.find(&self.node) {
Some(&ast_map::node_item(*)) | Some(&ast_map::node_item(..)) |
Some(&ast_map::node_foreign_item(*)) | Some(&ast_map::node_foreign_item(..)) |
Some(&ast_map::node_method(*)) | Some(&ast_map::node_method(..)) |
Some(&ast_map::node_trait_method(*)) | Some(&ast_map::node_trait_method(..)) |
Some(&ast_map::node_variant(*)) | Some(&ast_map::node_variant(..)) |
Some(&ast_map::node_struct_ctor(*)) => { Some(&ast_map::node_struct_ctor(..)) => {
return format!("{:?}:{}", *self, ty::item_path_str(tcx, *self)); return format!("{:?}:{}", *self, ty::item_path_str(tcx, *self));
} }
_ => {} _ => {}

View file

@ -151,19 +151,19 @@ impl Item {
} }
pub fn is_mod(&self) -> bool { pub fn is_mod(&self) -> bool {
match self.inner { ModuleItem(*) => true, _ => false } match self.inner { ModuleItem(..) => true, _ => false }
} }
pub fn is_trait(&self) -> bool { pub fn is_trait(&self) -> bool {
match self.inner { TraitItem(*) => true, _ => false } match self.inner { TraitItem(..) => true, _ => false }
} }
pub fn is_struct(&self) -> bool { pub fn is_struct(&self) -> bool {
match self.inner { StructItem(*) => true, _ => false } match self.inner { StructItem(..) => true, _ => false }
} }
pub fn is_enum(&self) -> bool { pub fn is_enum(&self) -> bool {
match self.inner { EnumItem(*) => true, _ => false } match self.inner { EnumItem(..) => true, _ => false }
} }
pub fn is_fn(&self) -> bool { 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 { impl TraitMethod {
pub fn is_req(&self) -> bool { pub fn is_req(&self) -> bool {
match self { match self {
&Required(*) => true, &Required(..) => true,
_ => false, _ => false,
} }
} }
pub fn is_def(&self) -> bool { pub fn is_def(&self) -> bool {
match self { match self {
&Provided(*) => true, &Provided(..) => true,
_ => false, _ => false,
} }
} }
@ -1140,17 +1140,17 @@ fn name_from_pat(p: &ast::Pat) -> ~str {
PatWildMulti => ~"..", PatWildMulti => ~"..",
PatIdent(_, ref p, _) => path_to_str(p), PatIdent(_, ref p, _) => path_to_str(p),
PatEnum(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"), which is not allowed in function arguments"),
PatTup(*) => ~"(tuple arg NYI)", PatTup(..) => ~"(tuple arg NYI)",
PatBox(p) => name_from_pat(p), PatBox(p) => name_from_pat(p),
PatUniq(p) => name_from_pat(p), PatUniq(p) => name_from_pat(p),
PatRegion(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"), 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"), 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") which is not allowed in function arguments")
} }
} }

View file

@ -73,7 +73,7 @@ fn get_ast_and_resolve(cpath: &Path,
let mut crate = phase_1_parse_input(sess, cfg.clone(), &input); let mut crate = phase_1_parse_input(sess, cfg.clone(), &input);
crate = phase_2_configure_and_expand(sess, cfg, crate); crate = phase_2_configure_and_expand(sess, cfg, crate);
let driver::driver::CrateAnalysis { let driver::driver::CrateAnalysis {
exported_items, ty_cx, _ exported_items, ty_cx, ..
} = phase_3_run_analysis_passes(sess, &crate); } = phase_3_run_analysis_passes(sess, &crate);
debug!("crate: {:?}", crate); debug!("crate: {:?}", crate);

View file

@ -277,7 +277,7 @@ impl fmt::Default for clean::Type {
external_path(f.buf, path, false, fqn.as_slice(), kind, crate); external_path(f.buf, path, false, fqn.as_slice(), kind, crate);
typarams(f.buf, tp); typarams(f.buf, tp);
} }
clean::Self(*) => f.buf.write("Self".as_bytes()), clean::Self(..) => f.buf.write("Self".as_bytes()),
clean::Primitive(prim) => { clean::Primitive(prim) => {
let s = match prim { let s = match prim {
ast::ty_int(ast::ty_i) => "int", ast::ty_int(ast::ty_i) => "int",

View file

@ -423,7 +423,7 @@ impl<'self> SourceCollector<'self> {
let mut r = match io::result(|| File::open(&p)) { let mut r = match io::result(|| File::open(&p)) {
Ok(r) => r, Ok(r) => r,
// eew macro hacks // eew macro hacks
Err(*) => return filename == "<std-macros>" Err(..) => return filename == "<std-macros>"
}; };
// read everything // read everything
@ -491,12 +491,12 @@ impl DocFolder for Cache {
match item.inner { match item.inner {
clean::ImplItem(ref i) => { clean::ImplItem(ref i) => {
match i.trait_ { match i.trait_ {
Some(clean::ResolvedPath{ id, _ }) => { Some(clean::ResolvedPath{ id, .. }) => {
let v = self.implementors.find_or_insert_with(id, |_|{ let v = self.implementors.find_or_insert_with(id, |_|{
~[] ~[]
}); });
match i.for_ { match i.for_ {
clean::ResolvedPath{_} => { clean::ResolvedPath{..} => {
v.unshift(PathType(i.for_.clone())); 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 { match item.name {
Some(ref s) => { Some(ref s) => {
let parent = match item.inner { let parent = match item.inner {
clean::TyMethodItem(*) | clean::TyMethodItem(..) |
clean::StructFieldItem(*) | clean::StructFieldItem(..) |
clean::VariantItem(*) => { clean::VariantItem(..) => {
Some((Some(*self.parent_stack.last()), Some((Some(*self.parent_stack.last()),
self.stack.slice_to(self.stack.len() - 1))) self.stack.slice_to(self.stack.len() - 1)))
} }
clean::MethodItem(*) => { clean::MethodItem(..) => {
if self.parent_stack.len() == 0 { if self.parent_stack.len() == 0 {
None None
} else { } else {
let last = self.parent_stack.last(); let last = self.parent_stack.last();
let amt = match self.paths.find(last) { let amt = match self.paths.find(last) {
Some(&(_, "trait")) => self.stack.len() - 1, Some(&(_, "trait")) => self.stack.len() - 1,
Some(*) | None => self.stack.len(), Some(..) | None => self.stack.len(),
}; };
Some((Some(*last), self.stack.slice_to(amt))) Some((Some(*last), self.stack.slice_to(amt)))
} }
@ -562,10 +562,10 @@ impl DocFolder for Cache {
} else { false } } else { false }
} else { false }; } else { false };
match item.inner { match item.inner {
clean::StructItem(*) | clean::EnumItem(*) | clean::StructItem(..) | clean::EnumItem(..) |
clean::TypedefItem(*) | clean::TraitItem(*) | clean::TypedefItem(..) | clean::TraitItem(..) |
clean::FunctionItem(*) | clean::ModuleItem(*) | clean::FunctionItem(..) | clean::ModuleItem(..) |
clean::ForeignFunctionItem(*) | clean::VariantItem(*) => { clean::ForeignFunctionItem(..) | clean::VariantItem(..) => {
self.paths.insert(item.id, (self.stack.clone(), shortty(&item))); self.paths.insert(item.id, (self.stack.clone(), shortty(&item)));
} }
_ => {} _ => {}
@ -573,12 +573,12 @@ impl DocFolder for Cache {
// Maintain the parent stack // Maintain the parent stack
let parent_pushed = match item.inner { 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 self.parent_stack.push(item.id); true
} }
clean::ImplItem(ref i) => { clean::ImplItem(ref i) => {
match i.for_ { match i.for_ {
clean::ResolvedPath{ id, _ } => { clean::ResolvedPath{ id, .. } => {
self.parent_stack.push(id); true self.parent_stack.push(id); true
} }
_ => false _ => false
@ -592,9 +592,9 @@ impl DocFolder for Cache {
let ret = match self.fold_item_recur(item) { let ret = match self.fold_item_recur(item) {
Some(item) => { Some(item) => {
match item { match item {
clean::Item{ attrs, inner: clean::ImplItem(i), _ } => { clean::Item{ attrs, inner: clean::ImplItem(i), .. } => {
match i.for_ { match i.for_ {
clean::ResolvedPath { id, _ } => { clean::ResolvedPath { id, .. } => {
let v = self.impls.find_or_insert_with(id, |_| { let v = self.impls.find_or_insert_with(id, |_| {
~[] ~[]
}); });
@ -608,7 +608,7 @@ impl DocFolder for Cache {
Some(clean::NameValue(_, dox)) => { Some(clean::NameValue(_, dox)) => {
v.push((i, Some(dox))); v.push((i, Some(dox)));
} }
Some(*) | None => { Some(..) | None => {
v.push((i, None)); v.push((i, None));
} }
} }
@ -620,7 +620,7 @@ impl DocFolder for Cache {
// Private modules may survive the strip-private pass if // Private modules may survive the strip-private pass if
// they contain impls for public types, but those will get // they contain impls for public types, but those will get
// stripped here // stripped here
clean::Item { inner: clean::ModuleItem(ref m), _ } clean::Item { inner: clean::ModuleItem(ref m), .. }
if m.items.len() == 0 => None, if m.items.len() == 0 => None,
i => Some(i), i => Some(i),
} }
@ -800,7 +800,7 @@ impl Context {
match item.inner { match item.inner {
// modules are special because they add a namespace. We also need to // modules are special because they add a namespace. We also need to
// recurse into the items of the module as well. // recurse into the items of the module as well.
clean::ModuleItem(*) => { clean::ModuleItem(..) => {
let name = item.name.get_ref().to_owned(); let name = item.name.get_ref().to_owned();
let item = Cell::new(item); let item = Cell::new(item);
self.recurse(name, |this| { self.recurse(name, |this| {
@ -833,28 +833,28 @@ impl Context {
fn shortty(item: &clean::Item) -> &'static str { fn shortty(item: &clean::Item) -> &'static str {
match item.inner { match item.inner {
clean::ModuleItem(*) => "mod", clean::ModuleItem(..) => "mod",
clean::StructItem(*) => "struct", clean::StructItem(..) => "struct",
clean::EnumItem(*) => "enum", clean::EnumItem(..) => "enum",
clean::FunctionItem(*) => "fn", clean::FunctionItem(..) => "fn",
clean::TypedefItem(*) => "typedef", clean::TypedefItem(..) => "typedef",
clean::StaticItem(*) => "static", clean::StaticItem(..) => "static",
clean::TraitItem(*) => "trait", clean::TraitItem(..) => "trait",
clean::ImplItem(*) => "impl", clean::ImplItem(..) => "impl",
clean::ViewItemItem(*) => "viewitem", clean::ViewItemItem(..) => "viewitem",
clean::TyMethodItem(*) => "tymethod", clean::TyMethodItem(..) => "tymethod",
clean::MethodItem(*) => "method", clean::MethodItem(..) => "method",
clean::StructFieldItem(*) => "structfield", clean::StructFieldItem(..) => "structfield",
clean::VariantItem(*) => "variant", clean::VariantItem(..) => "variant",
clean::ForeignFunctionItem(*) => "ffi", clean::ForeignFunctionItem(..) => "ffi",
clean::ForeignStaticItem(*) => "ffs", clean::ForeignStaticItem(..) => "ffs",
} }
} }
impl<'self> Item<'self> { impl<'self> Item<'self> {
fn ismodule(&self) -> bool { fn ismodule(&self) -> bool {
match self.item.inner { 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 the breadcrumb trail header for the top
write!(fmt.buf, "<h1 class='fqn'>"); write!(fmt.buf, "<h1 class='fqn'>");
match it.item.inner { match it.item.inner {
clean::ModuleItem(*) => write!(fmt.buf, "Module "), clean::ModuleItem(..) => write!(fmt.buf, "Module "),
clean::FunctionItem(*) => write!(fmt.buf, "Function "), clean::FunctionItem(..) => write!(fmt.buf, "Function "),
clean::TraitItem(*) => write!(fmt.buf, "Trait "), clean::TraitItem(..) => write!(fmt.buf, "Trait "),
clean::StructItem(*) => write!(fmt.buf, "Struct "), clean::StructItem(..) => write!(fmt.buf, "Struct "),
clean::EnumItem(*) => write!(fmt.buf, "Enum "), clean::EnumItem(..) => write!(fmt.buf, "Enum "),
_ => {} _ => {}
} }
let cur = it.cx.current.as_slice(); 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 { fn item_path(item: &clean::Item) -> ~str {
match item.inner { 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" _ => shortty(item) + "." + *item.name.get_ref() + ".html"
} }
} }
@ -982,31 +982,31 @@ fn item_module(w: &mut Writer, cx: &Context,
match (&i1.inner, &i2.inner) { match (&i1.inner, &i2.inner) {
(&clean::ViewItemItem(ref a), &clean::ViewItemItem(ref b)) => { (&clean::ViewItemItem(ref a), &clean::ViewItemItem(ref b)) => {
match (&a.inner, &b.inner) { match (&a.inner, &b.inner) {
(&clean::ExternMod(*), _) => true, (&clean::ExternMod(..), _) => true,
(_, &clean::ExternMod(*)) => false, (_, &clean::ExternMod(..)) => false,
_ => idx1 < idx2, _ => idx1 < idx2,
} }
} }
(&clean::ViewItemItem(*), _) => true, (&clean::ViewItemItem(..), _) => true,
(_, &clean::ViewItemItem(*)) => false, (_, &clean::ViewItemItem(..)) => false,
(&clean::ModuleItem(*), _) => true, (&clean::ModuleItem(..), _) => true,
(_, &clean::ModuleItem(*)) => false, (_, &clean::ModuleItem(..)) => false,
(&clean::StructItem(*), _) => true, (&clean::StructItem(..), _) => true,
(_, &clean::StructItem(*)) => false, (_, &clean::StructItem(..)) => false,
(&clean::EnumItem(*), _) => true, (&clean::EnumItem(..), _) => true,
(_, &clean::EnumItem(*)) => false, (_, &clean::EnumItem(..)) => false,
(&clean::StaticItem(*), _) => true, (&clean::StaticItem(..), _) => true,
(_, &clean::StaticItem(*)) => false, (_, &clean::StaticItem(..)) => false,
(&clean::ForeignFunctionItem(*), _) => true, (&clean::ForeignFunctionItem(..), _) => true,
(_, &clean::ForeignFunctionItem(*)) => false, (_, &clean::ForeignFunctionItem(..)) => false,
(&clean::ForeignStaticItem(*), _) => true, (&clean::ForeignStaticItem(..), _) => true,
(_, &clean::ForeignStaticItem(*)) => false, (_, &clean::ForeignStaticItem(..)) => false,
(&clean::TraitItem(*), _) => true, (&clean::TraitItem(..), _) => true,
(_, &clean::TraitItem(*)) => false, (_, &clean::TraitItem(..)) => false,
(&clean::FunctionItem(*), _) => true, (&clean::FunctionItem(..), _) => true,
(_, &clean::FunctionItem(*)) => false, (_, &clean::FunctionItem(..)) => false,
(&clean::TypedefItem(*), _) => true, (&clean::TypedefItem(..), _) => true,
(_, &clean::TypedefItem(*)) => false, (_, &clean::TypedefItem(..)) => false,
_ => idx1 < idx2, _ => idx1 < idx2,
} }
} }
@ -1026,21 +1026,21 @@ fn item_module(w: &mut Writer, cx: &Context,
} }
curty = myty; curty = myty;
write!(w, "<h2>{}</h2>\n<table>", match myitem.inner { write!(w, "<h2>{}</h2>\n<table>", match myitem.inner {
clean::ModuleItem(*) => "Modules", clean::ModuleItem(..) => "Modules",
clean::StructItem(*) => "Structs", clean::StructItem(..) => "Structs",
clean::EnumItem(*) => "Enums", clean::EnumItem(..) => "Enums",
clean::FunctionItem(*) => "Functions", clean::FunctionItem(..) => "Functions",
clean::TypedefItem(*) => "Type Definitions", clean::TypedefItem(..) => "Type Definitions",
clean::StaticItem(*) => "Statics", clean::StaticItem(..) => "Statics",
clean::TraitItem(*) => "Traits", clean::TraitItem(..) => "Traits",
clean::ImplItem(*) => "Implementations", clean::ImplItem(..) => "Implementations",
clean::ViewItemItem(*) => "Reexports", clean::ViewItemItem(..) => "Reexports",
clean::TyMethodItem(*) => "Type Methods", clean::TyMethodItem(..) => "Type Methods",
clean::MethodItem(*) => "Methods", clean::MethodItem(..) => "Methods",
clean::StructFieldItem(*) => "Struct Fields", clean::StructFieldItem(..) => "Struct Fields",
clean::VariantItem(*) => "Variants", clean::VariantItem(..) => "Variants",
clean::ForeignFunctionItem(*) => "Foreign Functions", clean::ForeignFunctionItem(..) => "Foreign Functions",
clean::ForeignStaticItem(*) => "Foreign Statics", clean::ForeignStaticItem(..) => "Foreign Statics",
}); });
} }
@ -1450,7 +1450,7 @@ fn render_impl(w: &mut Writer, i: &clean::Impl, dox: &Option<~str>) {
Some(ref ty) => { Some(ref ty) => {
write!(w, "{} for ", *ty); write!(w, "{} for ", *ty);
match *ty { match *ty {
clean::ResolvedPath { id, _ } => Some(id), clean::ResolvedPath { id, .. } => Some(id),
_ => None, _ => None,
} }
} }
@ -1527,7 +1527,7 @@ fn render_impl(w: &mut Writer, i: &clean::Impl, dox: &Option<~str>) {
for method in t.methods.iter() { for method in t.methods.iter() {
let n = method.item().name.clone(); let n = method.item().name.clone();
match i.methods.iter().find(|m| m.name == n) { match i.methods.iter().find(|m| m.name == n) {
Some(*) => continue, Some(..) => continue,
None => {} None => {}
} }

View file

@ -278,7 +278,7 @@ fn json_input(input: &str) -> Result<Output, ~str> {
version {}", SCHEMA_VERSION)) version {}", SCHEMA_VERSION))
} }
} }
Some(*) => return Err(~"malformed json"), Some(..) => return Err(~"malformed json"),
None => return Err(~"expected a schema version"), None => return Err(~"expected a schema version"),
} }
let crate = match obj.pop(&~"crate") { let crate = match obj.pop(&~"crate") {
@ -293,7 +293,7 @@ fn json_input(input: &str) -> Result<Output, ~str> {
let plugin_output = ~[]; let plugin_output = ~[];
Ok((crate, 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"),
} }
} }

View file

@ -88,39 +88,39 @@ impl<'self> fold::DocFolder for Stripper<'self> {
fn fold_item(&mut self, i: Item) -> Option<Item> { fn fold_item(&mut self, i: Item) -> Option<Item> {
match i.inner { match i.inner {
// These items can all get re-exported // These items can all get re-exported
clean::TypedefItem(*) | clean::StaticItem(*) | clean::TypedefItem(..) | clean::StaticItem(..) |
clean::StructItem(*) | clean::EnumItem(*) | clean::StructItem(..) | clean::EnumItem(..) |
clean::TraitItem(*) | clean::FunctionItem(*) | clean::TraitItem(..) | clean::FunctionItem(..) |
clean::VariantItem(*) | clean::MethodItem(*) | clean::VariantItem(..) | clean::MethodItem(..) |
clean::ForeignFunctionItem(*) | clean::ForeignStaticItem(*) => { clean::ForeignFunctionItem(..) | clean::ForeignStaticItem(..) => {
if !self.exported_items.contains(&i.id) { if !self.exported_items.contains(&i.id) {
return None; return None;
} }
} }
clean::ViewItemItem(*) => { clean::ViewItemItem(..) => {
if i.visibility != Some(ast::public) { if i.visibility != Some(ast::public) {
return None return None
} }
} }
clean::StructFieldItem(*) => { clean::StructFieldItem(..) => {
if i.visibility == Some(ast::private) { if i.visibility == Some(ast::private) {
return None; return None;
} }
} }
// handled below // handled below
clean::ModuleItem(*) => {} clean::ModuleItem(..) => {}
// impls/tymethods have no control over privacy // impls/tymethods have no control over privacy
clean::ImplItem(*) | clean::TyMethodItem(*) => {} clean::ImplItem(..) | clean::TyMethodItem(..) => {}
} }
let fastreturn = match i.inner { let fastreturn = match i.inner {
// nothing left to do for traits (don't want to filter their // nothing left to do for traits (don't want to filter their
// methods out, visibility controlled by the trait) // methods out, visibility controlled by the trait)
clean::TraitItem(*) => true, clean::TraitItem(..) => true,
// implementations of traits are always public. // implementations of traits are always public.
clean::ImplItem(ref imp) if imp.trait_.is_some() => true, clean::ImplItem(ref imp) if imp.trait_.is_some() => true,
@ -159,12 +159,12 @@ impl<'self> fold::DocFolder for ImplStripper<'self> {
match i.inner { match i.inner {
clean::ImplItem(ref imp) => { clean::ImplItem(ref imp) => {
match imp.trait_ { match imp.trait_ {
Some(clean::ResolvedPath{ id, _ }) => { Some(clean::ResolvedPath{ id, .. }) => {
if !self.contains(&id) { if !self.contains(&id) {
return None; return None;
} }
} }
Some(*) | None => {} Some(..) | None => {}
} }
} }
_ => {} _ => {}

View file

@ -233,7 +233,7 @@ impl CtxMethods for BuildContext {
self.build(&mut pkg_src, what); self.build(&mut pkg_src, what);
match pkg_src { match pkg_src {
PkgSrc { destination_workspace: ws, PkgSrc { destination_workspace: ws,
id: id, _ } => { id: id, .. } => {
Some((id, ws)) Some((id, ws))
} }
} }
@ -244,7 +244,7 @@ impl CtxMethods for BuildContext {
self.build(&mut pkg_src, what); self.build(&mut pkg_src, what);
match pkg_src { match pkg_src {
PkgSrc { destination_workspace: ws, PkgSrc { destination_workspace: ws,
id: id, _ } => { id: id, .. } => {
Some((id, ws)) Some((id, ws))
} }
} }

View file

@ -146,7 +146,7 @@ impl PkgSrc {
source_workspace: source, source_workspace: source,
destination_workspace: destination, destination_workspace: destination,
start_dir: start, start_dir: start,
id: id, _ } => { id: id, .. } => {
let result = PkgSrc { let result = PkgSrc {
source_workspace: source.clone(), source_workspace: source.clone(),
build_in_destination: build_in_destination, build_in_destination: build_in_destination,

View file

@ -1091,7 +1091,7 @@ fn no_rebuilding() {
command_line_test([~"build", ~"foo"], workspace); command_line_test([~"build", ~"foo"], workspace);
match command_line_test_partial([~"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(ref status) if status.status.matches_exit_status(65) =>
fail!("no_rebuilding failed: it tried to rebuild bar"), fail!("no_rebuilding failed: it tried to rebuild bar"),
Fail(_) => fail!("no_rebuilding failed for some other reason") Fail(_) => fail!("no_rebuilding failed for some other reason")
@ -1110,7 +1110,7 @@ fn no_recopying() {
assert!(chmod_read_only(&foo_lib.unwrap())); assert!(chmod_read_only(&foo_lib.unwrap()));
match command_line_test_partial([~"install", ~"foo"], workspace) { match command_line_test_partial([~"install", ~"foo"], workspace) {
Success(*) => (), // ok Success(..) => (), // ok
Fail(ref status) if status.status.matches_exit_status(65) => Fail(ref status) if status.status.matches_exit_status(65) =>
fail!("no_recopying failed: it tried to re-copy foo"), fail!("no_recopying failed: it tried to re-copy foo"),
Fail(_) => fail!("no_copying failed for some other reason") 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 // Now make `bar` read-only so that subsequent rebuilds of it will fail
assert!(chmod_read_only(&bar_lib)); assert!(chmod_read_only(&bar_lib));
match command_line_test_partial([~"build", ~"foo"], workspace) { match command_line_test_partial([~"build", ~"foo"], workspace) {
Success(*) => (), // ok Success(..) => (), // ok
Fail(ref r) if r.status.matches_exit_status(65) => Fail(ref r) if r.status.matches_exit_status(65) =>
fail!("no_rebuilding_dep failed: it tried to rebuild bar"), fail!("no_rebuilding_dep failed: it tried to rebuild bar"),
Fail(_) => fail!("no_rebuilding_dep failed for some other reason") 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)); assert!(chmod_read_only(&bar_lib_name));
match command_line_test_partial([~"build", ~"foo"], workspace) { 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(ref r) if r.status.matches_exit_status(65) => (), // ok
Fail(_) => fail!("do_rebuild_dep_dates_change failed for some other reason") 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 // should adjust the datestamp
match command_line_test_partial([~"build", ~"foo"], workspace) { 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(ref r) if r.status.matches_exit_status(65) => (), // ok
Fail(_) => fail!("do_rebuild_dep_only_contents_change failed for some other reason") Fail(_) => fail!("do_rebuild_dep_only_contents_change failed for some other reason")
} }
@ -1729,7 +1729,7 @@ fn test_cfg_fail() {
~"build", ~"build",
~"foo"], ~"foo"],
workspace) { 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); let res = command_line_test_partial([~"test", ~"foo"], foo_workspace);
match res { match res {
Fail(_) => {}, 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"); frob_source_file(foo_workspace, &foo_id, "test.rs");
chmod_read_only(&test_executable); chmod_read_only(&test_executable);
match command_line_test_partial([~"test", ~"foo"], foo_workspace) { 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(ref r) if r.status.matches_exit_status(65) => (), // ok
Fail(_) => fail!("test_rebuild_when_needed failed for some other reason") 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"); foo_workspace).expect("test_no_rebuilding failed");
chmod_read_only(&test_executable); chmod_read_only(&test_executable);
match command_line_test_partial([~"test", ~"foo"], foo_workspace) { match command_line_test_partial([~"test", ~"foo"], foo_workspace) {
Success(*) => (), // ok Success(..) => (), // ok
Fail(ref r) if r.status.matches_exit_status(65) => Fail(ref r) if r.status.matches_exit_status(65) =>
fail!("test_no_rebuilding failed: it rebuilt the tests"), fail!("test_no_rebuilding failed: it rebuilt the tests"),
Fail(_) => fail!("test_no_rebuilding failed for some other reason") 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!(); } }"); writeFile(&main_crate, "pub fn main() { if 42 != ~\"the answer\" { fail!(); } }");
let result = command_line_test_partial([~"build", ~"foo"], foo_workspace); let result = command_line_test_partial([~"build", ~"foo"], foo_workspace);
match result { 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) => { Fail(ref status) => {
debug!("Failed with status {:?}... that's good, right?", 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)); assert!(chmod_read_only(&c_library_path));
match command_line_test_partial([~"build", ~"cdep"], dir) { match command_line_test_partial([~"build", ~"cdep"], dir) {
Success(*) => (), // ok Success(..) => (), // ok
Fail(ref r) if r.status.matches_exit_status(65) => Fail(ref r) if r.status.matches_exit_status(65) =>
fail!("test_c_dependency_no_rebuilding failed: \ fail!("test_c_dependency_no_rebuilding failed: \
it tried to rebuild foo.c"), it tried to rebuild foo.c"),
@ -2401,7 +2401,7 @@ fn test_c_dependency_yes_rebuilding() {
} }
match command_line_test_partial([~"build", ~"cdep"], dir) { 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"), it didn't rebuild and should have"),
Fail(ref r) if r.status.matches_exit_status(65) => (), Fail(ref r) if r.status.matches_exit_status(65) => (),
Fail(_) => fail!("test_c_dependency_yes_rebuilding failed for some other reason") Fail(_) => fail!("test_c_dependency_yes_rebuilding failed for some other reason")
@ -2421,7 +2421,7 @@ fn correct_error_dependency() {
fn main() {}"); fn main() {}");
match command_line_test_partial([~"build", ~"badpkg"], dir) { 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(error));
assert!(str::is_utf8(output)); assert!(str::is_utf8(output));
let error_str = str::from_utf8(error); let error_str = str::from_utf8(error);
@ -2436,7 +2436,7 @@ fn correct_error_dependency() {
fail!("Wrong error"); fail!("Wrong error");
} }
} }
Success(*) => fail!("Test passed when it should have failed") Success(..) => fail!("Test passed when it should have failed")
} }
} }

View file

@ -649,7 +649,7 @@ pub fn datestamp(p: &Path) -> Option<libc::time_t> {
debug!("Date = {:?}", out); debug!("Date = {:?}", out);
Some(out as libc::time_t) Some(out as libc::time_t)
} }
Err(*) => None, Err(..) => None,
} }
} }

View file

@ -44,8 +44,6 @@ via `close` and `delete` methods.
#[crate_type = "lib"]; #[crate_type = "lib"];
#[feature(macro_rules, globs)]; #[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::transmute;
use std::cast; use std::cast;

View file

@ -36,8 +36,8 @@ use uvll::sockaddr;
fn socket_addr_as_sockaddr<T>(addr: SocketAddr, f: |*sockaddr| -> T) -> T { fn socket_addr_as_sockaddr<T>(addr: SocketAddr, f: |*sockaddr| -> T) -> T {
let malloc = match addr.ip { let malloc = match addr.ip {
Ipv4Addr(*) => uvll::rust_malloc_ip4_addr, Ipv4Addr(..) => uvll::rust_malloc_ip4_addr,
Ipv6Addr(*) => uvll::rust_malloc_ip6_addr, Ipv6Addr(..) => uvll::rust_malloc_ip6_addr,
}; };
let ip = addr.ip.to_str(); let ip = addr.ip.to_str();
@ -667,7 +667,7 @@ mod test {
#[test] #[test]
fn connect_close_ip4() { fn connect_close_ip4() {
match TcpWatcher::connect(local_loop(), next_test_ip4()) { match TcpWatcher::connect(local_loop(), next_test_ip4()) {
Ok(*) => fail!(), Ok(..) => fail!(),
Err(e) => assert_eq!(e.name(), ~"ECONNREFUSED"), Err(e) => assert_eq!(e.name(), ~"ECONNREFUSED"),
} }
} }
@ -675,7 +675,7 @@ mod test {
#[test] #[test]
fn connect_close_ip6() { fn connect_close_ip6() {
match TcpWatcher::connect(local_loop(), next_test_ip6()) { match TcpWatcher::connect(local_loop(), next_test_ip6()) {
Ok(*) => fail!(), Ok(..) => fail!(),
Err(e) => assert_eq!(e.name(), ~"ECONNREFUSED"), Err(e) => assert_eq!(e.name(), ~"ECONNREFUSED"),
} }
} }
@ -683,16 +683,16 @@ mod test {
#[test] #[test]
fn udp_bind_close_ip4() { fn udp_bind_close_ip4() {
match UdpWatcher::bind(local_loop(), next_test_ip4()) { match UdpWatcher::bind(local_loop(), next_test_ip4()) {
Ok(*) => {} Ok(..) => {}
Err(*) => fail!() Err(..) => fail!()
} }
} }
#[test] #[test]
fn udp_bind_close_ip6() { fn udp_bind_close_ip6() {
match UdpWatcher::bind(local_loop(), next_test_ip6()) { match UdpWatcher::bind(local_loop(), next_test_ip6()) {
Ok(*) => {} Ok(..) => {}
Err(*) => fail!() Err(..) => fail!()
} }
} }

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