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