Skip to content

Commit 639f840

Browse files
committed
---
yaml --- r: 193967 b: refs/heads/beta c: af6cf85 h: refs/heads/master i: 193965: f49515b 193963: b57b15b 193959: d601a69 193951: 6e0c649 v: v3
1 parent 38d3579 commit 639f840

Some content is hidden

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

92 files changed

+3791
-1586
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 08dd30d9eb685f29b82faae66b5fdb9fc4762a91
34+
refs/heads/beta: af6cf85b9815644c77c77cdd141d476efc426d99
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(unboxed_closures)]
2020
#![feature(std_misc)]
2121
#![feature(test)]
22+
#![feature(core)]
2223
#![feature(path_ext)]
2324

2425
#![deny(warnings)]

branches/beta/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_panic` - indicates that this test function should panic, inverting the success condition.
2071+
- `should_fail` - 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/beta/src/doc/trpl/crates-and-modules.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,6 @@ 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-
570565
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
571566
`use` declarations go first.
572567

branches/beta/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_panic
182+
```should_fail
183183
# fn diverges() -> ! {
184184
# panic!("This function never returns!");
185185
# }

branches/beta/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_panic`:
132+
We can invert our test's failure with another attribute: `should_fail`:
133133

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

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

172-
Does this test pass or fail? Because of the `should_panic` attribute, it
172+
Does this test pass or fail? Because of the `should_fail` 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_panic` tests can be fragile, as it's hard to guarantee that the test
192+
`should_fail` 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_panic` attribute. The test harness will
194+
parameter can be added to the `should_fail` 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_panic(expected = "assertion failed")]
200+
#[should_fail(expected = "assertion failed")]
201201
fn it_works() {
202202
assert_eq!("Hello", "world");
203203
}

branches/beta/src/liballoc/arc.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -210,21 +210,6 @@ 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-
}
228213
}
229214

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

372-
unsafe {
373-
self.drop_slow()
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>>()) }
374364
}
375365
}
376366
}

branches/beta/src/liballoc/boxed.rs

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

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

branches/beta/src/liballoc/heap.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
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+
1115
// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`
1216

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

branches/beta/src/liballoc/rc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ 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))]
162165
use core::ptr;
163166
use core::result::Result;
164167
use core::result::Result::{Ok, Err};

branches/beta/src/libarena/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ 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};
4648
use std::marker;
4749
use std::mem;
50+
#[cfg(stage0)]
51+
use std::num::{Int, UnsignedInt};
4852
use std::ptr;
4953
use std::rc::Rc;
5054
use std::rt::heap::{allocate, deallocate};
@@ -186,12 +190,14 @@ fn un_bitpack_tydesc_ptr(p: usize) -> (*const TyDesc, bool) {
186190
// HACK(eddyb) TyDesc replacement using a trait object vtable.
187191
// This could be replaced in the future with a custom DST layout,
188192
// or `&'static (drop_glue, size, align)` created by a `const fn`.
193+
#[cfg(not(stage0))] // SNAP 270a677
189194
struct TyDesc {
190195
drop_glue: fn(*const i8),
191196
size: usize,
192197
align: usize
193198
}
194199

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ 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+
108111
assert!(target_alignment.is_power_of_two());
109112
(unrounded + target_alignment - 1) & !(target_alignment - 1)
110113
}

0 commit comments

Comments
 (0)