Skip to content

Commit

Permalink
auto merge of #6201 : pcwalton/rust/inhtwama-serializer, r=graydon
Browse files Browse the repository at this point in the history
This PR removes mutable fields from the serializer and makes the encoder and decoder use INHTWAMA properly (i.e. `&mut self`).

r? @graydon
  • Loading branch information
bors committed May 3, 2013
2 parents baa1c18 + dc5df61 commit b37a685
Show file tree
Hide file tree
Showing 21 changed files with 5,470 additions and 646 deletions.
9 changes: 9 additions & 0 deletions src/librustc/metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,21 @@ fn item_ty_param_defs(item: ebml::Doc, tcx: ty::ctxt, cdata: cmd,
@bounds
}

#[cfg(stage0)]
fn item_ty_region_param(item: ebml::Doc) -> Option<ty::region_variance> {
reader::maybe_get_doc(item, tag_region_param).map(|doc| {
Decodable::decode(&reader::Decoder(*doc))
})
}

#[cfg(not(stage0))]
fn item_ty_region_param(item: ebml::Doc) -> Option<ty::region_variance> {
reader::maybe_get_doc(item, tag_region_param).map(|doc| {
let mut decoder = reader::Decoder(*doc);
Decodable::decode(&mut decoder)
})
}

fn item_ty_param_count(item: ebml::Doc) -> uint {
let mut n = 0u;
reader::tagged_docs(item, tag_items_data_item_ty_param_bounds,
Expand Down
Loading

0 comments on commit b37a685

Please sign in to comment.