Skip to content

Commit

Permalink
account for use of index-based lifetime names in print of binder
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Sep 28, 2022
1 parent 837bf37 commit 4fdc78e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2173,10 +2173,16 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {

let mut region_index = self.region_index;
let mut next_name = |this: &Self| {
let name = name_by_region_index(region_index, &mut available_names, num_available);
debug!(?name);
region_index += 1;
assert!(!this.used_region_names.contains(&name));
let mut name;

loop {
name = name_by_region_index(region_index, &mut available_names, num_available);
region_index += 1;

if !this.used_region_names.contains(&name) {
break;
}
}

name
};
Expand Down

0 comments on commit 4fdc78e

Please sign in to comment.