Skip to content

Commit 375d38c

Browse files
committed
---
yaml --- r: 191086 b: refs/heads/auto c: 90e7f47 h: refs/heads/master v: v3
1 parent f903372 commit 375d38c

File tree

115 files changed

+1921
-3796
lines changed

Some content is hidden

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

115 files changed

+1921
-3796
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: a7a28d709170f5dd14439c83d115e16a11c53c06
13+
refs/heads/auto: 90e7f472f7b1a71998e0133f00b615524cc36a33
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
# make check-stage1-rpass TESTNAME=my-shiny-new-test
9898
#
9999
# // Having trouble figuring out which test is failing? Turn off parallel tests
100-
# make check-stage1-std RUST_TEST_TASKS=1
100+
# make check-stage1-std RUST_TEST_THREADS=1
101101
#
102102
# This is hardly all there is to know of The Rust Build System's
103103
# mysteries. The tale continues on the wiki[1].

branches/auto/src/compiletest/compiletest.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#![feature(unboxed_closures)]
2020
#![feature(std_misc)]
2121
#![feature(test)]
22-
#![feature(core)]
2322
#![feature(path_ext)]
2423

2524
#![deny(warnings)]
@@ -225,15 +224,15 @@ pub fn run_tests(config: &Config) {
225224
// android debug-info test uses remote debugger
226225
// so, we test 1 task at once.
227226
// also trying to isolate problems with adb_run_wrapper.sh ilooping
228-
env::set_var("RUST_TEST_TASKS","1");
227+
env::set_var("RUST_TEST_THREADS","1");
229228
}
230229

231230
match config.mode {
232231
DebugInfoLldb => {
233232
// Some older versions of LLDB seem to have problems with multiple
234233
// instances running in parallel, so only run one test task at a
235234
// time.
236-
env::set_var("RUST_TEST_TASKS", "1");
235+
env::set_var("RUST_TEST_THREADS", "1");
237236
}
238237
_ => { /* proceed */ }
239238
}

branches/auto/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
131131
true
132132
});
133133

