Skip to content

Commit 3b6783b

Browse files
committed
---
yaml --- r: 191474 b: refs/heads/try c: f4e0ce6 h: refs/heads/master v: v3
1 parent 0900d87 commit 3b6783b

File tree

131 files changed

+2388
-4044
lines changed

Some content is hidden

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

131 files changed

+2388
-4044
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c64d671671aea2e44ee7fc6eb00ee75fc30ed7b9
5-
refs/heads/try: 1ea971ff87e7aee729c7330a394b975fb3a598b1
5+
refs/heads/try: f4e0ce66a3cde6bd0df54a367896c5c6a3392c53
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/compiletest/compiletest.rs

Lines changed: 0 additions & 1 deletion
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)]

branches/try/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 range = haystack.char_range_at(*idx);
1056-
if range.ch != needle {
1055+
let ch = haystack.char_at(*idx);
1056+
if ch != needle {
10571057
return false;
10581058
}
1059-
*idx = range.next;
1059+
*idx += ch.len_utf8();
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 range = haystack.char_range_at(i);
1067-
if range.ch < '0' || '9' < range.ch {
1066+
let ch = haystack.char_at(i);
1067+
if ch < '0' || '9' < ch {
10681068
break;
10691069
}
1070-
i = range.next;
1070+
i += ch.len_utf8();
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 range = haystack.char_range_at(haystack_i);
1087-
haystack_i = range.next;
1088-
if !scan_char(needle, range.ch, &mut needle_i) {
1086+
let ch = haystack.char_at(haystack_i);
1087+
haystack_i += ch.len_utf8();
1088+
if !scan_char(needle, ch, &mut needle_i) {
10891089
return false;
10901090
}
10911091
}

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