Commit graph

3 commits

Author SHA1 Message Date
Nicholas Nethercote
bebd91feb3 Fix HIR param pretty printing some more.
Anonymous params are currently represented with `kw::Empty`, so handle
that properly. (Subsequent commits will get rid of the `kw::Empty`.)
2025-03-14 09:45:41 +11:00
Nicholas Nethercote
958bc7b365 Handle _ properly in a couple of places.
Currently (PatKind::Wild` (i.e. `_`) gets turned by
`lower_fn_params_to_names` into an empty identifier, which means it is
printed incorrectly by HIR pretty printing.

And likewise for `lower_fn_params_to_names`, which affects some error
messages.

This commit fixes them. This requires a slight tweak in a couple of
places to continue using parameter numbers in some error messages. And
it improves the output of `tests/ui/typeck/cyclic_type_ice.rs`:
`/* _ */` is a better suggestion than `/*  */`.
2025-03-14 09:45:38 +11:00
Nicholas Nethercote
e885122147 Add a pretty printing test for fn params.
Note that multiple parts of the output are incorrect. The following
commits will fix this.
2025-03-14 06:29:24 +11:00