Revert self types
This commit is contained in:
parent
98c3396ab6
commit
964bd485c6
8 changed files with 60 additions and 97 deletions
|
|
@ -128,15 +128,14 @@ fn item_impl_iface(item: ebml::doc, tcx: ty::ctxt, cdata: cmd)
|
|||
result
|
||||
}
|
||||
|
||||
fn item_ty_param_bounds(item: ebml::doc, tcx: ty::ctxt, cdata: cmd,
|
||||
skip: bool) -> @[ty::param_bounds] {
|
||||
let bounds = [], skip = skip;
|
||||
fn item_ty_param_bounds(item: ebml::doc, tcx: ty::ctxt, cdata: cmd)
|
||||
-> @[ty::param_bounds] {
|
||||
let bounds = [];
|
||||
ebml::tagged_docs(item, tag_items_data_item_ty_param_bounds) {|p|
|
||||
let bd = parse_bounds_data(p.data, p.start, cdata.cnum, tcx, {|did|
|
||||
translate_def_id(cdata, did)
|
||||
});
|
||||
if skip { skip = false; }
|
||||
else { bounds += [bd]; }
|
||||
bounds += [bd];
|
||||
}
|
||||
@bounds
|
||||
}
|
||||
|
|
@ -216,9 +215,8 @@ fn get_type(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
|
|||
-> ty::ty_param_bounds_and_ty {
|
||||
let item = lookup_item(id, cdata.data);
|
||||
let t = item_type(item, tcx, cdata);
|
||||
let family = item_family(item);
|
||||
let tp_bounds = if family_has_type_params(family) {
|
||||
item_ty_param_bounds(item, tcx, cdata, family == ('I' as u8))
|
||||
let tp_bounds = if family_has_type_params(item_family(item)) {
|
||||
item_ty_param_bounds(item, tcx, cdata)
|
||||
} else { @[] };
|
||||
ret {bounds: tp_bounds, ty: t};
|
||||
}
|
||||
|
|
@ -301,7 +299,7 @@ fn get_iface_methods(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
|
|||
let data = cdata.data;
|
||||
let item = lookup_item(id, data), result = [];
|
||||
ebml::tagged_docs(item, tag_item_method) {|mth|
|
||||
let bounds = item_ty_param_bounds(mth, tcx, cdata, false);
|
||||
let bounds = item_ty_param_bounds(mth, tcx, cdata);
|
||||
let name = item_name(mth);
|
||||
let ty = doc_type(mth, tcx, cdata);
|
||||
let fty = alt ty::struct(tcx, ty) { ty::ty_fn(f) { f } };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue