Skip to content

Commit

Permalink
Remove redundant sorting of projection bounds in tyencode.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Sep 13, 2016
1 parent 5a881e9 commit 5c923f0
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/librustc_metadata/tyencode.rs
Expand Up @@ -104,14 +104,7 @@ pub fn enc_ty<'a, 'tcx>(w: &mut Cursor<Vec<u8>>, cx: &ctxt<'a, 'tcx>, t: Ty<'tcx

enc_region(w, cx, obj.region_bound);

// Encode projection_bounds in a stable order
let mut projection_bounds: Vec<_> = obj.projection_bounds
.iter()
.map(|b| (b.item_name().as_str(), b))
.collect();
projection_bounds.sort_by_key(|&(ref name, _)| name.clone());

for tp in projection_bounds.iter().map(|&(_, tp)| tp) {
for tp in &obj.projection_bounds {
write!(w, "P");
enc_existential_projection(w, cx, &tp.0);
}
Expand Down

0 comments on commit 5c923f0

Please sign in to comment.