Skip to content

Commit

Permalink
Use has_impl_trait where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Aug 3, 2021
1 parent 14e92d7 commit b84d08d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions compiler/rustc_typeck/src/astconv/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,17 +647,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
return false;
}

let impl_trait = generics.params.iter().any(|param| {
matches!(
param.kind,
ty::GenericParamDefKind::Type {
synthetic: Some(
hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::FromAttr,
),
..
}
)
});
let impl_trait = generics.has_impl_trait();

if impl_trait {
let spans = seg
Expand Down

0 comments on commit b84d08d

Please sign in to comment.