diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-11 21:58:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-11 21:58:33 +0100 |
| commit | b41baf8c81358894f88fa8821764dc1fc348e83c (patch) | |
| tree | 338ff27a9d8c3c4f09b60d457b6c274259658ebe /compiler/rustc_middle/src | |
| parent | f344169e7db43f6fb63117640296c8094819fe7c (diff) | |
| parent | d0ddba3d5b7d7e7f797cc663c4d9d648921d1008 (diff) | |
| download | rust-b41baf8c81358894f88fa8821764dc1fc348e83c.tar.gz rust-b41baf8c81358894f88fa8821764dc1fc348e83c.zip | |
Rollup merge of #132912 - fmease:simplify-gen-param-default-users, r=compiler-errors
Simplify some places that deal with generic parameter defaults
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/generics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/generics.rs b/compiler/rustc_middle/src/ty/generics.rs index 19779740227..ce40ab18261 100644 --- a/compiler/rustc_middle/src/ty/generics.rs +++ b/compiler/rustc_middle/src/ty/generics.rs @@ -86,10 +86,10 @@ impl GenericParamDef { tcx: TyCtxt<'tcx>, ) -> Option<EarlyBinder<'tcx, ty::GenericArg<'tcx>>> { match self.kind { - GenericParamDefKind::Type { has_default, .. } if has_default => { + GenericParamDefKind::Type { has_default: true, .. } => { Some(tcx.type_of(self.def_id).map_bound(|t| t.into())) } - GenericParamDefKind::Const { has_default, .. } if has_default => { + GenericParamDefKind::Const { has_default: true, .. } => { Some(tcx.const_param_default(self.def_id).map_bound(|c| c.into())) } _ => None, |
