Skip to content

Commit a84d6a7

Browse files
committed
---
yaml --- r: 210582 b: refs/heads/try c: c9c8ff1 h: refs/heads/master v: v3
1 parent db19b59 commit a84d6a7

File tree

39 files changed

+136
-310
lines changed

39 files changed

+136
-310
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: dec422541ba8f325c63f6fe139efb14e0f6f69a0
5+
refs/heads/try: c9c8ff1762b6761b738380ba57c939d515eab50c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/grammar.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
304304
## Items
305305

306306
```antlr
307-
item : mod_item | fn_item | type_item | struct_item | enum_item
307+
item : vis ? mod_item | fn_item | type_item | struct_item | enum_item
308308
| const_item | static_item | trait_item | impl_item | extern_block ;
309309
```
310310

@@ -335,8 +335,8 @@ crate_name: ident | ( ident "as" ident )
335335
##### Use declarations
336336

337337
```antlr
338-
use_decl : "pub" ? "use" [ path "as" ident
339-
| path_glob ] ;
338+
use_decl : vis ? "use" [ path "as" ident
339+
| path_glob ] ;
340340
341341
path_glob : ident [ "::" [ path_glob
342342
| '*' ] ] ?
@@ -414,8 +414,9 @@ extern_block : [ foreign_fn ] * ;
414414

415415
## Visibility and Privacy
416416

417-
**FIXME:** grammar?
418-
417+
```antlr
418+
vis : "pub" ;
419+
```
419420
### Re-exporting and Visibility
420421

421422
**FIXME:** grammar?

branches/try/src/doc/reference.md

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,9 @@ There are several kinds of item:
653653
* [`use` declarations](#use-declarations)
654654
* [modules](#modules)
655655
* [functions](#functions)
656-
* [type aliases](#type-aliases)
656+
* [type definitions](#type-definitions)
657657
* [structures](#structures)
658658
* [enumerations](#enumerations)
659-
* [constant items](#constant-items)
660659
* [static items](#static-items)
661660
* [traits](#traits)
662661
* [implementations](#implementations)
@@ -673,16 +672,16 @@ which sub-item declarations may appear.
673672

674673
### Type Parameters
675674

676-
All items except modules, constants and statics may be *parameterized* by type.
677-
Type parameters are given as a comma-separated list of identifiers enclosed in
678-
angle brackets (`<...>`), after the name of the item and before its definition.
679-
The type parameters of an item are considered "part of the name", not part of
680-
the type of the item. A referencing [path](#paths) must (in principle) provide
681-
type arguments as a list of comma-separated types enclosed within angle
682-
brackets, in order to refer to the type-parameterized item. In practice, the
683-
type-inference system can usually infer such argument types from context. There
684-
are no general type-parametric types, only type-parametric items. That is, Rust
685-
has no notion of type abstraction: there are no first-class "forall" types.
675+
All items except modules may be *parameterized* by type. Type parameters are
676+
given as a comma-separated list of identifiers enclosed in angle brackets
677+
(`<...>`), after the name of the item and before its definition. The type
678+
parameters of an item are considered "part of the name", not part of the type
679+
of the item. A referencing [path](#paths) must (in principle) provide type
680+
arguments as a list of comma-separated types enclosed within angle brackets, in
681+
order to refer to the type-parameterized item. In practice, the type-inference
682+
system can usually infer such argument types from context. There are no
683+
general type-parametric types, only type-parametric items. That is, Rust has
684+
no notion of type abstraction: there are no first-class "forall" types.
686685

687686
### Modules
688687

@@ -744,7 +743,7 @@ mod thread {
744743
}
745744
```
746745

747-
#### Extern crate declarations
746+
##### Extern crate declarations
748747