134-
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_TASKS"] {
134+
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_THREADS"] {
135135
match env::var(key) {
136136
Ok(val) =>
137137
if exec_env.iter().find(|&&(ref x, _)| *x == key.to_string()).is_none() {

branches/auto/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ type int8_t = i8;
20682068
item](#language-items) for more details.
20692069
- `test` - indicates that this function is a test function, to only be compiled
20702070
in case of `--test`.
2071-
- `should_fail` - indicates that this test function should panic, inverting the success condition.
2071+
- `should_panic` - indicates that this test function should panic, inverting the success condition.
20722072
- `cold` - The function is unlikely to be executed, so optimize it (and calls
20732073
to it) differently.
20742074

branches/auto/src/doc/trpl/crates-and-modules.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,11 @@ place in the hierarchy instead. There's one more special form of `use`: you can
562562
people like to think of `self` as `.` and `super` as `..`, from many shells'
563563
display for the current directory and the parent directory.
564564
565+
Outside of `use`, paths are relative: `foo::bar()` refers to a function inside
566+
of `foo` relative to where we are. If that's prefixed with `::`, as in
567+
`::foo::bar()`, it refers to a different `foo`, an absolute path from your
568+
crate root.
569+
565570
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
566571
`use` declarations go first.
567572

branches/auto/src/doc/trpl/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Because this function will cause a crash, it will never return, and so it has
179179
the type '`!`', which is read "diverges." A diverging function can be used
180180
as any type:
181181

182-
```should_fail
182+
```should_panic
183183
# fn diverges() -> ! {
184184
# panic!("This function never returns!");
185185
# }

branches/auto/src/doc/trpl/pointers.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -561,38 +561,40 @@ fn main() {
561561
In this case, Rust knows that `x` is being *borrowed* by the `add_one()`
562562
function, and since it's only reading the value, allows it.
563563

564-
We can borrow `x` multiple times, as long as it's not simultaneous:
564+
We can borrow `x` as read-only multiple times, even simultaneously:
565565

566566
```{rust}
567-
fn add_one(x: &i32) -> i32 {
568-
*x + 1
567+
fn add(x: &i32, y: &i32) -> i32 {
568+
*x + *y
569569
}
570570
571571
fn main() {
572572
let x = Box::new(5);
573573
574-
println!("{}", add_one(&*x));
575-
println!("{}", add_one(&*x));
576-
println!("{}", add_one(&*x));
574+
println!("{}", add(&x, &x));
575+
println!("{}", add(&x, &x));
577576
}
578577
```
579578

580-
Or as long as it's not a mutable borrow. This will error:
579+
We can mutably borrow `x` multiple times, but only if x itself is mutable, and
580+
it may not be *simultaneously* borrowed:
581581

582582
```{rust,ignore}
583-
fn add_one(x: &mut i32) -> i32 {
584-
*x + 1
583+
fn increment(x: &mut i32) {
584+
*x += 1;
585585
}
586586
587587
fn main() {
588-
let x = Box::new(5);
588+
// If variable x is not "mut", this will not compile
589+
let mut x = Box::new(5);
589590
590-
println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference
591-
// of `&`-pointer as mutable
591+
increment(&mut x);
592+
increment(&mut x);
593+
println!("{}", x);
592594
}
593595
```
594596

595-
Notice we changed the signature of `add_one()` to request a mutable reference.
597+
Notice the signature of `increment()` requests a mutable reference.
596598

597599
## Best practices
598600

branches/auto/src/doc/trpl/testing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ $ echo $?
129129

130130
This is useful if you want to integrate `cargo test` into other tooling.
131131

132-
We can invert our test's failure with another attribute: `should_fail`:
132+
We can invert our test's failure with another attribute: `should_panic`:
133133

134134
```rust
135135
#[test]
136-
#[should_fail]
136+
#[should_panic]
137137
fn it_works() {
138138
assert!(false);
139139
}
@@ -163,13 +163,13 @@ equality:
163163

164164
```rust
165165
#[test]
166-
#[should_fail]
166+
#[should_panic]
167167
fn it_works() {
168168
assert_eq!("Hello", "world");
169169
}
170170
```
171171

172-
Does this test pass or fail? Because of the `should_fail` attribute, it
172+
Does this test pass or fail? Because of the `should_panic` attribute, it
173173
passes:
174174

175175
```bash
@@ -189,15 +189,15 @@ running 0 tests
189189
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
190190
```
191191

192-
`should_fail` tests can be fragile, as it's hard to guarantee that the test
192+
`should_panic` tests can be fragile, as it's hard to guarantee that the test
193193
didn't fail for an unexpected reason. To help with this, an optional `expected`
194-
parameter can be added to the `should_fail` attribute. The test harness will
194+
parameter can be added to the `should_panic` attribute. The test harness will
195195
make sure that the failure message contains the provided text. A safer version
196196
of the example above would be:
197197

198198
```
199199
#[test]
200-
#[should_fail(expected = "assertion failed")]
200+
#[should_panic(expected = "assertion failed")]
201201
fn it_works() {
202202
assert_eq!("Hello", "world");
203203
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ offered by the Rust language and libraries. For example, they
9393
- are plain-old-data, that is, they don't move ownership, again unlike
9494
`Box`, hence the Rust compiler cannot protect against bugs like
9595
use-after-free;
96-
- are considered sendable (if their contents is considered sendable),
97-
so the compiler offers no assistance with ensuring their use is
98-
thread-safe; for example, one can concurrently access a `*mut i32`
99-
from two threads without synchronization.
10096
- lack any form of lifetimes, unlike `&`, and so the compiler cannot
10197
reason about dangling pointers; and
10298
- have no guarantees about aliasing or mutability other than mutation

branches/auto/src/liballoc/arc.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ impl<T> Arc<T> {
210210
// contents.
211211
unsafe { &**self._ptr }
212212
}
213+
214+
// Non-inlined part of `drop`.
215+
#[inline(never)]
216+
unsafe fn drop_slow(&mut self) {
217+
let ptr = *self._ptr;
218+
219+
// Destroy the data at this time, even though we may not free the box allocation itself
220+
// (there may still be weak pointers lying around).
221+
drop(ptr::read(&self.inner().data));
222+
223+
if self.inner().weak.fetch_sub(1, Release) == 1 {
224+
atomic::fence(Acquire);
225+
deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(), min_align_of::<ArcInner<T>>())
226+
}
227+
}
213228
}
214229

215230
/// Get the number of weak references to this value.
@@ -325,6 +340,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
325340
///
326341
/// } // implicit drop
327342
/// ```
343+
#[inline]
328344
fn drop(&mut self) {
329345
// This structure has #[unsafe_no_drop_flag], so this drop glue may run more than once (but
330346
// it is guaranteed to be zeroed after the first if it's run more than once)
@@ -353,14 +369,8 @@ impl<T: Sync + Send> Drop for Arc<T> {
353369
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
354370
atomic::fence(Acquire);
355371

356-
// Destroy the data at this time, even though we may not free the box allocation itself
357-
// (there may still be weak pointers lying around).
358-
unsafe { drop(ptr::read(&self.inner().data)); }
359-
360-
if self.inner().weak.fetch_sub(1, Release) == 1 {
361-
atomic::fence(Acquire);
362-
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
363-
min_align_of::<ArcInner<T>>()) }
372+
unsafe {
373+
self.drop_slow()
364374
}
365375
}
366376
}

branches/auto/src/liballoc/boxed.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ impl BoxAny for Box<Any> {
264264
}
265265
}
266266

