about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authorb-naber <bn263@gmx.de>2022-09-21 17:57:30 +0200
committerb-naber <bn263@gmx.de>2022-09-26 14:21:39 +0200
commit6118ee343f5ebbea657337a5dceb9ded40fde117 (patch)
tree16f672a21368664e47a06623f3f370bf78223021 /compiler/rustc_middle
parent897adb866665997fe8dfb66dc338faba9671577a (diff)
downloadrust-6118ee343f5ebbea657337a5dceb9ded40fde117.tar.gz
rust-6118ee343f5ebbea657337a5dceb9ded40fde117.zip
address review
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs5
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index da964077285..70efa748846 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -2128,7 +2128,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
             if let Some(name) = available_names.pop() {
                 name
             } else {
-                Symbol::intern(&format!("'t{}", index - num_available))
+                Symbol::intern(&format!("'z{}", index - num_available))
             }
         }
 
@@ -2161,7 +2161,8 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
 
         define_scoped_cx!(self);
 
-        let possible_names = vec![Symbol::intern("'t"), Symbol::intern("'s"), Symbol::intern("'r")];
+        let possible_names =
+            ('a'..='z').rev().map(|s| Symbol::intern(&format!("'{s}"))).collect::<Vec<_>>();
 
         let mut available_names = possible_names
             .into_iter()
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index 08fb6a329df..f4f4bb37c1a 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -1462,7 +1462,7 @@ impl<'tcx> Region<'tcx> {
                 ty::ReEarlyBound(ebr) => Some(ebr.name),
                 ty::ReLateBound(_, br) => br.kind.get_name(),
                 ty::ReFree(fr) => fr.bound_region.get_name(),
-                ty::ReStatic => Some(Symbol::intern("static")),
+                ty::ReStatic => Some(kw::StaticLifetime),
                 ty::RePlaceholder(placeholder) => placeholder.name.get_name(),
                 _ => None,
             };