Simplify some places that deal with generic parameter defaults
This commit is contained in:
parent
143ce0920a
commit
d0ddba3d5b
4 changed files with 39 additions and 115 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue