Rollup merge of #132912 - fmease:simplify-gen-param-default-users, r=compiler-errors
Simplify some places that deal with generic parameter defaults
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user