diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-03-15 00:18:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-15 00:18:25 +0100 |
| commit | 370f8fb99dc428c40e97bd33606f396ec948ec8c (patch) | |
| tree | 9971d4df55663f28a1e934e99dabc048910bfcfa /compiler/rustc_middle/src | |
| parent | 03cda6b022d2bbf89992b0a80cf5f605d6a12583 (diff) | |
| parent | 79e4be1e9f1bd8032f3573a8f44f88814632a342 (diff) | |
| download | rust-370f8fb99dc428c40e97bd33606f396ec948ec8c.tar.gz rust-370f8fb99dc428c40e97bd33606f396ec948ec8c.zip | |
Rollup merge of #138482 - nnethercote:fix-hir-printing, r=compiler-errors
Fix HIR printing of parameters HIR pretty printing does the wrong thing for anonymous parameters, and there is no test coverage for it. This PR remedies both of those things. r? ``@lcnr``
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/hir/map.rs b/compiler/rustc_middle/src/hir/map.rs index 73c0af84a9f..c61c7a4fb02 100644 --- a/compiler/rustc_middle/src/hir/map.rs +++ b/compiler/rustc_middle/src/hir/map.rs @@ -281,8 +281,9 @@ impl<'tcx> TyCtxt<'tcx> { } pub fn hir_body_param_names(self, id: BodyId) -> impl Iterator<Item = Ident> { - self.hir_body(id).params.iter().map(|arg| match arg.pat.kind { + self.hir_body(id).params.iter().map(|param| match param.pat.kind { PatKind::Binding(_, _, ident, _) => ident, + PatKind::Wild => Ident::new(kw::Underscore, param.pat.span), _ => Ident::empty(), }) } |
