about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-08-21 17:57:56 -0400
committerGitHub <noreply@github.com>2025-08-21 17:57:56 -0400
commitcc98a849c856dddcab0d2aef7b79dcf341d5c66b (patch)
tree6d8af858d66a9eac9fd07a41f145e59a14f8ffd3 /compiler/rustc_const_eval
parente4d71b8089f5d47f59d92f4438439276289347c4 (diff)
parent95b3b61b8c2ecf0b5073d5779cea2825c726bf4b (diff)
downloadrust-cc98a849c856dddcab0d2aef7b79dcf341d5c66b.tar.gz
rust-cc98a849c856dddcab0d2aef7b79dcf341d5c66b.zip
Rollup merge of #145700 - nnethercote:fix-145696, r=lcnr
Handle `ReEarlyParam` in `type_name`.

Fixes rust-lang/rust#145696.

r? `@lcnr`
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/util/type_name.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/util/type_name.rs b/compiler/rustc_const_eval/src/util/type_name.rs
index 92096958f2b..2ae6655901b 100644
--- a/compiler/rustc_const_eval/src/util/type_name.rs
+++ b/compiler/rustc_const_eval/src/util/type_name.rs
@@ -164,12 +164,12 @@ impl<'tcx> Printer<'tcx> for TypeNamePrinter<'tcx> {
 }
 
 impl<'tcx> PrettyPrinter<'tcx> for TypeNamePrinter<'tcx> {
-    fn should_print_optional_region(&self, _region: ty::Region<'_>) -> bool {
+    fn should_print_optional_region(&self, region: ty::Region<'_>) -> bool {
         // Bound regions are always printed (as `'_`), which gives some idea that they are special,
         // even though the `for` is omitted by the pretty printer.
         // E.g. `for<'a, 'b> fn(&'a u32, &'b u32)` is printed as "fn(&'_ u32, &'_ u32)".
-        match _region.kind() {
-            ty::ReErased => false,
+        match region.kind() {
+            ty::ReErased | ty::ReEarlyParam(_) => false,
             ty::ReBound(..) => true,
             _ => unreachable!(),
         }