267-
#[cfg(not(stage0))]
268267
#[stable(feature = "rust1", since = "1.0.0")]
269268
impl BoxAny for Box<Any+Send> {
270269
#[inline]

branches/auto/src/liballoc/heap.rs

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

11-
#[cfg(stage0)]
12-
#[cfg(not(test))]
13-
use core::ptr::PtrExt;
14-
1511
// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`
1612

1713
/// Return a pointer to `size` bytes of memory aligned to `align`.

branches/auto/src/liballoc/rc.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ use core::nonzero::NonZero;
159159
use core::ops::{Deref, Drop};
160160
use core::option::Option;
161161
use core::option::Option::{Some, None};
162-
#[cfg(stage0)]
163-
use core::ptr::{self, PtrExt};
164-
#[cfg(not(stage0))]
165162
use core::ptr;
166163
use core::result::Result;
167164
use core::result::Result::{Ok, Err};

branches/auto/src/libarena/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ extern crate alloc;
4343
use std::cell::{Cell, RefCell};
4444
use std::cmp;
4545
use std::intrinsics;
46-
#[cfg(stage0)] // SNAP 270a677
47-
use std::intrinsics::{get_tydesc, TyDesc};
4846
use std::marker;
4947
use std::mem;
50-
#[cfg(stage0)]
51-
use std::num::{Int, UnsignedInt};
5248
use std::ptr;
5349
use std::rc::Rc;
5450
use std::rt::heap::{allocate, deallocate};
@@ -190,14 +186,12 @@ fn un_bitpack_tydesc_ptr(p: usize) -> (*const TyDesc, bool) {
190186
// HACK(eddyb) TyDesc replacement using a trait object vtable.
191187
// This could be replaced in the future with a custom DST layout,
192188
// or `&'static (drop_glue, size, align)` created by a `const fn`.
193-
#[cfg(not(stage0))] // SNAP 270a677
194189
struct TyDesc {
195190
drop_glue: fn(*const i8),
196191
size: usize,
197192
align: usize
198193
}
199194

200-
#[cfg(not(stage0))] // SNAP 270a677
201195
unsafe fn get_tydesc<T>() -> *const TyDesc {
202196
use std::raw::TraitObject;
203197

branches/auto/src/libcollections/btree/node.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ struct MutNodeSlice<'a, K: 'a, V: 'a> {
105105
/// Fails if `target_alignment` is not a power of two.
106106
#[inline]
107107
fn round_up_to_next(unrounded: usize, target_alignment: usize) -> usize {
108-
#[cfg(stage0)]
109-
use core::num::UnsignedInt;
110-
111108
assert!(target_alignment.is_power_of_two());
112109
(unrounded + target_alignment - 1) & !(target_alignment - 1)
113110
}

0 commit comments

Comments
 (0)