Skip to content

Commit c39a3af

Browse files
committed
---
yaml --- r: 216511 b: refs/heads/stable c: 700b4c1 h: refs/heads/master i: 216509: 5daca62 216507: 993e0b5 216503: afe073e 216495: 64692a1 216479: f64bec8 216447: 95c7a9e v: v3
1 parent e8dc1c6 commit c39a3af

Some content is hidden

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

89 files changed

+973
-742
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: da03c9df33177d77029c52f8a68a5d214a6e83c7
32+
refs/heads/stable: 700b4c160bebb812951387074331a71d54805db0
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ fi
544544
BOOL_OPTIONS=""
545545
VAL_OPTIONS=""
546546

547-
opt debug 0 "debug mode"
547+
opt debug 0 "debug mode; disables optimization unless \`--enable-optimize\` given"
548548
opt valgrind 0 "run tests with valgrind (memcheck by default)"
549549
opt helgrind 0 "run tests with helgrind instead of memcheck"
550550
opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"

branches/stable/src/doc/grammar.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,15 @@ excluded from the `ident` rule.
176176

177177
```antlr
178178
lit_suffix : ident;
179-
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit ] lit_suffix ?;
179+
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit | bool_lit ] lit_suffix ?;
180180
```
181181

182+
The optional `lit_suffix` production is only used for certain numeric literals,
183+
but is reserved for future extension. That is, the above gives the lexical
184+
grammar, but a Rust parser will reject everything but the 12 special cases
185+
mentioned in [Number literals](reference.html#number-literals) in the
186+
reference.
187+
182188
#### Character and string literals
183189

184190
```antlr
@@ -238,7 +244,9 @@ dec_lit : [ dec_digit | '_' ] + ;
238244

239245
#### Boolean literals
240246

241-
**FIXME:** write grammar
247+
```antlr
248+
bool_lit : [ "true" | "false" ] ;
249+
```
242250

243251
The two values of the boolean type are written `true` and `false`.
244252

@@ -297,7 +305,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
297305

298306
```antlr
299307
item : mod_item | fn_item | type_item | struct_item | enum_item
300-
| static_item | trait_item | impl_item | extern_block ;
308+
| const_item | static_item | trait_item | impl_item | extern_block ;
301309
```
302310

303311
### Type Parameters
@@ -369,6 +377,10 @@ path_item : ident | "mod" ;
369377

370378
**FIXME:** grammar?
371379

380+
### Enumerations
381+
382+
**FIXME:** grammar?
383+
372384
### Constant items
373385

374386
```antlr

branches/stable/src/doc/reference.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ of tokens, that immediately and directly denotes the value it evaluates to,
130130
rather than referring to it by name or some other evaluation rule. A literal is
131131
a form of constant expression, so is evaluated (primarily) at compile time.
132132

133-
The optional suffix is only used for certain numeric literals, but is
134-
reserved for future extension, that is, the above gives the lexical
135-
grammar, but a Rust parser will reject everything but the 12 special
136-
cases mentioned in [Number literals](#number-literals) below.
137-
138133
#### Examples
139134

140135
##### Characters and strings
@@ -1562,8 +1557,7 @@ warnings are generated, or otherwise "you used a private item of another module
15621557
and weren't allowed to."
15631558

15641559
By default, everything in Rust is *private*, with one exception. Enum variants
1565-
in a `pub` enum are also public by default. You are allowed to alter this
1566-
default visibility with the `priv` keyword. When an item is declared as `pub`,
1560+
in a `pub` enum are also public by default. When an item is declared as `pub`,
15671561
it can be thought of as being accessible to the outside world. For example:
15681562

15691563
```
@@ -2431,11 +2425,18 @@ Tuples are written by enclosing zero or more comma-separated expressions in
24312425
parentheses. They are used to create [tuple-typed](#tuple-types) values.
24322426

24332427
```{.tuple}
2434-
(0,);
24352428
(0.0, 4.5);
24362429
("a", 4usize, true);
24372430
```
24382431

2432+
You can disambiguate a single-element tuple from a value in parentheses with a
2433+
comma:
2434+
2435+
```
2436+
(0,); // single-element tuple
2437+
(0); // zero in parentheses
2438+
```
2439+
24392440
### Unit expressions
24402441

24412442
The expression `()` denotes the _unit value_, the only value of the type with

branches/stable/src/doc/trpl/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ Rust attributes are used for a number of different things. There is a full list
6767
of attributes [in the reference][reference]. Currently, you are not allowed to
6868
create your own attributes, the Rust compiler defines them.
6969

70-
[reference]: reference.html#attributes
70+
[reference]: ../reference.html#attributes

branches/stable/src/doc/trpl/const-and-static.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ this reason.
1919
# `static`
2020

2121
Rust provides a ‘global variable’ sort of facility in static items. They’re
22-
similar to [constants][const], but static items aren’t inlined upon use. This
23-
means that there is only one instance for each value, and it’s at a fixed
24-
location in memory.
22+
similar to constants, but static items aren’t inlined upon use. This means that
23+
there is only one instance for each value, and it’s at a fixed location in
24+
memory.
2525

2626
Here’s an example:
2727

2828
```rust
2929
static N: i32 = 5;
3030
```
3131

32-
[const]: const.html
33-
3432
Unlike [`let`][let] bindings, you must annotate the type of a `static`.
3533

3634
[let]: variable-bindings.html

branches/stable/src/doc/trpl/iterators.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,26 +235,15 @@ Ranges are one of two basic iterators that you'll see. The other is `iter()`.
235235
in turn:
236236

237237
```rust
238-
let nums = [1, 2, 3];
238+
let nums = vec![1, 2, 3];
239239

240240
for num in nums.iter() {
241241
println!("{}", num);
242242
}
243243
```
244244

245245
These two basic iterators should serve you well. There are some more
246-
advanced iterators, including ones that are infinite. Like using range syntax
247-
and `step_by`:
248-
249-
```rust
250-
# #![feature(step_by)]
251-
(1..).step_by(5);
252-
```
253-
254-
This iterator counts up from one, adding five each time. It will give
255-
you a new integer every time, forever (well, technically, until it reaches the
256-
maximum number representable by an `i32`). But since iterators are lazy,
257-
that's okay! You probably don't want to use `collect()` on it, though...
246+
advanced iterators, including ones that are infinite.
258247

259248
That's enough about iterators. Iterator adapters are the last concept
260249
we need to talk about with regards to iterators. Let's get to it!

branches/stable/src/doc/trpl/nightly-rust.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ If not, there are a number of places where you can get help. The easiest is
9393
[the #rust IRC channel on irc.mozilla.org][irc], which you can access through
9494
[Mibbit][mibbit]. Click that link, and you'll be chatting with other Rustaceans
9595
(a silly nickname we call ourselves), and we can help you out. Other great
96-
resources include [the user’s forum][users], and [Stack Overflow][stack
97-
overflow].
96+
resources include [the user’s forum][users], and [Stack Overflow][stack overflow].
9897

9998
[irc]: irc://irc.mozilla.org/#rust
10099
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust

branches/stable/src/doc/trpl/primitive-types.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ or “breaks up” the tuple, and assigns the bits to three bindings.
248248

249249
This pattern is very powerful, and we’ll see it repeated more later.
250250

251+
You can disambiguate a single-element tuple from a value in parentheses with a
252+
comma:
253+
254+
```
255+
(0,); // single-element tuple
256+
(0); // zero in parentheses
257+
```
258+
251259
## Tuple Indexing
252260

253261
You can also access fields of a tuple with indexing syntax:

branches/stable/src/doc/trpl/raw-pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Raw pointers are useful for FFI: Rust’s `*const T` and `*mut T` are similar to
8080
C’s `const T*` and `T*`, respectfully. For more about this use, consult the
8181
[FFI chapter][ffi].
8282

83-
[ffi]: ffi.md
83+
[ffi]: ffi.html
8484

8585
# References and raw pointers
8686

branches/stable/src/doc/trpl/unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Rust has a feature called ‘`static mut`’ which allows for mutable global sta
101101
Doing so can cause a data race, and as such is inherently not safe. For more
102102
details, see the [static][static] section of the book.
103103

104-
[static]: static.html
104+
[static]: const-and-static.html#static
105105

106106
## Dereference a raw pointer
107107

branches/stable/src/doc/trpl/unsized-types.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ impl Foo for &str {
3838
```
3939

4040
Meaning, this implementation would only work for [references][ref], and not
41-
other types of pointers. With this `impl`, all pointers, including (at some
42-
point, there are some bugs to fix first) user-defined custom smart pointers,
43-
can use this `impl`.
41+
other types of pointers. With the `impl for str`, all pointers, including (at
42+
some point, there are some bugs to fix first) user-defined custom smart
43+
pointers, can use this `impl`.
44+
45+
[ref]: references-and-borrowing.html
4446

4547
# ?Sized
4648

branches/stable/src/liballoc/boxed.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl<T: ?Sized + Hash> Hash for Box<T> {
240240
impl Box<Any> {
241241
#[inline]
242242
#[stable(feature = "rust1", since = "1.0.0")]
243+
/// Attempt to downcast the box to a concrete type.
243244
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
244245
if self.is::<T>() {
245246
unsafe {
@@ -257,11 +258,15 @@ impl Box<Any> {
257258
}
258259
}
259260

260-
impl Box<Any+Send> {
261+
impl Box<Any + Send> {
261262
#[inline]
262263
#[stable(feature = "rust1", since = "1.0.0")]
263-
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
264-
<Box<Any>>::downcast(self)
264+
/// Attempt to downcast the box to a concrete type.
265+
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any + Send>> {
266+
<Box<Any>>::downcast(self).map_err(|s| unsafe {
267+
// reapply the Send marker
268+
mem::transmute::<Box<Any>, Box<Any + Send>>(s)
269+
})
265270
}
266271
}
267272

branches/stable/src/libcollections/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@
398398
//! longer than this width, then it is truncated down to this many characters and only those are
399399
//! emitted.
400400
//!
401-
//! For integral types, this has no meaning currently.
401+
//! For integral types, this is ignored.
402402
//!
403403
//! For floating-point types, this indicates how many digits after the decimal point should be
404404
//! printed.

branches/stable/src/libcollections/string.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,7 @@ impl<'a> FromIterator<&'a str> for String {
794794
}
795795
}
796796

797-
#[unstable(feature = "collections",
798-
reason = "waiting on Extend stabilization")]
797+
#[stable(feature = "rust1", since = "1.0.0")]
799798
impl Extend<char> for String {
800799
fn extend<I: IntoIterator<Item=char>>(&mut self, iterable: I) {
801800
let iterator = iterable.into_iter();
@@ -807,8 +806,7 @@ impl Extend<char> for String {
807806
}
808807
}
809808

810-
#[unstable(feature = "collections",
811-
reason = "waiting on Extend stabilization")]
809+
#[stable(feature = "rust1", since = "1.0.0")]
812810
impl<'a> Extend<&'a str> for String {
813811
fn extend<I: IntoIterator<Item=&'a str>>(&mut self, iterable: I) {
814812
let iterator = iterable.into_iter();
@@ -923,8 +921,7 @@ impl hash::Hash for String {
923921
}
924922
}
925923

926-
#[unstable(feature = "collections",
927-
reason = "recent addition, needs more experience")]
924+
#[stable(feature = "rust1", since = "1.0.0")]
928925
impl<'a> Add<&'a str> for String {
929926
type Output = String;
930927

@@ -1018,11 +1015,17 @@ pub fn as_string<'a>(x: &'a str) -> DerefString<'a> {
10181015
DerefString { x: as_vec(x.as_bytes()) }
10191016
}
10201017

