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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
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()))

0 commit comments

Comments
 (0)