1
Fork 0

remove unnecessary .. patterns

This commit is contained in:
Takayuki Maeda 2022-03-07 02:18:36 +09:00
parent d53e19540e
commit 51a53bf4df
6 changed files with 7 additions and 11 deletions

View file

@ -2064,17 +2064,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
)), )),
_ => None, _ => None,
}); });
if let ImplTraitContext::TypeAliasesOpaqueTy { ref mut capturable_lifetimes, .. } = if let ImplTraitContext::TypeAliasesOpaqueTy { ref mut capturable_lifetimes } = itctx {
itctx
{
capturable_lifetimes.extend(lt_def_names.clone()); capturable_lifetimes.extend(lt_def_names.clone());
} }
let res = this.lower_trait_ref(&p.trait_ref, itctx.reborrow()); let res = this.lower_trait_ref(&p.trait_ref, itctx.reborrow());
if let ImplTraitContext::TypeAliasesOpaqueTy { ref mut capturable_lifetimes, .. } = if let ImplTraitContext::TypeAliasesOpaqueTy { ref mut capturable_lifetimes } = itctx {
itctx
{
for param in lt_def_names { for param in lt_def_names {
capturable_lifetimes.remove(&param); capturable_lifetimes.remove(&param);
} }

View file

@ -657,7 +657,7 @@ pub fn write_allocations<'tcx>(
} }
fn alloc_ids_from_const(val: ConstValue<'_>) -> impl Iterator<Item = AllocId> + '_ { fn alloc_ids_from_const(val: ConstValue<'_>) -> impl Iterator<Item = AllocId> + '_ {
match val { match val {
ConstValue::Scalar(interpret::Scalar::Ptr(ptr, _size)) => { ConstValue::Scalar(interpret::Scalar::Ptr(ptr, _)) => {
Either::Left(Either::Left(std::iter::once(ptr.provenance))) Either::Left(Either::Left(std::iter::once(ptr.provenance)))
} }
ConstValue::Scalar(interpret::Scalar::Int { .. }) => { ConstValue::Scalar(interpret::Scalar::Int { .. }) => {

View file

@ -852,7 +852,7 @@ impl ReachEverythingInTheInterfaceVisitor<'_, '_> {
self.visit(self.ev.tcx.type_of(param.def_id)); self.visit(self.ev.tcx.type_of(param.def_id));
} }
} }
GenericParamDefKind::Const { has_default, .. } => { GenericParamDefKind::Const { has_default } => {
self.visit(self.ev.tcx.type_of(param.def_id)); self.visit(self.ev.tcx.type_of(param.def_id));
if has_default { if has_default {
self.visit(self.ev.tcx.const_param_default(param.def_id)); self.visit(self.ev.tcx.const_param_default(param.def_id));

View file

@ -405,7 +405,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
} }
hir::Node::Item(hir::Item { hir::Node::Item(hir::Item {
kind: kind:
hir::ItemKind::Trait(_, _, generics, _, _) hir::ItemKind::Trait(_, _, generics, ..)
| hir::ItemKind::Impl(hir::Impl { generics, .. }), | hir::ItemKind::Impl(hir::Impl { generics, .. }),
.. ..
}) if projection.is_some() => { }) if projection.is_some() => {

View file

@ -1403,7 +1403,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self.fcx.var_for_def(self.span, param) self.fcx.var_for_def(self.span, param)
} }
} }
GenericParamDefKind::Const { has_default, .. } => { GenericParamDefKind::Const { has_default } => {
if !infer_args && has_default { if !infer_args && has_default {
tcx.const_param_default(param.def_id) tcx.const_param_default(param.def_id)
.subst_spanned(tcx, substs.unwrap(), Some(self.span)) .subst_spanned(tcx, substs.unwrap(), Some(self.span))

View file

@ -451,7 +451,7 @@ impl Clean<GenericParamDef> for ty::GenericParamDef {
}, },
) )
} }
ty::GenericParamDefKind::Const { has_default, .. } => ( ty::GenericParamDefKind::Const { has_default } => (
self.name, self.name,
GenericParamDefKind::Const { GenericParamDefKind::Const {
did: self.def_id, did: self.def_id,