749748
An _`extern crate` declaration_ specifies a dependency on an external crate.
750749
The external crate is then bound into the declaring scope as the `ident`
@@ -768,7 +767,7 @@ extern crate std; // equivalent to: extern crate std as std;
768767
extern crate std as ruststd; // linking to 'std' under another name
769768
```
770769

771-
#### Use declarations
770+
##### Use declarations
772771

773772
A _use declaration_ creates one or more local name bindings synonymous with
774773
some other [path](#paths). Usually a `use` declaration is used to shorten the
@@ -843,7 +842,7 @@ module declarations should be at the crate root if direct usage of the declared
843842
modules within `use` items is desired. It is also possible to use `self` and
844843
`super` at the beginning of a `use` item to refer to the current and direct
845844
parent modules respectively. All rules regarding accessing declared modules in
846-
`use` declarations apply to both module declarations and `extern crate`
845+
`use` declarations applies to both module declarations and `extern crate`
847846
declarations.
848847

849848
An example of what will and will not work for `use` items:
@@ -2565,19 +2564,12 @@ array is mutable, the resulting [lvalue](#lvalues,-rvalues-and-temporaries) can
25652564
be assigned to.
25662565

25672566
Indices are zero-based, and may be of any integral type. Vector access is
2568-
bounds-checked at compile-time for constant arrays being accessed with a constant index value.
2569-
Otherwise a check will be performed at run-time that will put the thread in a _panicked state_ if it fails.
2567+
bounds-checked at run-time. When the check fails, it will put the thread in a
2568+
_panicked state_.
25702569

25712570
```{should-fail}
25722571
([1, 2, 3, 4])[0];
2573-
2574-
let x = (["a", "b"])[10]; // compiler error: const index-expr is out of bounds
2575-
2576-
let n = 10;
2577-
let y = (["a", "b"])[n]; // panics
2578-
2579-
let arr = ["a", "b"];
2580-
arr[10]; // panics
2572+
(["a", "b"])[10]; // panics
25812573
```
25822574

25832575
### Range expressions
@@ -3072,20 +3064,6 @@ of a condition expression it expects a refutable let statement. If the value of
30723064
expression on the right hand side of the let statement matches the pattern, the corresponding
30733065
block will execute, otherwise flow proceeds to the first `else` block that follows.
30743066

3075-
```
3076-
let dish = ("Ham", "Eggs");
3077-
3078-
// this body will be skipped because the pattern is refuted
3079-
if let ("Bacon", b) = dish {
3080-
println!("Bacon is served with {}", b);
3081-
}
3082-
3083-
// this body will execute
3084-
if let ("Ham", b) = dish {
3085-
println!("Ham is served with {}", b);
3086-
}
3087-
```
3088-
30893067
### While let loops
30903068

30913069
A `while let` loop is semantically identical to a `while` loop but in place of a

branches/try/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ information’. Why throw it away? Well, for a basic program, we just want to
273273
print a generic error, as basically any issue means we can’t continue. The
274274
[`ok()` method][ok] returns a value which has another method defined on it:
275275
`expect()`. The [`expect()` method][expect] takes a value it’s called on, and
276-
if it isn’t a successful one, [`panic!`][panic]s with a message you
276+
if it isn’t a successful one, [`panic!`][panic]s with a message you passed you
277277
passed it. A `panic!` like this will cause our program to crash, displaying
278278
the message.
279279

branches/try/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ struct Point {
169169
y: Cell<i32>,
170170
}
171171
172-
let point = Point { x: 5, y: Cell::new(6) };
172+
let mut point = Point { x: 5, y: Cell::new(6) };
173173
174174
point.y.set(7);
175175

branches/try/src/doc/trpl/references-and-borrowing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own
77
chapter:
88

9-
* [ownership][ownership], the key concept
9+
* [ownership][ownership], ownership, the key concept
1010
* borrowing, which you’re reading now
1111
* [lifetimes][lifetimes], an advanced concept of borrowing
1212

@@ -368,4 +368,4 @@ statement 1 at 3:14
368368
369369
println!("{}", y);
370370
}
371-
```
371+
```

branches/try/src/etc/check-sanitycheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import os
1414
import sys
1515
import functools
16+
import resource
1617

1718
STATUS = 0
1819

@@ -36,7 +37,6 @@ def inner():
3637

3738
@only_on(('linux', 'darwin', 'freebsd', 'openbsd'))
3839
def check_rlimit_core():
39-
import resource
4040
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
4141
if soft > 0:
4242
error_unless_permitted('ALLOW_NONZERO_RLIMIT_CORE', """\

branches/try/src/libcollections/bit.rs

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,89 +1796,6 @@ impl BitSet {
17961796
self.other_op(other, |w1, w2| w1 ^ w2);
17971797
}
17981798

1799-
/// Moves all elements from `other` into `Self`, leaving `other` empty.
1800-
///
1801-
/// # Examples
1802-
///
1803-
/// ```
1804-
/// # #![feature(collections, bit_set_append_split_off)]
1805-
/// use std::collections::{BitVec, BitSet};
1806-
///
1807-
/// let mut a = BitSet::new();
1808-
/// a.insert(2);
1809-
/// a.insert(6);
1810-
///
1811-
/// let mut b = BitSet::new();
1812-
/// b.insert(1);
1813-
/// b.insert(3);
1814-
/// b.insert(6);
1815-
///
1816-
/// a.append(&mut b);
1817-
///
1818-
/// assert_eq!(a.len(), 4);
1819-
/// assert_eq!(b.len(), 0);
1820-
/// assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b01110010])));
1821-
/// ```
1822-
#[unstable(feature = "bit_set_append_split_off",
1823-
reason = "recently added as part of collections reform 2")]
1824-
pub fn append(&mut self, other: &mut Self) {
1825-
self.union_with(other);
1826-
other.clear();
1827-
}
1828-
1829-
/// Splits the `BitSet` into two at the given key including the key.
1830-
/// Retains the first part in-place while returning the second part.
1831-
///
1832-
/// # Examples
1833-
///
1834-
/// ```
1835-
/// # #![feature(collections, bit_set_append_split_off)]
1836-
/// use std::collections::{BitSet, BitVec};
1837-
/// let mut a = BitSet::new();
1838-
/// a.insert(2);
1839-
/// a.insert(6);
1840-
/// a.insert(1);
1841-
/// a.insert(3);
1842-
///
1843-
/// let b = a.split_off(3);
1844-
///
1845-
/// assert_eq!(a.len(), 2);
1846-
/// assert_eq!(b.len(), 2);
1847-
/// assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b01100000])));
1848-
/// assert_eq!(b, BitSet::from_bit_vec(BitVec::from_bytes(&[0b00010010])));
1849-
/// ```
1850-
#[unstable(feature = "bit_set_append_split_off",
1851-
reason = "recently added as part of collections reform 2")]
1852-
pub fn split_off(&mut self, at: usize) -> Self {
1853-
let mut other = BitSet::new();
1854-
1855-
if at == 0 {
1856-
swap(self, &mut other);
1857-
return other;
1858-
} else if at >= self.bit_vec.len() {
1859-
return other;
1860-
}
1861-
1862-
// Calculate block and bit at which to split
1863-
let w = at / u32::BITS;
1864-
let b = at % u32::BITS;
1865-
1866-
// Pad `other` with `w` zero blocks,
1867-
// append `self`'s blocks in the range from `w` to the end to `other`
1868-
other.bit_vec.storage.extend(repeat(0u32).take(w)
1869-
.chain(self.bit_vec.storage[w..].iter().cloned()));
1870-
other.bit_vec.nbits = self.bit_vec.nbits;
1871-
1872-
if b > 0 {
1873-
other.bit_vec.storage[w] &= !0 << b;
1874-
}
1875-
1876-
// Sets `bit_vec.len()` and fixes the last block as well
1877-
self.bit_vec.truncate(at);
1878-
1879-
other
1880-
}
1881-
18821799
/// Returns the number of set bits in this set.
18831800
#[inline]
18841801
#[stable(feature = "rust1", since = "1.0.0")]

