Skip to content

Commit bf6964e

Browse files
committed
auto merge of #10709 : alexcrichton/rust/snapshot, r=pcwalton
2 parents 90d06ec + ab387a6 commit bf6964e

File tree

182 files changed

+1287
-1334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+1287
-1334
lines changed

doc/rust.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ expression*, which is the value to compare to the patterns. The type of the
28202820
patterns must equal the type of the head expression.
28212821

28222822
In a pattern whose head expression has an `enum` type, a placeholder (`_`) stands for a
2823-
*single* data field, whereas a wildcard `*` stands for *all* the fields of a particular
2823+
*single* data field, whereas a wildcard `..` stands for *all* the fields of a particular
28242824
variant. For example:
28252825

28262826
~~~~
@@ -2830,15 +2830,15 @@ let x: List<int> = Cons(10, @Cons(11, @Nil));
28302830
28312831
match x {
28322832
Cons(_, @Nil) => fail!("singleton list"),
2833-
Cons(*) => return,
2833+
Cons(..) => return,
28342834
Nil => fail!("empty list")
28352835
}
28362836
~~~~
28372837

28382838
The first pattern matches lists constructed by applying `Cons` to any head value, and a
28392839
tail value of `@Nil`. The second pattern matches _any_ list constructed with `Cons`,
28402840
ignoring the values of its arguments. The difference between `_` and `*` is that the pattern `C(_)` is only type-correct if
2841-
`C` has exactly one argument, while the pattern `C(*)` is type-correct for any enum variant `C`, regardless of how many arguments `C` has.
2841+
`C` has exactly one argument, while the pattern `C(..)` is type-correct for any enum variant `C`, regardless of how many arguments `C` has.
28422842

28432843
To execute an `match` expression, first the head expression is evaluated, then
28442844
its value is sequentially compared to the patterns in the arms until a match

