Skip to content

Commit 12c1904

Browse files
committed
---
yaml --- r: 56734 b: refs/heads/try c: 2190efb h: refs/heads/master v: v3
1 parent 4bc9058 commit 12c1904

File tree

7 files changed

+30
-202
lines changed

7 files changed

+30
-202
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: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: e9a52f5af576ffd517284813858b6d06910460ea
5+
refs/heads/try: 2190efb3ca86db7f45cb0ec9d5744b8f2491fd0b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PKG_FILES := \
1818
$(S)COPYRIGHT \
1919
$(S)LICENSE-APACHE \
2020
$(S)LICENSE-MIT \
21+
$(S)AUTHORS.txt \
2122
$(S)README.md \
2223
$(S)configure $(S)Makefile.in \
2324
$(S)man \

branches/try/src/libcore/reflect.rs

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Runtime type reflection
1515
*/
1616

1717
use intrinsic::{TyDesc, TyVisitor};
18-
#[cfg(not(stage0))] use intrinsic::Opaque;
1918
use libc::c_void;
2019
use sys;
2120
use vec;
@@ -394,7 +393,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
394393
true
395394
}
396395

397-
#[cfg(stage0)]
398396
fn visit_enter_enum(&self, n_variants: uint, sz: uint, align: uint)
399397
-> bool {
400398
self.align(align);
@@ -404,47 +402,25 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
404402
true
405403
}
406404

407-
#[cfg(not(stage0))]
408-
fn visit_enter_enum(&self, n_variants: uint,
409-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
410-
sz: uint, align: uint)
411-
-> bool {
412-
self.align(align);
413-
if ! self.inner.visit_enter_enum(n_variants, get_disr, sz, align) {
414-
return false;
415-
}
416-
true
417-
}
418-
419405
fn visit_enter_enum_variant(&self, variant: uint,
420406
disr_val: int,
421407
n_fields: uint,
422408
name: &str) -> bool {
423-
self.inner.push_ptr(); // NOTE remove after next snapshot
409+
self.inner.push_ptr();
424410
if ! self.inner.visit_enter_enum_variant(variant, disr_val,
425411
n_fields, name) {
426412
return false;
427413
}
428414
true
429415
}
430416

431-
#[cfg(stage0)]
432417
fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool {
433418
unsafe { self.align((*inner).align); }
434419
if ! self.inner.visit_enum_variant_field(i, inner) { return false; }
435420
unsafe { self.bump((*inner).size); }
436421
true
437422
}
438423

439-
#[cfg(not(stage0))]
440-
fn visit_enum_variant_field(&self, i: uint, offset: uint, inner: *TyDesc) -> bool {
441-
self.inner.push_ptr();
442-
self.bump(offset);
443-
if ! self.inner.visit_enum_variant_field(i, offset, inner) { return false; }
444-
self.inner.pop_ptr();
445-
true
446-
}
447-
448424
fn visit_leave_enum_variant(&self, variant: uint,
449425
disr_val: int,
450426
n_fields: uint,
@@ -453,11 +429,10 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
453429
n_fields, name) {
454430
return false;
455431
}
456-
self.inner.pop_ptr(); // NOTE remove after next snapshot
432+
self.inner.pop_ptr();
457433
true
458434
}
459435