1021-
#[unstable(feature = "collections", reason = "associated error type may change")]
1018+
/// Error returned from `String::from_str`
1019+
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \
1020+
Void if it ever exists")]
1021+
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1022+
pub struct ParseError(());
1023+
1024+
#[stable(feature = "rust1", since = "1.0.0")]
10221025
impl FromStr for String {
1023-
type Err = ();
1026+
type Err = ParseError;
10241027
#[inline]
1025-
fn from_str(s: &str) -> Result<String, ()> {
1028+
fn from_str(s: &str) -> Result<String, ParseError> {
10261029
Ok(String::from_str(s))
10271030
}
10281031
}

branches/stable/src/libcollections/vec.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> {
12991299
// Common trait implementations for Vec
13001300
////////////////////////////////////////////////////////////////////////////////
13011301

1302-
#[unstable(feature = "collections")]
1302+
#[stable(feature = "rust1", since = "1.0.0")]
13031303
impl<T:Clone> Clone for Vec<T> {
13041304
#[cfg(not(test))]
13051305
fn clone(&self) -> Vec<T> { <[T]>::to_vec(&**self) }
@@ -1554,7 +1554,7 @@ impl<'a, T> IntoIterator for &'a mut Vec<T> {
15541554
}
15551555
}
15561556

1557-
#[unstable(feature = "collections", reason = "waiting on Extend stability")]
1557+
#[stable(feature = "rust1", since = "1.0.0")]
15581558
impl<T> Extend<T> for Vec<T> {
15591559
#[inline]
15601560
fn extend<I: IntoIterator<Item=T>>(&mut self, iterable: I) {
@@ -1614,8 +1614,7 @@ impl<T: Ord> Ord for Vec<T> {
16141614
}
16151615
}
16161616

1617-
#[unstable(feature = "collections",
1618-
reason = "recent addition, needs more experience")]
1617+
#[stable(feature = "rust1", since = "1.0.0")]
16191618
impl<'a, T: Clone> Add<&'a [T]> for Vec<T> {
16201619
type Output = Vec<T>;
16211620

@@ -1694,7 +1693,7 @@ impl<'a> From<&'a str> for Vec<u8> {
16941693
// Clone-on-write
16951694
////////////////////////////////////////////////////////////////////////////////
16961695

1697-
#[unstable(feature = "collections")]
1696+
#[stable(feature = "rust1", since = "1.0.0")]
16981697
impl<'a, T> FromIterator<T> for Cow<'a, [T]> where T: Clone {
16991698
fn from_iter<I: IntoIterator<Item=T>>(it: I) -> Cow<'a, [T]> {
17001699
Cow::Owned(FromIterator::from_iter(it))

branches/stable/src/libcore/any.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ pub trait Any: Reflect + 'static {
9797
fn get_type_id(&self) -> TypeId;
9898
}
9999

100-
impl<T> Any for T
101-
where T: Reflect + 'static
102-
{
100+
impl<T: Reflect + 'static> Any for T {
103101
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
104102
}
105103

@@ -222,7 +220,7 @@ impl TypeId {
222220
/// Returns the `TypeId` of the type this generic function has been
223221
/// instantiated with
224222
#[stable(feature = "rust1", since = "1.0.0")]
225-
pub fn of<T: ?Sized + Any>() -> TypeId {
223+
pub fn of<T: ?Sized + Reflect + 'static>() -> TypeId {
226224
TypeId {
227225
t: unsafe { intrinsics::type_id::<T>() },
228226
}

branches/stable/src/libcore/intrinsics.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ extern "rust-intrinsic" {
267267
/// `Copy`, then may return `true` or `false`.
268268
pub fn needs_drop<T>() -> bool;
269269

270-
/// Returns `true` if a type is managed (will be allocated on the local heap)
271-
pub fn owns_managed<T>() -> bool;
272-
273270
/// Calculates the offset from a pointer.
274271
///
275272
/// This is implemented as an intrinsic to avoid converting to and from an

0 commit comments

Comments
 (0)