Skip to content

Commit eeb8450

Browse files
committed
---
yaml --- r: 272197 b: refs/heads/auto c: 33db2d6 h: refs/heads/master i: 272195: 8465503
1 parent 95942af commit eeb8450

File tree

249 files changed

+1751
-1803
lines changed

Some content is hidden

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

249 files changed

+1751
-1803
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: e004ce1a322739b21960154d6174e41cd9c9666b
11+
refs/heads/auto: 33db2d65ffd5b988fdedc8ed91b395abaa57f777
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/COMPILER_TESTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn test_foo() {
7777
}
7878
```
7979

80-
Note that not all headers have meaning when customized to a revision.
80+
Note that not all headers have meaning when customized too a revision.
8181
For example, the `ignore-test` header (and all "ignore" headers)
8282
currently only apply to the test as a whole, not to particular
8383
revisions. The only headers that are intended to really work when

branches/auto/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,10 @@ To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).
177177
Rust has an [IRC] culture and most real-time collaboration happens in a
178178
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
179179
most popular channel is [#rust], a venue for general discussion about
180-
Rust. And a good place to ask for help would be [#rust-beginners].
180+
Rust, and a good place to ask for help.
181181
182182
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
183183
[#rust]: irc://irc.mozilla.org/rust
184-
[#rust-beginners]: irc://irc.mozilla.org/rust-beginners
185184
186185
## License
187186

branches/auto/mk/crates.mk

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
61-
rustc_const_eval rustc_const_math
61+
rustc_const_eval
6262
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
6363
flate arena graphviz rbml log serialize
6464
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@@ -92,39 +92,36 @@ DEPS_test := std getopts term native:rust_test_helpers
9292
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
9393
DEPS_syntax_ext := syntax fmt_macros
9494

95-
DEPS_rustc_const_math := std syntax log serialize
96-
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize rustc_front \
97-
rustc_back graphviz
95+
DEPS_rustc_const_eval := std syntax
9896

9997
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
10098
log graphviz rustc_back rustc_data_structures\
101-
rustc_const_math
99+
rustc_const_eval
102100
DEPS_rustc_back := std syntax rustc_front flate log libc
103101
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
104102
DEPS_rustc_data_structures := std log serialize
105103
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
106104
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
107105
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
108-
rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval
106+
rustc_metadata syntax_ext rustc_passes rustc_save_analysis
109107
DEPS_rustc_front := std syntax log serialize
110-
DEPS_rustc_lint := rustc log syntax rustc_const_eval
108+
DEPS_rustc_lint := rustc log syntax
111109
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
112-
DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_math
113-
DEPS_rustc_passes := syntax rustc core rustc_front rustc_const_eval
114-
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_math rustc_const_eval
110+
DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
111+
DEPS_rustc_passes := syntax rustc core rustc_front
112+
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
115113
DEPS_rustc_resolve := arena rustc rustc_front log syntax
116114
DEPS_rustc_platform_intrinsics := std
117115
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
118116
DEPS_rustc_privacy := rustc rustc_front log syntax
119117
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
120118
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
121-
rustc_const_math rustc_const_eval
119+
rustc_const_eval
122120
DEPS_rustc_save_analysis := rustc log syntax rustc_front
123-
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_math \
124-
rustc_const_eval
121+
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_eval
125122

126123
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
127-
test rustc_lint rustc_front rustc_const_eval
124+
test rustc_lint rustc_front
128125

129126

130127
TOOL_DEPS_compiletest := test getopts log

branches/auto/src/doc/book/associated-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ declarations.
131131
## Trait objects with associated types
132132

133133
There’s one more bit of syntax we should talk about: trait objects. If you
134-
try to create a trait object from a trait with an associated type, like this:
134+
try to create a trait object from an associated type, like this:
135135

136136
```rust,ignore
137137
# trait Graph {

branches/auto/src/doc/book/getting-started.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,13 @@ installed. Doing so will depend on your specific system, consult its
164164
documentation for more details.
165165