460-
#[cfg(stage0)]
461436
fn visit_leave_enum(&self, n_variants: uint, sz: uint, align: uint)
462437
-> bool {
463438
if ! self.inner.visit_leave_enum(n_variants, sz, align) {
@@ -467,17 +442,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
467442
true
468443
}
469444

470-
#[cfg(not(stage0))]
471-
fn visit_leave_enum(&self, n_variants: uint,
472-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
473-
sz: uint, align: uint) -> bool {
474-
if ! self.inner.visit_leave_enum(n_variants, get_disr, sz, align) {
475-
return false;
476-
}
477-
self.bump(sz);
478-
true
479-
}
480-
481445
fn visit_trait(&self) -> bool {
482446
self.align_to::<@TyVisitor>();
483447
if ! self.inner.visit_trait() { return false; }

branches/try/src/libcore/repr.rs

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use cast::transmute;
1818
use char;
1919
use intrinsic;
2020
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
21-
#[cfg(not(stage0))] use intrinsic::Opaque;
2221
use io::{Writer, WriterUtil};
2322
use libc::c_void;
2423
use managed;
@@ -138,20 +137,12 @@ impl Repr for char {
138137

139138
// New implementation using reflect::MovePtr
140139

141-
#[cfg(stage0)]
142140
enum VariantState {
143141
Degenerate,
144142
TagMatch,
145143
TagMismatch,
146144
}
147145

148-
#[cfg(not(stage0))]
149-
enum VariantState {
150-
SearchingFor(int),
151-
Matched,
152-
AlreadyFound
153-
}
154-
155146
pub struct ReprVisitor {
156147
mut ptr: *c_void,
157148
mut ptr_stk: ~[*c_void],
@@ -190,14 +181,14 @@ pub impl ReprVisitor {
190181
true
191182
}
192183

193-
#[cfg(stage0)] #[inline(always)]
184+
#[inline(always)]
194185
fn bump(&self, sz: uint) {
195186
do self.move_ptr() |p| {
196187
((p as uint) + sz) as *c_void
197188
};
198189
}
199190

200-
#[cfg(stage0)] #[inline(always)]
191+
#[inline(always)]
201192
fn bump_past<T>(&self) {
202193
self.bump(sys::size_of::<T>());
203194
}
@@ -467,7 +458,6 @@ impl TyVisitor for ReprVisitor {
467458
true
468459
}
469460

470-
#[cfg(stage0)]
471461
fn visit_enter_enum(&self, n_variants: uint,
472462
_sz: uint, _align: uint) -> bool {
473463
if n_variants == 1 {
@@ -478,16 +468,6 @@ impl TyVisitor for ReprVisitor {
478468
true
479469
}
480470

481-
#[cfg(not(stage0))]
482-
fn visit_enter_enum(&self, n_variants: uint,
483-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
484-
_sz: uint, _align: uint) -> bool {
485-
let disr = unsafe { get_disr(transmute(self.ptr)) };
486-
self.var_stk.push(SearchingFor(disr));
487-
true
488-
}
489-
490-
#[cfg(stage0)]
491471
fn visit_enter_enum_variant(&self, _variant: uint,
492472
disr_val: int,
493473
n_fields: uint,
@@ -520,36 +500,6 @@ impl TyVisitor for ReprVisitor {
520500
true
521501
}
522502

523-
#[cfg(not(stage0))]
524-
fn visit_enter_enum_variant(&self, _variant: uint,
525-
disr_val: int,
526-
n_fields: uint,
527-
name: &str) -> bool {
528-
let mut write = false;
529-
match self.var_stk.pop() {
530-
SearchingFor(sought) => {
531-
if disr_val == sought {
532-
self.var_stk.push(Matched);
533-
write = true;
534-
} else {
535-
self.var_stk.push(SearchingFor(sought));
536-
}
537-
}
538-
Matched | AlreadyFound => {
539-
self.var_stk.push(AlreadyFound);
540-
}
541-
}
542-
543-
if write {
544-
self.writer.write_str(name);
545-
if n_fields > 0 {
546-
self.writer.write_char('(');
547-
}
548-
}
549-
true
550-
}
551-
552-
#[cfg(stage0)]
553503
fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool {
554504
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
555505
Degenerate | TagMatch => {
@@ -565,23 +515,6 @@ impl TyVisitor for ReprVisitor {
565515
true
566516
}
567517

568-
#[cfg(not(stage0))]
569-
fn visit_enum_variant_field(&self, i: uint, _offset: uint, inner: *TyDesc) -> bool {
570-
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
571-
Matched => {
572-
if i != 0 {
573-
self.writer.write_str(", ");
574-
}
575-
if ! self.visit_inner(inner) {
576-
return false;
577-
}
578-
}
579-
_ => ()
580-
}
581-
true
582-
}
583-
584-
#[cfg(stage0)]
585518
fn visit_leave_enum_variant(&self, _variant: uint,
586519
_disr_val: int,
587520
n_fields: uint,
@@ -597,39 +530,12 @@ impl TyVisitor for ReprVisitor {
597530
true
598531
}
599532

600-
#[cfg(not(stage0))]
601-
fn visit_leave_enum_variant(&self, _variant: uint,
602-
_disr_val: int,
603-
n_fields: uint,
604-
_name: &str) -> bool {
605-
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
606-
Matched => {
607-
if n_fields > 0 {
608-
self.writer.write_char(')');
609-
}
610-
}
611-
_ => ()
612-
}
613-
true
614-
}
615-
616-
#[cfg(stage0)]
617533
fn visit_leave_enum(&self, _n_variants: uint,
618534
_sz: uint, _align: uint) -> bool {
619535
self.var_stk.pop();
620536
true
621537
}
622538

623-
#[cfg(not(stage0))]
624-
fn visit_leave_enum(&self, _n_variants: uint,
625-
_get_disr: extern unsafe fn(ptr: *Opaque) -> int,
626-
_sz: uint, _align: uint) -> bool {
627-
match self.var_stk.pop() {
628-
SearchingFor(*) => fail!(~"enum value matched no variant"),
629-
_ => true
630-
}
631-
}
632-
633539
fn visit_enter_fn(&self, _purity: uint, _proto: uint,
634540
_n_inputs: uint, _retstyle: uint) -> bool { true }
635541
fn visit_fn_input(&self, _i: uint, _mode: uint, _inner: *TyDesc) -> bool {

branches/try/src/librustc/front/intrinsic.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ pub mod intrinsic {
2828
// Remaining fields not listed
2929
}
3030

31-
pub enum Opaque { }
32-
3331
pub trait TyVisitor {
3432
fn visit_bot(&self) -> bool;
3533
fn visit_nil(&self) -> bool;
@@ -93,19 +91,17 @@ pub mod intrinsic {
9391
sz: uint, align: uint) -> bool;
9492

9593
fn visit_enter_enum(&self, n_variants: uint,
96-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
9794
sz: uint, align: uint) -> bool;
9895
fn visit_enter_enum_variant(&self, variant: uint,
9996
disr_val: int,
10097
n_fields: uint,
10198
name: &str) -> bool;
102-
fn visit_enum_variant_field(&self, i: uint, offset: uint, inner: *TyDesc) -> bool;
99+
fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool;
103100
fn visit_leave_enum_variant(&self, variant: uint,
104101
disr_val: int,
105102
n_fields: uint,
106103
name: &str) -> bool;
107104
fn visit_leave_enum(&self, n_variants: uint,
108-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
109105
sz: uint, align: uint) -> bool;
110106

111107
fn visit_enter_fn(&self, purity: uint, proto: uint,

0 commit comments

Comments
 (0)