diff options
Diffstat (limited to 'compiler/rustc_middle/src/ty/generics.rs')
-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 baef4ffed..b0ffe7829 100644 --- a/compiler/rustc_middle/src/ty/generics.rs +++ b/compiler/rustc_middle/src/ty/generics.rs @@ -103,7 +103,7 @@ impl GenericParamDef { ty::GenericParamDefKind::Lifetime => tcx.mk_re_error_misc().into(), ty::GenericParamDefKind::Type { .. } => tcx.ty_error_misc().into(), ty::GenericParamDefKind::Const { .. } => { - tcx.const_error(tcx.type_of(self.def_id).subst(tcx, preceding_substs)).into() + tcx.const_error_misc(tcx.type_of(self.def_id).subst(tcx, preceding_substs)).into() } } } @@ -298,7 +298,7 @@ impl<'tcx> Generics { .iter() .rev() .take_while(|param| { - param.default_value(tcx).map_or(false, |default| { + param.default_value(tcx).is_some_and(|default| { default.subst(tcx, substs) == substs[param.index as usize] }) }) |