166166
If not, there are a number of places where we can get help. The easiest is
167-
[the #rust-beginners IRC channel on irc.mozilla.org][irc-beginners] and for
168-
general discussion [the #rust IRC channel on irc.mozilla.org][irc], which we
169-
can access through [Mibbit][mibbit]. Then we'll be chatting with other
170-
Rustaceans (a silly nickname we call ourselves) who can help us out. Other great
171-
resources include [the user’s forum][users] and [Stack Overflow][stackoverflow].
167+
[the #rust IRC channel on irc.mozilla.org][irc], which we can access through
168+
[Mibbit][mibbit]. Click that link, and we'll be chatting with other Rustaceans
169+
(a silly nickname we call ourselves) who can help us out. Other great resources
170+
include [the user’s forum][users], and [Stack Overflow][stackoverflow].
172171

173-
[irc-beginners]: irc://irc.mozilla.org/#rust-beginners
174172
[irc]: irc://irc.mozilla.org/#rust
175-
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-beginners,%23rust
173+
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
176174
[users]: https://users.rust-lang.org/
177175
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust
178176

branches/auto/src/doc/book/no-stdlib.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
3838
// for a bare-bones hello world. These are normally
3939
// provided by libstd.
4040
#[lang = "eh_personality"] extern fn eh_personality() {}
41-
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
41+
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
4242
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
4343
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
4444
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
@@ -65,7 +65,7 @@ pub extern fn main(argc: i32, argv: *const *const u8) -> i32 {
6565
}
6666

6767
#[lang = "eh_personality"] extern fn eh_personality() {}
68-
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { loop {} }
68+
#[lang = "panic_fmt"] fn panic_fmt() -> ! { loop {} }
6969
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
7070
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
7171
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}

branches/auto/src/doc/book/vectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ You can iterate the vector multiple times by taking a reference to the vector wh
120120
For example, the following code does not compile.
121121

122122
```rust,ignore
123-
let v = vec![1, 2, 3, 4, 5];
123+
let mut v = vec![1, 2, 3, 4, 5];
124124
125125
for i in v {
126126
println!("Take ownership of the vector and its element {}", i);
@@ -134,7 +134,7 @@ for i in v {
134134
Whereas the following works perfectly,
135135

136136
```rust
137-
let v = vec![1, 2, 3, 4, 5];
137+
let mut v = vec![1, 2, 3, 4, 5];
138138

139139
for i in &v {
140140
println!("This is a reference to {}", i);

branches/auto/src/doc/nomicon/vec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
To bring everything together, we're going to write `std::Vec` from scratch.
44
Because all the best tools for writing unsafe code are unstable, this
5-
project will only work on nightly (as of Rust 1.9.0). With the exception of the
5+
project will only work on nightly (as of Rust 1.2.0). With the exception of the
66
allocator API, much of the unstable code we'll use is expected to be stabilized
77
in a similar form as it is today.
88

branches/auto/src/libcollections/binary_heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ use vec::{self, Vec};
194194
///
195195
/// // We can iterate over the items in the heap, although they are returned in
196196
/// // a random order.
197-
/// for x in &heap {
197+
/// for x in heap.iter() {
198198
/// println!("{}", x);
199199
/// }
200200
///

branches/auto/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#![feature(placement_new_protocol)]
4949
#![feature(shared)]
5050
#![feature(slice_patterns)]
51-
#![feature(specialization)]
5251
#![feature(staged_api)]
5352
#![feature(step_by)]
5453
#![feature(str_char)]

branches/auto/src/libcollections/string.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ pub trait ToString {
17551755
#[stable(feature = "rust1", since = "1.0.0")]
17561756
impl<T: fmt::Display + ?Sized> ToString for T {
17571757
#[inline]
1758-
default fn to_string(&self) -> String {
1758+
fn to_string(&self) -> String {
17591759
use core::fmt::Write;
17601760
let mut buf = String::new();
17611761
let _ = buf.write_fmt(format_args!("{}", self));
@@ -1764,14 +1764,6 @@ impl<T: fmt::Display + ?Sized> ToString for T {
17641764
}
17651765
}
17661766

1767-
#[stable(feature = "str_to_string_specialization", since = "1.9.0")]
1768-
impl ToString for str {
1769-
#[inline]
1770-
fn to_string(&self) -> String {
1771-
String::from(self)
1772-
}
1773-
}
1774-
17751767
#[stable(feature = "rust1", since = "1.0.0")]
17761768
impl AsRef<str> for String {
17771769
#[inline]

branches/auto/src/libcore/cell.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@
147147
use clone::Clone;
148148
use cmp::{PartialEq, Eq};
149149
use default::Default;
150-
use marker::{Copy, Send, Sync, Sized};
151-
use ops::{Deref, DerefMut, Drop, FnOnce};
150+
use marker::{Copy, Send, Sync, Sized, Unsize};
151+
use ops::{Deref, DerefMut, Drop, FnOnce, CoerceUnsized};
152152
use option::Option;
153153
use option::Option::{None, Some};
154154

@@ -216,6 +216,10 @@ impl<T:Copy> Cell<T> {
216216

217217
/// Returns a reference to the underlying `UnsafeCell`.
218218
///
219+
/// # Safety
220+
///
221+
/// This function is `unsafe` because `UnsafeCell`'s field is public.
222+
///
219223
/// # Examples
220224
///
221225
/// ```
@@ -225,11 +229,11 @@ impl<T:Copy> Cell<T> {
225229
///
226230
/// let c = Cell::new(5);
227231
///
228-
/// let uc = c.as_unsafe_cell();
232+
/// let uc = unsafe { c.as_unsafe_cell() };
229233
/// ```
230234
#[inline]
231235
#[unstable(feature = "as_unsafe_cell", issue = "27708")]
232-
pub fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
236+
pub unsafe fn as_unsafe_cell(&self) -> &UnsafeCell<T> {
233237
&self.value
234238
}
235239
}
@@ -634,6 +638,9 @@ impl<'b, T: ?Sized> Ref<'b, T> {
634638
}
635639
}
636640

641+
#[unstable(feature = "coerce_unsized", issue = "27732")]
642+
impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b, T> {}
643+
637644
impl<'b, T: ?Sized> RefMut<'b, T> {
638645
/// Make a new `RefMut` for a component of the borrowed data, e.g. an enum
639646
/// variant.
@@ -766,6 +773,9 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
766773
}
767774
}
768775

776+
#[unstable(feature = "coerce_unsized", issue = "27732")]
777+
impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefMut<'b, T> {}
778+
769779
/// The core primitive for interior mutability in Rust.
770780
///
771781
/// `UnsafeCell<T>` is a type that wraps some `T` and indicates unsafe interior operations on the

branches/auto/src/libcore/convert.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
//!
2020
//! - Impl the `As*` traits for reference-to-reference conversions
2121
//! - Impl the `Into` trait when you want to consume the value in the conversion
22-
//! - The `From` trait is the most flexible, useful for value _and_ reference conversions
22+
//! - The `From` trait is the most flexible, useful for values _and_ references conversions
2323
//!
24-
//! As a library author, you should prefer implementing `From<T>` rather than
25-
//! `Into<U>`, as `From` provides greater flexibility and offers an equivalent `Into`
24+
//! As a library writer, you should prefer implementing `From<T>` rather than
25+
//! `Into<U>`, as `From` provides greater flexibility and offer the equivalent `Into`
2626
//! implementation for free, thanks to a blanket implementation in the standard library.
2727
//!
2828
//! **Note: these traits must not fail**. If the conversion can fail, you must use a dedicated
29-
//! method which returns an `Option<T>` or a `Result<T, E>`.
29+
//! method which return an `Option<T>` or a `Result<T, E>`.
3030
//!
3131
//! # Generic impl
3232
//!
@@ -49,7 +49,7 @@ use marker::Sized;
4949
/// [book]: ../../book/borrow-and-asref.html
5050
///
5151
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
52-
/// returns an `Option<T>` or a `Result<T, E>`.
52+
/// return an `Option<T>` or a `Result<T, E>`.
5353
///
5454
/// # Examples
5555
///
@@ -82,7 +82,7 @@ pub trait AsRef<T: ?Sized> {
8282
/// A cheap, mutable reference-to-mutable reference conversion.
8383
///
8484
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
85-
/// returns an `Option<T>` or a `Result<T, E>`.
85+
/// return an `Option<T>` or a `Result<T, E>`.
8686
///
8787
/// # Generic Impls
8888
///
@@ -99,10 +99,10 @@ pub trait AsMut<T: ?Sized> {
9999
/// A conversion that consumes `self`, which may or may not be expensive.
100100
///
101101
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
102-
/// returns an `Option<T>` or a `Result<T, E>`.
102+
/// return an `Option<T>` or a `Result<T, E>`.
103103
///
104-
/// Library authors should not directly implement this trait, but should prefer implementing
105-
/// the `From` trait, which offers greater flexibility and provides an equivalent `Into`
104+
/// Library writer should not implement directly this trait, but should prefer the implementation
105+
/// of the `From` trait, which offer greater flexibility and provide the equivalent `Into`
106106
/// implementation for free, thanks to a blanket implementation in the standard library.
107107
///
108108
/// # Examples
@@ -134,7 +134,7 @@ pub trait Into<T>: Sized {
134134
/// Construct `Self` via a conversion.
135135
///
136136
/// **Note: this trait must not fail**. If the conversion can fail, use a dedicated method which
137-
/// returns an `Option<T>` or a `Result<T, E>`.
137+
/// return an `Option<T>` or a `Result<T, E>`.
138138
///
139139
/// # Examples
140140
///

branches/auto/src/libcore/sync/atomic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ impl AtomicIsize {
695695
unsafe { atomic_compare_exchange(self.v.get(), current, new, success, failure) }
696696
}
697697

698-
/// Stores a value into the `isize` if the current value is the same as the `current` value.
698+
/// Stores a value into the `isize if the current value is the same as the `current` value.
699699
///
700700
/// Unlike `compare_exchange`, this function is allowed to spuriously fail even when the
701701
/// comparison succeeds, which can result in more efficient code on some platforms. The

branches/auto/src/libcoretest/cell.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,23 @@ fn refcell_unsized() {
261261
let comp: &mut [i32] = &mut [4, 2, 5];
262262
assert_eq!(&*cell.borrow(), comp);
263263
}
264+
265+
#[test]
266+
fn refcell_ref_coercion() {
267+
let cell: RefCell<[i32; 3]> = RefCell::new([1, 2, 3]);
268+
{
269+
let mut cellref: RefMut<[i32; 3]> = cell.borrow_mut();
270+
cellref[0] = 4;
271+
let mut coerced: RefMut<[i32]> = cellref;
272+
coerced[2] = 5;
273+
}
274+
{
275+
let comp: &mut [i32] = &mut [4, 2, 5];
276+
let cellref: Ref<[i32; 3]> = cell.borrow();
277+
assert_eq!(&*cellref, comp);
278+
let coerced: Ref<[i32]> = cellref;
279+
assert_eq!(&*coerced, comp);
280+
}
281+
}
282+
283+

branches/auto/src/librustc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ log = { path = "../liblog" }
1818
rbml = { path = "../librbml" }
1919
rustc_back = { path = "../librustc_back" }
2020
rustc_bitflags = { path = "../librustc_bitflags" }
21-
rustc_const_math = { path = "../librustc_const_math" }
21+
rustc_const_eval = { path = "../librustc_const_eval" }
2222
rustc_data_structures = { path = "../librustc_data_structures" }
2323
rustc_front = { path = "../librustc_front" }
2424
serialize = { path = "../libserialize" }

0 commit comments

Comments
 (0)