Skip to content

Commit 7bbe8a5

Browse files
committed
---
yaml --- r: 224691 b: refs/heads/tmp c: b52f618 h: refs/heads/master i: 224689: e58c8a5 224687: 5e5dff8 v: v3
1 parent 1eee47d commit 7bbe8a5

22 files changed

+51
-182
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: 83dee3dfbb452a7558193f3ce171b3c60bf4a499
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 759726276733a6c63fcb9d5b0ca75128736f8539
28+
refs/heads/tmp: b52f6187d539ea1c739e790bead8e6699e61e9dd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e58601ab085591c71a27ae82137fc313222c2270
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/RELEASES.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ Highlights
1616
jobs). It's not enabled by default, but will be "in the near
1717
future". It can be activated with the `-C codegen-units=N` flag to
1818
`rustc`.
19-
* This is the first release with [experimental support for linking
20-
with the MSVC linker and lib C on Windows (instead of using the GNU
21-
variants via MinGW)][win]. It is yet recommended only for the most
22-
intrepid Rusticians.
23-
* Benchmark compilations are showing a 30% improvement in
24-
bootstrapping over 1.1.
2519

2620
Breaking Changes
2721
----------------
@@ -37,10 +31,6 @@ Breaking Changes
3731
* [The `#[packed]` attribute is no longer silently accepted by the
3832
compiler][packed]. This attribute did nothing and code that
3933
mentioned it likely did not work as intended.
40-
* Associated type defaults are [now behind the
41-
`associated_type_defaults` feature gate][ad]. In 1.1 associated type
42-
defaults *did not work*, but could be mentioned syntactically. As
43-
such this breakage has minimal impact.
4434

4535
Language
4636
--------
@@ -56,11 +46,12 @@ Libraries
5646
`LinkedList`, `VecDeque`, `EnumSet`, `BinaryHeap`, `VecMap`,
5747
`BTreeSet` and `BTreeMap`. [RFC][extend-rfc].
5848
* The [`iter::once`] function returns an iterator that yields a single
59-
element, and [`iter::empty`] returns an iterator that yields no
49+
element.
50+
* The [`iter::empty`] function returns an iterator that yields no
6051
elements.
6152
* The [`matches`] and [`rmatches`] methods on `str` return iterators
6253
over substring matches.
63-
* [`Cell`] and [`RefCell`] both implement `Eq`.
54+
* [`Cell`] and [`RefCell`] both implement [`Eq`].
6455
* A number of methods for wrapping arithmetic are added to the
6556
integral types, [`wrapping_div`], [`wrapping_rem`],
6657
[`wrapping_neg`], [`wrapping_shl`], [`wrapping_shr`]. These are in
@@ -153,8 +144,6 @@ Misc
153144
[dst]: https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md
154145
[parcodegen]: https://github.com/rust-lang/rust/pull/26018
155146
[packed]: https://github.com/rust-lang/rust/pull/25541
156-
[ad]: https://github.com/rust-lang/rust/pull/27382
157-
[win]: https://github.com/rust-lang/rust/pull/25350
158147

159148
Version 1.1.0 (June 2015)
160149
=========================

branches/tmp/src/doc/tarpl/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* [Ownership](ownership.md)
1111
* [References](references.md)
1212
* [Lifetimes](lifetimes.md)
13-
* [Limits of lifetimes](lifetime-mismatch.md)
13+
* [Limits of Lifetimes](lifetime-mismatch.md)
1414
* [Lifetime Elision](lifetime-elision.md)
1515
* [Unbounded Lifetimes](unbounded-lifetimes.md)
1616
* [Higher-Rank Trait Bounds](hrtb.md)

branches/tmp/src/doc/tarpl/races.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ race condition can't violate memory safety in a Rust program on
2525
its own. Only in conjunction with some other unsafe code can a race condition
2626
actually violate memory safety. For instance:
2727

