mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-05 03:24:06 +03:00
@@ -146,6 +146,7 @@ pub fn leaf(&mut self, name: &str) {
|
||||
// Entrypoint
|
||||
pub fn visit_ty(&mut self, t: ty::t) {
|
||||
let bcx = self.bcx;
|
||||
let tcx = bcx.ccx().tcx;
|
||||
debug!("reflect::visit_ty %s", ty_to_str(bcx.ccx().tcx, t));
|
||||
|
||||
match ty::get(t).sty {
|
||||
@@ -248,8 +249,6 @@ pub fn visit_ty(&mut self, t: ty::t) {
|
||||
}
|
||||
|
||||
ty::ty_struct(did, ref substs) => {
|
||||
let bcx = self.bcx;
|
||||
let tcx = bcx.ccx().tcx;
|
||||
let fields = ty::struct_fields(tcx, did, substs);
|
||||
|
||||
let extra = ~[self.c_slice(ty_to_str(tcx, t).to_managed()),
|
||||
@@ -270,7 +269,6 @@ pub fn visit_ty(&mut self, t: ty::t) {
|
||||
// let the visitor tell us if it wants to visit only a particular
|
||||
// variant?
|
||||
ty::ty_enum(did, ref substs) => {
|
||||
let bcx = self.bcx;
|
||||
let ccx = bcx.ccx();
|
||||
let repr = adt::represent_type(bcx.ccx(), t);
|
||||
let variants = ty::substd_enum_variants(ccx.tcx, did, substs);
|
||||
@@ -336,8 +334,12 @@ pub fn visit_ty(&mut self, t: ty::t) {
|
||||
}
|
||||
}
|
||||
|
||||
// Miscallaneous extra types
|
||||
ty::ty_trait(_, _, _, _, _) => self.leaf("trait"),
|
||||
ty::ty_trait(_, _, _, _, _) => {
|
||||
let extra = [self.c_slice(ty_to_str(tcx, t).to_managed())];
|
||||
self.visit("trait", extra);
|
||||
}
|
||||
|
||||
// Miscellaneous extra types
|
||||
ty::ty_infer(_) => self.leaf("infer"),
|
||||
ty::ty_err => self.leaf("err"),
|
||||
ty::ty_param(ref p) => {
|
||||
|
||||
@@ -450,9 +450,9 @@ fn visit_leave_enum(&mut self, n_variants: uint,
|
||||
true
|
||||
}
|
||||
|
||||
fn visit_trait(&mut self) -> bool {
|
||||
fn visit_trait(&mut self, name: &str) -> bool {
|
||||
self.align_to::<@TyVisitor>();
|
||||
if ! self.inner.visit_trait() { return false; }
|
||||
if ! self.inner.visit_trait(name) { return false; }
|
||||
self.bump_past::<@TyVisitor>();
|
||||
true
|
||||
}
|
||||
|
||||
+6
-1
@@ -571,7 +571,11 @@ fn visit_leave_fn(&mut self, _purity: uint, _proto: uint,
|
||||
_n_inputs: uint, _retstyle: uint) -> bool { true }
|
||||
|
||||
|
||||
fn visit_trait(&mut self) -> bool { true }
|
||||
fn visit_trait(&mut self, name: &str) -> bool {
|
||||
self.writer.write(name.as_bytes());
|
||||
true
|
||||
}
|
||||
|
||||
fn visit_param(&mut self, _i: uint) -> bool { true }
|
||||
fn visit_self(&mut self) -> bool { true }
|
||||
fn visit_type(&mut self) -> bool { true }
|
||||
@@ -661,6 +665,7 @@ fn exact_test<T>(t: &T, e:&str) {
|
||||
"(10u64, ~\"hello\")");
|
||||
|
||||
exact_test(&(&println), "&fn()");
|
||||
exact_test(&(~5 as ~ToStr), "~to_str::ToStr:Send");
|
||||
|
||||
struct Foo;
|
||||
exact_test(&(~[Foo, Foo]), "~[repr::test_repr::Foo, repr::test_repr::Foo]");
|
||||
|
||||
@@ -256,7 +256,7 @@ fn visit_enter_fn(&mut self, purity: uint, proto: uint,
|
||||
fn visit_leave_fn(&mut self, purity: uint, proto: uint,
|
||||
n_inputs: uint, retstyle: uint) -> bool;
|
||||
|
||||
fn visit_trait(&mut self) -> bool;
|
||||
fn visit_trait(&mut self, name: &str) -> bool;
|
||||
fn visit_param(&mut self, i: uint) -> bool;
|
||||
fn visit_self(&mut self) -> bool;
|
||||
fn visit_type(&mut self) -> bool;
|
||||
|
||||
@@ -428,9 +428,9 @@ fn visit_leave_enum(&mut self, n_variants: uint,
|
||||
true
|
||||
}
|
||||
|
||||
fn visit_trait(&mut self) -> bool {
|
||||
fn visit_trait(&mut self, name: &str) -> bool {
|
||||
self.align_to::<@TyVisitor>();
|
||||
if ! self.inner.visit_trait() { return false; }
|
||||
if ! self.inner.visit_trait(name) { return false; }
|
||||
self.bump_past::<@TyVisitor>();
|
||||
true
|
||||
}
|
||||
@@ -616,7 +616,7 @@ fn visit_leave_fn(&mut self, _purity: uint, _proto: uint,
|
||||
_n_inputs: uint, _retstyle: uint) -> bool { true }
|
||||
|
||||
|
||||
fn visit_trait(&mut self) -> bool { true }
|
||||
fn visit_trait(&mut self, _name: &str) -> bool { true }
|
||||
fn visit_param(&mut self, _i: uint) -> bool { true }
|
||||
fn visit_self(&mut self) -> bool { true }
|
||||
fn visit_type(&mut self) -> bool { true }
|
||||
|
||||
@@ -139,7 +139,7 @@ fn visit_leave_fn(&mut self, _purity: uint, _proto: uint,
|
||||
_n_inputs: uint, _retstyle: uint) -> bool { true }
|
||||
|
||||
|
||||
fn visit_trait(&mut self) -> bool { true }
|
||||
fn visit_trait(&mut self, _name: &str) -> bool { true }
|
||||
fn visit_param(&mut self, _i: uint) -> bool { true }
|
||||
fn visit_self(&mut self) -> bool { true }
|
||||
fn visit_type(&mut self) -> bool { true }
|
||||
|
||||
Reference in New Issue
Block a user