Skip to content

Commit 618bd58

Browse files
committed
---
yaml --- r: 191434 b: refs/heads/try c: 2e8e8ab h: refs/heads/master v: v3
1 parent e28c5ef commit 618bd58

File tree

122 files changed

+4529
-2222
lines changed

Some content is hidden

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

122 files changed

+4529
-2222
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: 05354e852235c97d5231d71aeed75114fc55b59f
5+
refs/heads/try: 2e8e8ab564891c3d2ffeeb0f8e1a4e850866f74f
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 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/try/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/try/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/try/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/try/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/try/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
}

branches/try/src/libcollections/lib.rs

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

branches/try/src/libcollections/macros.rs

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,45 @@
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))]
1150
/// Creates a `Vec` containing the arguments.
1251
///
1352
/// `vec!` allows `Vec`s to be defined with the same syntax as array expressions.
@@ -45,10 +84,11 @@ macro_rules! vec {
4584
($($x:expr,)*) => (vec![$($x),*])
4685
}
4786

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)
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)
5190
// NB see the slice::hack module in slice.rs for more information
91+
#[cfg(not(stage0))]
5292
#[cfg(test)]
5393
macro_rules! vec {
5494
($elem:expr; $n:expr) => (

0 commit comments

Comments
 (0)