diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-08-21 14:09:53 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-08-21 14:31:04 +1000 |
| commit | 95b3b61b8c2ecf0b5073d5779cea2825c726bf4b (patch) | |
| tree | 1eafcdfb6e5b2052268365c078971e0564cb58d1 /compiler/rustc_const_eval | |
| parent | 425a9c0a0e365c0b8c6cfd00c2ded83a73bed9a0 (diff) | |
| download | rust-95b3b61b8c2ecf0b5073d5779cea2825c726bf4b.tar.gz rust-95b3b61b8c2ecf0b5073d5779cea2825c726bf4b.zip | |
Handle `ReEarlyParam` in `type_name`.
Fixes #145696.
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/util/type_name.rs | 6 |
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 13cc607135a..10bfd5aad92 100644 --- a/compiler/rustc_const_eval/src/util/type_name.rs +++ b/compiler/rustc_const_eval/src/util/type_name.rs @@ -135,12 +135,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!(), } |
