Skip to content

Commit 58aa804

Browse files
committed
mismatching_type_param_order: Delay macro check.
1 parent 36a14e3 commit 58aa804

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/mismatching_type_param_order.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ declare_lint_pass!(TypeParamMismatch => [MISMATCHING_TYPE_PARAM_ORDER]);
4949

5050
impl<'tcx> LateLintPass<'tcx> for TypeParamMismatch {
5151
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
52-
if !item.span.from_expansion()
53-
&& let ItemKind::Impl(imp) = &item.kind
52+
if let ItemKind::Impl(imp) = &item.kind
5453
&& let TyKind::Path(QPath::Resolved(_, path)) = &imp.self_ty.kind
55-
&& let Some(segment) = path.segments.iter().next()
54+
&& let [segment, ..] = path.segments
5655
&& let Some(generic_args) = segment.args
5756
&& !generic_args.args.is_empty()
57+
&& !item.span.from_expansion()
5858
{
5959
// get the name and span of the generic parameters in the Impl
6060
let mut impl_params = Vec::new();

0 commit comments

Comments
 (0)