branches/try/src/libcollections/slice.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ pub trait SliceConcatExt<T: ?Sized> {
10021002
/// The resulting type after concatenation
10031003
type Output;
10041004

1005-
/// Flattens a slice of `T` into a single value `Self::Output`.
1005+
/// Flattens a slice of `T` into a single value `U`.
10061006
///
10071007
/// # Examples
10081008
///
@@ -1012,8 +1012,7 @@ pub trait SliceConcatExt<T: ?Sized> {
10121012
#[stable(feature = "rust1", since = "1.0.0")]
10131013
fn concat(&self) -> Self::Output;
10141014

1015-
/// Flattens a slice of `T` into a single value `Self::Output`, placing a given separator
1016-
/// between each.
1015+
/// Flattens a slice of `T` into a single value `U`, placing a given separator between each.
10171016
///
10181017
/// # Examples
10191018
///

branches/try/src/libcollectionstest/bit/set.rs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -387,67 +387,6 @@ fn test_bit_vec_clone() {
387387
assert!(b.contains(&1000));
388388
}
389389

390-
#[test]
391-
fn test_bit_set_append() {
392-
let mut a = BitSet::new();
393-
a.insert(2);
394-
a.insert(6);
395-
396-
let mut b = BitSet::new();
397-
b.insert(1);
398-
b.insert(3);
399-
b.insert(6);
400-
401-
a.append(&mut b);
402-
403-
assert_eq!(a.len(), 4);
404-
assert_eq!(b.len(), 0);
405-
assert!(b.capacity() >= 6);
406-
407-
assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b01110010])));
408-
}
409-
410-
#[test]
411-
fn test_bit_set_split_off() {
412-
// Split at 0
413-
let mut a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100000, 0b00010010, 0b10010010,
414-
0b00110011, 0b01101011, 0b10101101]));
415-
416-
let b = a.split_off(0);
417-
418-
assert_eq!(a.len(), 0);
419-
assert_eq!(b.len(), 21);
420-
421-
assert_eq!(b, BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100000, 0b00010010, 0b10010010,
422-
0b00110011, 0b01101011, 0b10101101])));
423-
424-
// Split behind last element
425-
let mut a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100000, 0b00010010, 0b10010010,
426-
0b00110011, 0b01101011, 0b10101101]));
427-
428-
let b = a.split_off(50);
429-
430-
assert_eq!(a.len(), 21);
431-
assert_eq!(b.len(), 0);
432-
433-
assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100000, 0b00010010, 0b10010010,
434-
0b00110011, 0b01101011, 0b10101101])));
435-
436-
// Split at arbitrary element
437-
let mut a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100000, 0b00010010, 0b10010010,
438-
0b00110011, 0b01101011, 0b10101101]));
439-
440-
let b = a.split_off(34);
441-
442-
assert_eq!(a.len(), 12);
443-
assert_eq!(b.len(), 9);
444-
445-
assert_eq!(a, BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100000, 0b00010010, 0b10010010,
446-
0b00110011, 0b01000000])));
447-
assert_eq!(b, BitSet::from_bit_vec(BitVec::from_bytes(&[0, 0, 0, 0,
448-
0b00101011, 0b10101101])));
449-
}
450-
451390
mod bench {
452391
use std::collections::{BitSet, BitVec};
453392
use std::__rand::{Rng, thread_rng, ThreadRng};

branches/try/src/libcollectionstest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(bit_set_append_split_off)]
1211
#![feature(bit_vec_append_split_off)]
1312
#![feature(box_syntax)]
1413
#![feature(collections)]

0 commit comments

Comments
 (0)