Patch more metadata decoding problems.

This commit is contained in:
Niko Matsakis 2014-12-04 10:29:41 -05:00
parent 30e8ab0182
commit 42e645ca9a
2 changed files with 8 additions and 6 deletions
src/librustc/metadata

@ -172,14 +172,15 @@ fn item_visibility(item: rbml::Doc) -> ast::Visibility {
}
fn item_sort(item: rbml::Doc) -> char {
// NB(pcwalton): The default of 'r' here is relied upon in
// `is_associated_type` below.
let mut ret = 'r';
let mut ret = None;
reader::tagged_docs(item, tag_item_trait_item_sort, |doc| {
ret = doc.as_str_slice().as_bytes()[0] as char;
ret = Some(doc.as_str_slice().as_bytes()[0] as char);
false
});
ret
match ret {
Some(r) => r,
None => panic!("No item_sort found")
}
}
fn item_symbol(item: rbml::Doc) -> String {

@ -898,7 +898,7 @@ fn encode_info_for_associated_type(ecx: &EncodeContext,
encode_visibility(rbml_w, associated_type.vis);
encode_family(rbml_w, 'y');
encode_parent_item(rbml_w, local_def(parent_id));
encode_item_sort(rbml_w, 'r');
encode_item_sort(rbml_w, 't');
let stab = stability::lookup(ecx.tcx, associated_type.def_id);
encode_stability(rbml_w, stab);
@ -1404,6 +1404,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
encode_path(rbml_w,
path.clone().chain(Some(elem).into_iter()));
encode_item_sort(rbml_w, 't');
encode_family(rbml_w, 'y');
is_nonstatic_method = false;