Skip to content

Commit e05588b

Browse files
committed
---
yaml --- r: 191431 b: refs/heads/try c: 48df3fb h: refs/heads/master i: 191429: e4c34aa 191427: cb88a9a 191423: 26f2545 v: v3
1 parent 5b56a54 commit e05588b

File tree

137 files changed

+2437
-5288
lines changed

Some content is hidden

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

137 files changed

+2437
-5288
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: 2d701e6b1979b7ee0c50c51d1008b7c2138d5ec2
5+
refs/heads/try: 48df3fb678d0a6a3eb1407410673de7ef8a1ae2f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

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/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: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ extern crate alloc;
4242

4343
use std::cell::{Cell, RefCell};
4444
use std::cmp;
45-
use std::intrinsics::{TyDesc, get_tydesc};
4645
use std::intrinsics;
4746
use std::marker;
4847
use std::mem;
49-
#[cfg(stage0)]
50-
use std::num::{Int, UnsignedInt};
5148
use std::ptr;
5249
use std::rc::Rc;
5350
use std::rt::heap::{allocate, deallocate};
@@ -186,6 +183,25 @@ fn un_bitpack_tydesc_ptr(p: usize) -> (*const TyDesc, bool) {
186183
((p & !1) as *const TyDesc, p & 1 == 1)
187184
}
188185

186+
// HACK(eddyb) TyDesc replacement using a trait object vtable.
187+
// This could be replaced in the future with a custom DST layout,
188+
// or `&'static (drop_glue, size, align)` created by a `const fn`.
189+
struct TyDesc {
190+
drop_glue: fn(*const i8),
191+
size: usize,
192+
align: usize
193+
}
194+
195+
unsafe fn get_tydesc<T>() -> *const TyDesc {
196+
use std::raw::TraitObject;
197+
198+
let ptr = &*(1 as *const T);
199+
200+
// Can use any trait that is implemented for all types.
201+
let obj = mem::transmute::<&marker::MarkerTrait, TraitObject>(ptr);
202+
obj.vtable as *const TyDesc
203+
}
204+
189205
impl<'longer_than_self> Arena<'longer_than_self> {
190206
fn chunk_size(&self) -> usize {
191207
self.copy_head.borrow().capacity()

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
}

branches/try/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#![feature(unique)]
3636
#![feature(unsafe_no_drop_flag)]
3737
#![feature(step_by)]
38+
#![feature(str_char)]
3839
#![cfg_attr(test, feature(rand, rustc_private, test))]
3940
#![cfg_attr(test, allow(deprecated))] // rand
4041

branches/try/src/libcollections/macros.rs

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

11-
#[cfg(stage0)]
12-
/// Creates a `Vec` containing the arguments.
13-
///
14-
/// `vec!` allows `Vec`s to be defined with the same syntax as array expressions.
15-
/// There are two forms of this macro:
16-
///
17-
/// - Create a `Vec` containing a given list of elements:
18-
///
19-
/// ```
20-
/// let v = vec![1, 2, 3];
21-
/// assert_eq!(v[0], 1);
22-
/// assert_eq!(v[1], 2);
23-
/// assert_eq!(v[2], 3);
24-
/// ```
25-
///
26-
/// - Create a `Vec` from a given element and size:
27-
///
28-
/// ```
29-
/// let v = vec![1; 3];
30-
/// assert_eq!(v, [1, 1, 1]);
31-
/// ```
32-
///
33-
/// Note that unlike array expressions this syntax supports all elements
34-
/// which implement `Clone` and the number of elements doesn't have to be
35-
/// a constant.
36-
#[macro_export]
37-
#[stable(feature = "rust1", since = "1.0.0")]
38-
macro_rules! vec {
39-
($elem:expr; $n:expr) => (
40-
$crate::vec::from_elem($elem, $n)
41-
);
42-
($($x:expr),*) => (
43-
<[_] as $crate::slice::SliceExt>::into_vec(
44-
$crate::boxed::Box::new([$($x),*]))
45-
);
46-
($($x:expr,)*) => (vec![$($x),*])
47-
}
48-
49-
#[cfg(not(stage0))]
5011
/// Creates a `Vec` containing the arguments.
5112
///
5213
/// `vec!` allows `Vec`s to be defined with the same syntax as array expressions.
@@ -84,11 +45,10 @@ macro_rules! vec {
8445
($($x:expr,)*) => (vec![$($x),*])
8546
}
8647

87-
// HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is required for this
88-
// macro definition, is not available. Instead use the `slice::into_vec` function which is only
89-
// available with cfg(test)
48+
// HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is
49+
// required for this macro definition, is not available. Instead use the
50+
// `slice::into_vec` function which is only available with cfg(test)
9051
// NB see the slice::hack module in slice.rs for more information
91-
#[cfg(not(stage0))]
9252
#[cfg(test)]
9353
macro_rules! vec {
9454
($elem:expr; $n:expr) => (

0 commit comments

Comments
 (0)