Skip to content

Commit e1295d0

Browse files
committed
---
yaml --- r: 191642 b: refs/heads/tmp c: a7eca31 h: refs/heads/master v: v3
1 parent cfb5593 commit e1295d0

Some content is hidden

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

83 files changed

+1049
-1086
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: 7364022e7ae4b738fb585dd2262ad67ceebd4266
37+
refs/heads/tmp: a7eca31d8095c5acff8ec47b141ddd73e1d64fda
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3939
refs/tags/homu-tmp: 4a5101a42f8ea36bdbe14749e672ab78cb971726

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 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/tmp/src/libarena/lib.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +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;
46+
#[cfg(stage0)] // SNAP 270a677
47+
use std::intrinsics::{get_tydesc, TyDesc};
4748
use std::marker;
4849
use std::mem;
4950
#[cfg(stage0)]
@@ -186,6 +187,27 @@ fn un_bitpack_tydesc_ptr(p: usize) -> (*const TyDesc, bool) {
186187
((p & !1) as *const TyDesc, p & 1 == 1)
187188
}
188189

190+
// HACK(eddyb) TyDesc replacement using a trait object vtable.
191+
// This could be replaced in the future with a custom DST layout,
192+
// or `&'static (drop_glue, size, align)` created by a `const fn`.
193+
#[cfg(not(stage0))] // SNAP 270a677
194+
struct TyDesc {
195+
drop_glue: fn(*const i8),
196+
size: usize,
197+
align: usize
198+
}
199+
200+
#[cfg(not(stage0))] // SNAP 270a677
201+
unsafe fn get_tydesc<T>() -> *const TyDesc {
202+
use std::raw::TraitObject;
203+
204+
let ptr = &*(1 as *const T);
205+
206+
// Can use any trait that is implemented for all types.
207+
let obj = mem::transmute::<&marker::MarkerTrait, TraitObject>(ptr);
208+
obj.vtable as *const TyDesc
209+
}
210+
189211
impl<'longer_than_self> Arena<'longer_than_self> {
190212
fn chunk_size(&self) -> usize {
191213
self.copy_head.borrow().capacity()

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

0 commit comments

Comments
 (0)