about summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-08-07 12:04:58 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-08-07 12:46:33 +1000
commit8074e672f05b134bea95783ceeac83bceec3956a (patch)
treebcb806d3384076a6e198ac76a141ecc5f656aa9e /compiler/rustc_symbol_mangling
parent0f353363965ebf05e0757f7679c800b39c51a07e (diff)
downloadrust-8074e672f05b134bea95783ceeac83bceec3956a.tar.gz
rust-8074e672f05b134bea95783ceeac83bceec3956a.zip
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.
Diffstat (limited to 'compiler/rustc_symbol_mangling')
-rw-r--r--compiler/rustc_symbol_mangling/src/legacy.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_symbol_mangling/src/legacy.rs b/compiler/rustc_symbol_mangling/src/legacy.rs
index aa8292c0504..a7f64085bd9 100644
--- a/compiler/rustc_symbol_mangling/src/legacy.rs
+++ b/compiler/rustc_symbol_mangling/src/legacy.rs
@@ -234,7 +234,9 @@ impl<'tcx> Printer<'tcx> for SymbolPrinter<'tcx> {
     }
 
     fn print_region(&mut self, _region: ty::Region<'_>) -> Result<(), PrintError> {
-        unreachable!(); // because `<Self As PrettyPrinter>::should_print_region` returns false
+        // This might be reachable (via `pretty_print_dyn_existential`) even though
+        // `<Self As PrettyPrinter>::should_print_region` returns false. See #144994.
+        Ok(())
     }
 
     fn print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError> {