Skip to content

Commit f05fef4

Browse files
committed
---
yaml --- r: 193915 b: refs/heads/beta c: c341fe9 h: refs/heads/master i: 193913: a18047f 193911: d2bdfd3 v: v3
1 parent 1afc883 commit f05fef4

Some content is hidden

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

90 files changed

+1291
-1313
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 71982c21245489fd316fc9e82bf7bec4b09d45a6
34+
refs/heads/beta: c341fe9f8cfb6d1aef6c9fb8ba7531a4c0324eef
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

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