diff options
| author | b-naber <bn263@gmx.de> | 2022-09-28 12:31:08 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-09-28 12:31:08 +0200 |
| commit | 4fdc78e6bf1c8cbe21aa113aed69b31578e857e8 (patch) | |
| tree | 874eca6941106db4e14e697e5484c91e218dc19d | |
| parent | 837bf370de144a682041e68bb67469b9f68a55ce (diff) | |
| download | rust-4fdc78e6bf1c8cbe21aa113aed69b31578e857e8.tar.gz rust-4fdc78e6bf1c8cbe21aa113aed69b31578e857e8.zip | |
account for use of index-based lifetime names in print of binder
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 70efa748846..f69ac076820 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -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 }; |