28-
```rust,no_run
28+
```rust,norun
2929
use std::thread;
3030
use std::sync::atomic::{AtomicUsize, Ordering};
3131
use std::sync::Arc;
@@ -56,7 +56,7 @@ thread::spawn(move || {
5656
println!("{}", data[idx.load(Ordering::SeqCst)]);
5757
```
5858

59-
```rust,no_run
59+
```rust,norun
6060
use std::thread;
6161
use std::sync::atomic::{AtomicUsize, Ordering};
6262
use std::sync::Arc;

branches/tmp/src/libcore/hash/mod.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ pub trait Hash {
9191
fn hash<H: Hasher>(&self, state: &mut H);
9292

9393
/// Feeds a slice of this type into the state provided.
94-
#[stable(feature = "hash_slice", since = "1.3.0")]
94+
#[unstable(feature = "hash_slice",
95+
reason = "module was recently redesigned")]
9596
fn hash_slice<H: Hasher>(data: &[Self], state: &mut H) where Self: Sized {
9697
for piece in data {
9798
piece.hash(state);
@@ -112,29 +113,29 @@ pub trait Hasher {
112113

113114
/// Write a single `u8` into this hasher
114115
#[inline]
115-
#[stable(feature = "hasher_write", since = "1.3.0")]
116+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
116117
fn write_u8(&mut self, i: u8) { self.write(&[i]) }
117118
/// Write a single `u16` into this hasher.
118119
#[inline]
119-
#[stable(feature = "hasher_write", since = "1.3.0")]
120+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
120121
fn write_u16(&mut self, i: u16) {
121122
self.write(&unsafe { mem::transmute::<_, [u8; 2]>(i) })
122123
}
123124
/// Write a single `u32` into this hasher.
124125
#[inline]
125-
#[stable(feature = "hasher_write", since = "1.3.0")]
126+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
126127
fn write_u32(&mut self, i: u32) {
127128
self.write(&unsafe { mem::transmute::<_, [u8; 4]>(i) })
128129
}
129130
/// Write a single `u64` into this hasher.
130131
#[inline]
131-
#[stable(feature = "hasher_write", since = "1.3.0")]
132+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
132133
fn write_u64(&mut self, i: u64) {
133134
self.write(&unsafe { mem::transmute::<_, [u8; 8]>(i) })
134135
}
135136
/// Write a single `usize` into this hasher.
136137
#[inline]
137-
#[stable(feature = "hasher_write", since = "1.3.0")]
138+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
138139
fn write_usize(&mut self, i: usize) {
139140
if cfg!(target_pointer_width = "32") {
140141
self.write_u32(i as u32)
@@ -145,23 +146,23 @@ pub trait Hasher {
145146

146147
/// Write a single `i8` into this hasher.
147148
#[inline]
148-
#[stable(feature = "hasher_write", since = "1.3.0")]
149+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
149150
fn write_i8(&mut self, i: i8) { self.write_u8(i as u8) }
150151
/// Write a single `i16` into this hasher.
151152
#[inline]
152-
#[stable(feature = "hasher_write", since = "1.3.0")]
153+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
153154
fn write_i16(&mut self, i: i16) { self.write_u16(i as u16) }
154155
/// Write a single `i32` into this hasher.
155156
#[inline]
156-
#[stable(feature = "hasher_write", since = "1.3.0")]
157+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
157158
fn write_i32(&mut self, i: i32) { self.write_u32(i as u32) }
158159
/// Write a single `i64` into this hasher.
159160
#[inline]
160-
#[stable(feature = "hasher_write", since = "1.3.0")]
161+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
161162
fn write_i64(&mut self, i: i64) { self.write_u64(i as u64) }
162163
/// Write a single `isize` into this hasher.
163164
#[inline]
164-
#[stable(feature = "hasher_write", since = "1.3.0")]
165+
#[unstable(feature = "hasher_write", reason = "module was recently redesigned")]
165166
fn write_isize(&mut self, i: isize) { self.write_usize(i as usize) }
166167
}
167168

branches/tmp/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
#![allow(raw_pointer_derive)]
6666
#![deny(missing_docs)]
6767

68-
#![feature(associated_type_defaults)]
6968
#![feature(intrinsics)]
7069
#![feature(lang_items)]
7170
#![feature(on_unimplemented)]

branches/tmp/src/librustc_resolve/diagnostics.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,9 @@ Please verify you didn't misspell the import's name.
583583
"##,
584584

585585
E0437: r##"
586-
Trait implementations can only implement associated types that are members of
587-
the trait in question. This error indicates that you attempted to implement
588-
an associated type whose name does not match the name of any associated type
589-
in the trait.
586+
Trait impls can only implement associated types that are members of the trait in
587+
question. This error indicates that you attempted to implement an associated
588+
type whose name does not match the name of any associated type in the trait.
590589
591590
Here is an example that demonstrates the error:
592591
@@ -608,10 +607,10 @@ impl Foo for i32 {}
608607
"##,
609608

610609
E0438: r##"
611-
Trait implementations can only implement associated constants that are
612-
members of the trait in question. This error indicates that you
613-
attempted to implement an associated constant whose name does not
614-
match the name of any associated constant in the trait.
610+
Trait impls can only implement associated constants that are members of the
611+
trait in question. This error indicates that you attempted to implement an
612+
associated constant whose name does not match the name of any associated
613+
constant in the trait.
615614
616615
Here is an example that demonstrates the error:
617616

branches/tmp/src/librustdoc/markdown.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ use test::{TestOptions, Collector};
2929
/// Separate any lines at the start of the file that begin with `%`.
3030
fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) {
3131
let mut metadata = Vec::new();
32-
let mut count = 0;
3332
for line in s.lines() {
3433
if line.starts_with("%") {
3534
// remove %<whitespace>
36-
metadata.push(line[1..].trim_left());
37-
count += line.len() + 1;
35+
metadata.push(line[1..].trim_left())
3836
} else {
39-
return (metadata, &s[count..]);
37+
let line_start_byte = s.find(line).unwrap();
38+
return (metadata, &s[line_start_byte..]);
4039
}
4140
}
4241
// if we're here, then all lines were metadata % lines.

branches/tmp/src/libstd/error.rs

Lines changed: 9 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Error for string::FromUtf16Error {
168168
// copied from any.rs
169169
impl Error + 'static {
170170
/// Returns true if the boxed type is the same as `T`
171-
#[stable(feature = "error_downcast", since = "1.3.0")]
171+
#[unstable(feature = "error_downcast", reason = "recently added")]
172172
#[inline]
173173
pub fn is<T: Error + 'static>(&self) -> bool {
174174
// Get TypeId of the type this function is instantiated with
@@ -183,7 +183,7 @@ impl Error + 'static {
183183

184184
/// Returns some reference to the boxed value if it is of type `T`, or
185185
/// `None` if it isn't.
186-
#[stable(feature = "error_downcast", since = "1.3.0")]
186+
#[unstable(feature = "error_downcast", reason = "recently added")]
187187
#[inline]
188188
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T> {
189189
if self.is::<T>() {
@@ -201,7 +201,7 @@ impl Error + 'static {
201201

202202
/// Returns some mutable reference to the boxed value if it is of type `T`, or
203203
/// `None` if it isn't.
204-
#[stable(feature = "error_downcast", since = "1.3.0")]
204+
#[unstable(feature = "error_downcast", reason = "recently added")]
205205
#[inline]
206206
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T> {
207207
if self.is::<T>() {
@@ -220,44 +220,21 @@ impl Error + 'static {
220220

221221
impl Error + 'static + Send {
222222
/// Forwards to the method defined on the type `Any`.
223-
#[stable(feature = "error_downcast", since = "1.3.0")]
223+
#[unstable(feature = "error_downcast", reason = "recently added")]
224224
#[inline]
225225
pub fn is<T: Error + 'static>(&self) -> bool {
226226
<Error + 'static>::is::<T>(self)
227227
}
228228

229229
/// Forwards to the method defined on the type `Any`.
230-
#[stable(feature = "error_downcast", since = "1.3.0")]
230+
#[unstable(feature = "error_downcast", reason = "recently added")]
231231
#[inline]
232232
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T> {
233233
<Error + 'static>::downcast_ref::<T>(self)
234234
}
235235

236236
/// Forwards to the method defined on the type `Any`.
237-
#[stable(feature = "error_downcast", since = "1.3.0")]
238-
#[inline]
239-
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T> {
240-
<Error + 'static>::downcast_mut::<T>(self)
241-
}
242-
}
243-
244-
impl Error + 'static + Send + Sync {
245-
/// Forwards to the method defined on the type `Any`.
246-
#[stable(feature = "error_downcast", since = "1.3.0")]
247-
#[inline]
248-
pub fn is<T: Error + 'static>(&self) -> bool {
249-
<Error + 'static>::is::<T>(self)
250-
}
251-
252-
/// Forwards to the method defined on the type `Any`.
253-
#[stable(feature = "error_downcast", since = "1.3.0")]
254-
#[inline]
255-
pub fn downcast_ref<T: Error + 'static>(&self) -> Option<&T> {
256-
<Error + 'static>::downcast_ref::<T>(self)
257-
}
258-
259-
/// Forwards to the method defined on the type `Any`.
260-
#[stable(feature = "error_downcast", since = "1.3.0")]
237+
#[unstable(feature = "error_downcast", reason = "recently added")]
261238
#[inline]
262239
pub fn downcast_mut<T: Error + 'static>(&mut self) -> Option<&mut T> {
263240
<Error + 'static>::downcast_mut::<T>(self)
@@ -266,7 +243,7 @@ impl Error + 'static + Send + Sync {
266243

267244
impl Error {
268245
#[inline]
269-
#[stable(feature = "error_downcast", since = "1.3.0")]
246+
#[unstable(feature = "error_downcast", reason = "recently added")]
270247
/// Attempt to downcast the box to a concrete type.
271248
pub fn downcast<T: Error + 'static>(self: Box<Self>) -> Result<Box<T>, Box<Error>> {
272249
if self.is::<T>() {
@@ -287,74 +264,13 @@ impl Error {
287264

288265
impl Error + Send {
289266
#[inline]
290-
#[stable(feature = "error_downcast", since = "1.3.0")]
267+
#[unstable(feature = "error_downcast", reason = "recently added")]
291268
/// Attempt to downcast the box to a concrete type.
292-
pub fn downcast<T: Error + 'static>(self: Box<Self>)
293-
-> Result<Box<T>, Box<Error + Send>> {
269+
pub fn downcast<T: Error + 'static>(self: Box<Self>) -> Result<Box<T>, Box<Error + Send>> {
294270
let err: Box<Error> = self;
295271
<Error>::downcast(err).map_err(|s| unsafe {
296272
// reapply the Send marker
297273
transmute::<Box<Error>, Box<Error + Send>>(s)
298274
})
299275
}
300276
}
301-
302-
impl Error + Send + Sync {
303-
#[inline]
304-
#[stable(feature = "error_downcast", since = "1.3.0")]
305-
/// Attempt to downcast the box to a concrete type.
306-
pub fn downcast<T: Error + 'static>(self: Box<Self>)
307-
-> Result<Box<T>, Box<Self>> {
308-
let err: Box<Error> = self;
309-
<Error>::downcast(err).map_err(|s| unsafe {
310-
// reapply the Send+Sync marker
311-
transmute::<Box<Error>, Box<Error + Send + Sync>>(s)
312-
})
313-
}
314-
}
315-
316-
#[cfg(test)]
317-
mod tests {
318-
use prelude::v1::*;
319-
use super::Error;
320-
use fmt;
321-
322-
#[derive(Debug, PartialEq)]
323-
struct A;
324-
#[derive(Debug, PartialEq)]
325-
struct B;
326-
327-
impl fmt::Display for A {
328-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
329-
write!(f, "A")
330-
}
331-
}
332-
impl fmt::Display for B {
333-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
334-
write!(f, "B")
335-
}
336-
}
337-
338-
impl Error for A {
339-
fn description(&self) -> &str { "A-desc" }
340-
}
341-
impl Error for B {
342-
fn description(&self) -> &str { "A-desc" }
343-
}
344-
345-
#[test]
346-
fn downcasting() {
347-
let mut a = A;
348-
let mut a = &mut a as &mut (Error + 'static);
349-
assert_eq!(a.downcast_ref::<A>(), Some(&A));
350-
assert_eq!(a.downcast_ref::<B>(), None);
351-
assert_eq!(a.downcast_mut::<A>(), Some(&mut A));
352-
assert_eq!(a.downcast_mut::<B>(), None);
353-
354-
let a: Box<Error> = Box::new(A);
355-
match a.downcast::<B>() {
356-
Ok(..) => panic!("expected error"),
357-
Err(e) => assert_eq!(*e.downcast::<A>().unwrap(), A),
358-
}
359-
}
360-
}

0 commit comments

Comments
 (0)