From 8074e672f05b134bea95783ceeac83bceec3956a Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 7 Aug 2025 12:04:58 +1000 Subject: Reimplement `print_region` in `type_name.rs`. Broken by #144776; this is reachable after all. Fixes #144994. The commit also adds a lot more cases to the `type-name-basic.rs`, because it's currently very anaemic. This includes some cases where region omission does very badly; these are marked with FIXME. --- compiler/rustc_const_eval/src/util/type_name.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_const_eval/src') diff --git a/compiler/rustc_const_eval/src/util/type_name.rs b/compiler/rustc_const_eval/src/util/type_name.rs index e6b9759819f..2dc746754f8 100644 --- a/compiler/rustc_const_eval/src/util/type_name.rs +++ b/compiler/rustc_const_eval/src/util/type_name.rs @@ -18,7 +18,9 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> { } fn print_region(&mut self, _region: ty::Region<'_>) -> Result<(), PrintError> { - unreachable!(); // because `::should_print_region` returns false + // This is reachable (via `pretty_print_dyn_existential`) even though + // `::should_print_region` returns false. See #144994. + Ok(()) } fn print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError> { -- cgit 1.4.1-3-g733a5