Skip to content

Commit aa3b18d

Browse files
committed
---
yaml --- r: 191709 b: refs/heads/tmp c: f2e3c74 h: refs/heads/master i: 191707: 603f67f v: v3
1 parent df91a57 commit aa3b18d

File tree

123 files changed

+3870
-2225
lines changed

Some content is hidden

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

123 files changed

+3870
-2225
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: e98e391337fdbf32607de4889345c13fed9de21b
37+
refs/heads/tmp: f2e3c7469b56cd744e613a05a1ea73f441f66401
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3939
refs/tags/homu-tmp: 4a5101a42f8ea36bdbe14749e672ab78cb971726

branches/tmp/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/tmp/src/compiletest/runtest.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,22 +1052,22 @@ fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10521052
if *idx >= haystack.len() {
10531053
return false;
10541054
}
1055-
let ch = haystack.char_at(*idx);
1056-
if ch != needle {
1055+
let range = haystack.char_range_at(*idx);
1056+
if range.ch != needle {
10571057
return false;
10581058
}
1059-
*idx += ch.len_utf8();
1059+
*idx = range.next;
10601060
return true;
10611061
}
10621062

10631063
fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
10641064
let mut i = *idx;
10651065
while i < haystack.len() {
1066-
let ch = haystack.char_at(i);
1067-
if ch < '0' || '9' < ch {
1066+
let range = haystack.char_range_at(i);
1067+
if range.ch < '0' || '9' < range.ch {
10681068
break;
10691069
}
1070-
i += ch.len_utf8();
1070+
i = range.next;
10711071
}
10721072
if i == *idx {
10731073
return false;
@@ -1083,9 +1083,9 @@ fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
10831083
if haystack_i >= haystack.len() {
10841084
return false;
10851085
}
1086-
let ch = haystack.char_at(haystack_i);
1087-
haystack_i += ch.len_utf8();
1088-
if !scan_char(needle, ch, &mut needle_i) {
1086+
let range = haystack.char_range_at(haystack_i);
1087+
haystack_i = range.next;
1088+
if !scan_char(needle, range.ch, &mut needle_i) {
10891089
return false;
10901090
}
10911091
}

branches/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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/tmp/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)