diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-08-07 12:04:58 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-08-07 12:46:33 +1000 |
| commit | 8074e672f05b134bea95783ceeac83bceec3956a (patch) | |
| tree | bcb806d3384076a6e198ac76a141ecc5f656aa9e /compiler/rustc_const_eval/src | |
| parent | 0f353363965ebf05e0757f7679c800b39c51a07e (diff) | |
| download | rust-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_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/util/type_name.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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 `<Self As PrettyPrinter>::should_print_region` returns false + // This is 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> { |