doc/tutorial.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -606,16 +606,16 @@ match mypoint {
606606

607607
In general, the field names of a struct do not have to appear in the same
608608
order they appear in the type. When you are not interested in all
609-
the fields of a struct, a struct pattern may end with `, _` (as in
610-
`Name { field1, _ }`) to indicate that you're ignoring all other fields.
609+
the fields of a struct, a struct pattern may end with `, ..` (as in
610+
`Name { field1, .. }`) to indicate that you're ignoring all other fields.
611611
Additionally, struct fields have a shorthand matching form that simply
612612
reuses the field name as the binding name.
613613

614614
~~~
615615
# struct Point { x: f64, y: f64 }
616616
# let mypoint = Point { x: 0.0, y: 0.0 };
617617
match mypoint {
618-
Point { x, _ } => { println(x.to_str()) }
618+
Point { x, .. } => { println(x.to_str()) }
619619
}
620620
~~~
621621

@@ -696,7 +696,7 @@ fn area(sh: Shape) -> f64 {
696696
~~~~
697697

698698
You can write a lone `_` to ignore an individual field, and can
699-
ignore all fields of a variant like: `Circle(*)`. As in their
699+
ignore all fields of a variant like: `Circle(..)`. As in their
700700
introduction form, nullary enum patterns are written without
701701
parentheses.
702702

@@ -725,7 +725,7 @@ enum Shape {
725725
}
726726
fn area(sh: Shape) -> f64 {
727727
match sh {
728-
Circle { radius: radius, _ } => f64::consts::PI * square(radius),
728+
Circle { radius: radius, .. } => f64::consts::PI * square(radius),
729729
Rectangle { top_left: top_left, bottom_right: bottom_right } => {
730730
(bottom_right.x - top_left.x) * (top_left.y - bottom_right.y)
731731
}
@@ -1698,7 +1698,7 @@ a function that returns `Option<T>` instead of `T`.
16981698
fn radius(shape: Shape) -> Option<f64> {
16991699
match shape {
17001700
Circle(_, radius) => Some(radius),
1701-
Rectangle(*) => None
1701+
Rectangle(..) => None
17021702
}
17031703
}
17041704
~~~~

src/compiletest/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
166166
&ProcRes);
167167
}
168168

169-
let ProcRes{ stdout, _ } = ProcRes;
169+
let ProcRes{ stdout, .. } = ProcRes;
170170
srcs.push(stdout);
171171
round += 1;
172172
}

src/libextra/arc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl<T:Send> MutexArc<T> {
256256
pub fn unwrap(self) -> T {
257257
let MutexArc { x: x } = self;
258258
let inner = x.unwrap();
259-
let MutexArcInner { failed: failed, data: data, _ } = inner;
259+
let MutexArcInner { failed: failed, data: data, .. } = inner;
260260
if failed {
261261
fail!("Can't unwrap poisoned MutexArc - another task failed inside!");
262262
}
@@ -504,9 +504,9 @@ impl<T:Freeze + Send> RWArc<T> {
504504
* in write mode.
505505
*/
506506
pub fn unwrap(self) -> T {
507-
let RWArc { x: x, _ } = self;
507+
let RWArc { x: x, .. } = self;
508508
let inner = x.unwrap();
509-
let RWArcInner { failed: failed, data: data, _ } = inner;
509+
let RWArcInner { failed: failed, data: data, .. } = inner;
510510
if failed {
511511
fail!("Can't unwrap poisoned RWArc - another task failed inside!")
512512
}

src/libextra/bitv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ impl BitvSet {
663663
size += 1;
664664
true
665665
});
666-
let Bitv{rep, _} = bitv;
666+
let Bitv{rep, ..} = bitv;
667667
match rep {
668668
Big(b) => BitvSet{ size: size, bitv: b },
669669
Small(SmallBitv{bits}) =>
@@ -678,7 +678,7 @@ impl BitvSet {
678678
/// Consumes this set to return the underlying bit vector
679679
pub fn unwrap(self) -> Bitv {
680680
let cap = self.capacity();
681-
let BitvSet{bitv, _} = self;
681+
let BitvSet{bitv, ..} = self;
682682
return Bitv{ nbits:cap, rep: Big(bitv) };
683683
}
684684

src/libextra/btree.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ impl<K: Clone + TotalOrd, V: Clone> Node<K, V>{
111111
///Differentiates between leaf and branch nodes.
112112
fn is_leaf(&self) -> bool{
113113
match self{
114-
&LeafNode(*) => true,
115-
&BranchNode(*) => false
114+
&LeafNode(..) => true,
115+
&BranchNode(..) => false
116116
}
117117
}
118118

@@ -208,7 +208,7 @@ impl<K: ToStr + TotalOrd, V: ToStr> ToStr for Node<K, V>{
208208
fn to_str(&self) -> ~str{
209209
match *self{
210210
LeafNode(ref leaf) => leaf.to_str(),
211-
BranchNode(*) => ~""
211+
BranchNode(..) => ~""
212212
}
213213
}
214214
}

src/libextra/dlist.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<T> Deque<T> for DList<T> {
241241
///
242242
/// O(1)
243243
fn pop_front(&mut self) -> Option<T> {
244-
self.pop_front_node().map(|~Node{value, _}| value)
244+
self.pop_front_node().map(|~Node{value, ..}| value)
245245
}
246246

247247
/// Add an element last in the list
@@ -255,7 +255,7 @@ impl<T> Deque<T> for DList<T> {
255255
///
256256
/// O(1)
257257
fn pop_back(&mut self) -> Option<T> {
258-
self.pop_back_node().map(|~Node{value, _}| value)
258+
self.pop_back_node().map(|~Node{value, ..}| value)
259259
}
260260
}
261261

src/libextra/getopts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ pub mod groups {
549549
long_name: long_name,
550550
hasarg: hasarg,
551551
occur: occur,
552-
_
552+
..
553553
} = (*self).clone();
554554
555555
match (short_name.len(), long_name.len()) {
@@ -686,7 +686,7 @@ pub mod groups {
686686
hint: hint,
687687
desc: desc,
688688
hasarg: hasarg,
689-
_} = (*optref).clone();
689+
..} = (*optref).clone();
690690

691691
let mut row = " ".repeat(4);
692692

src/libextra/glob.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
154154
sort::quick_sort(children, |p1, p2| p2.filename() <= p1.filename());
155155
children
156156
}
157-
Err(*) => ~[]
157+
Err(..) => ~[]
158158
}
159159
}
160160

src/libextra/json.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -875,11 +875,11 @@ impl Decoder {
875875
fn expected(&self, expected: &str, found: &Json) -> ! {
876876
let found_s = match *found {
877877
Null => "null",
878-
List(*) => "list",
879-
Object(*) => "object",
880-
Number(*) => "number",
881-
String(*) => "string",
882-
Boolean(*) => "boolean"
878+
List(..) => "list",
879+
Object(..) => "object",
880+
Number(..) => "number",
881+
String(..) => "string",
882+
Boolean(..) => "boolean"
883883
};
884884
self.err(format!("expected {expct} but found {fnd}: {val}",
885885
expct=expected, fnd=found_s, val=found.to_str()))

src/libextra/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ Rust extras are part of the standard Rust distribution.
3838

3939
#[deny(non_camel_case_types)];
4040
#[deny(missing_doc)];
41-
#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot
42-
#[allow(cstack)]; // NOTE: remove after the next snapshot.
4341

4442
use std::str::{StrSlice, OwnedStr};
4543

src/libextra/tempfile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl TempDir {
3939
for _ in range(0u, 1000) {
4040
let p = tmpdir.join(r.gen_ascii_str(16) + suffix);
4141
match io::result(|| fs::mkdir(&p, io::UserRWX)) {
42-
Err(*) => {}
42+
Err(..) => {}
4343
Ok(()) => return Some(TempDir { path: Some(p) })
4444
}
4545
}

src/libextra/test.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ pub enum TestFn {
9797
impl TestFn {
9898
fn padding(&self) -> NamePadding {
9999
match self {
100-
&StaticTestFn(*) => PadNone,
101-
&StaticBenchFn(*) => PadOnRight,
102-
&StaticMetricFn(*) => PadOnRight,
103-
&DynTestFn(*) => PadNone,
104-
&DynMetricFn(*) => PadOnRight,
105-
&DynBenchFn(*) => PadOnRight,
100+
&StaticTestFn(..) => PadNone,
101+
&StaticBenchFn(..) => PadOnRight,
102+
&StaticMetricFn(..) => PadOnRight,
103+
&DynTestFn(..) => PadNone,
104+
&DynMetricFn(..) => PadOnRight,
105+
&DynBenchFn(..) => PadOnRight,
106106
}
107107
}
108108
}

src/libextra/time.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -681,13 +681,13 @@ pub fn strptime(s: &str, format: &str) -> Result<Tm, ~str> {
681681

682682
let mut buf = [0];
683683
let c = match rdr.read(buf) {
684-
Some(*) => buf[0] as u8 as char,
684+
Some(..) => buf[0] as u8 as char,
685685
None => break
686686
};
687687
match c {
688688
'%' => {
689689
let ch = match rdr.read(buf) {
690-
Some(*) => buf[0] as u8 as char,
690+
Some(..) => buf[0] as u8 as char,
691691
None => break
692692
};
693693
match parse_type(s, pos, ch, &mut tm) {
@@ -932,7 +932,7 @@ pub fn strftime(format: &str, tm: &Tm) -> ~str {
932932
loop {
933933
let mut b = [0];
934934
let ch = match rdr.read(b) {
935-
Some(*) => b[0],
935+
Some(..) => b[0],
936936
None => break,
937937
};
938938
match ch as char {

src/libextra/treemap.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ fn mutate_values<'r,
686686
-> bool {
687687
match *node {
688688
Some(~TreeNode{key: ref key, value: ref mut value, left: ref mut left,
689-
right: ref mut right, _}) => {
689+
right: ref mut right, ..}) => {
690690
if !mutate_values(left, |k,v| f(k,v)) { return false }
691691
if !f(key, value) { return false }
692692
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>>,
801801
(remove(&mut save.left, key), true)
802802
} else {
803803
let new = save.left.take_unwrap();
804-
let ~TreeNode{value, _} = replace(save, new);
804+
let ~TreeNode{value, ..} = replace(save, new);
805805
*save = save.left.take_unwrap();
806806
(Some(value), true)
807807
}
808808
} else if save.right.is_some() {
809809
let new = save.right.take_unwrap();
810-
let ~TreeNode{value, _} = replace(save, new);
810+
let ~TreeNode{value, ..} = replace(save, new);
811811
(Some(value), true)
812812
} else {
813813
(None, false)
@@ -843,7 +843,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
843843
}
844844
}
845845
return match node.take() {
846-
Some(~TreeNode{value, _}) => Some(value), None => fail!()
846+
Some(~TreeNode{value, ..}) => Some(value), None => fail!()
847847
};
848848
}
849849

src/libextra/url.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn encode_inner(s: &str, full_url: bool) -> ~str {
7474
let mut buf = [0];
7575
let ch = match rdr.read(buf) {
7676
None => break,
77-
Some(*) => buf[0] as char,
77+
Some(..) => buf[0] as char,
7878
};
7979

8080
match ch {
@@ -138,7 +138,7 @@ fn decode_inner(s: &str, full_url: bool) -> ~str {
138138
let mut buf = [0];
139139
let ch = match rdr.read(buf) {
140140
None => break,
141-
Some(*) => buf[0] as char
141+
Some(..) => buf[0] as char
142142
};
143143
match ch {
144144
'%' => {
@@ -199,7 +199,7 @@ fn encode_plus(s: &str) -> ~str {
199199
loop {
200200
let mut buf = [0];
201201
let ch = match rdr.read(buf) {
202-
Some(*) => buf[0] as char,
202+
Some(..) => buf[0] as char,
203203
None => break,
204204
};
205205
match ch {
@@ -253,7 +253,7 @@ pub fn decode_form_urlencoded(s: &[u8]) -> HashMap<~str, ~[~str]> {
253253
loop {
254254
let mut buf = [0];
255255
let ch = match rdr.read(buf) {
256-
Some(*) => buf[0] as char,
256+
Some(..) => buf[0] as char,
257257
None => break,
258258
};
259259
match ch {
@@ -318,7 +318,7 @@ fn split_char_first(s: &str, c: char) -> (~str, ~str) {
318318
loop {
319319
let mut buf = [0];
320320
let ch = match rdr.read(buf) {
321-
Some(*) => buf[0] as char,
321+
Some(..) => buf[0] as char,
322322
None => break,
323323
};
324324
if ch == c {

src/librustc/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ fn is_writeable(p: &Path) -> bool {
973973

974974
!p.exists() ||
975975
(match io::result(|| p.stat()) {
976-
Err(*) => false,
976+
Err(..) => false,
977977
Ok(m) => m.perm & io::UserWrite == io::UserWrite
978978
})
979979
}

src/librustc/front/feature_gate.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl Visitor<()> for Context {
9595
ast::view_item_use(ref paths) => {
9696
for path in paths.iter() {
9797
match path.node {
98-
ast::view_path_glob(*) => {
98+
ast::view_path_glob(..) => {
9999
self.gate_feature("globs", path.span,
100100
"glob import statements are \
101101
experimental and possibly buggy");
@@ -110,8 +110,6 @@ impl Visitor<()> for Context {
110110
}
111111

112112
fn visit_item(&mut self, i: @ast::item, _:()) {
113-
// NOTE: uncomment after snapshot
114-
/*
115113
for attr in i.attrs.iter() {
116114
if "thread_local" == attr.name() {
117115
self.gate_feature("thread_local", i.span,
@@ -120,12 +118,11 @@ impl Visitor<()> for Context {
120118
`#[task_local]` mapping to the task model");
121119
}
122120
}
123-
*/
124121
match i.node {
125122
ast::item_enum(ref def, _) => {
126123
for variant in def.variants.iter() {
127124
match variant.node.kind {
128-
ast::struct_variant_kind(*) => {
125+
ast::struct_variant_kind(..) => {
129126
self.gate_feature("struct_variant", variant.span,
130127
"enum struct variants are \
131128
experimental and possibly buggy");

src/librustc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#[crate_type = "lib"];
2020

2121
#[feature(macro_rules, globs, struct_variant, managed_boxes)];
22-
#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot
23-
#[allow(cstack)]; // NOTE: remove after the next snapshot.
2422

2523
extern mod extra;
2624
extern mod syntax;

0 commit comments

Comments
 (0)