When giving a suggestion to use :: instead of . where the rhs is a macro giving a type,
make it also work when the rhs is a type alias, not just a struct.
This commit is contained in:
parent
bfde43c84b
commit
ae7b45a6d4
3 changed files with 137 additions and 4 deletions
|
@ -1529,7 +1529,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
|
|||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
true
|
||||
} else if kind == DefKind::Struct
|
||||
} else if matches!(kind, DefKind::Struct | DefKind::TyAlias)
|
||||
&& let Some(lhs_source_span) = lhs_span.find_ancestor_inside(expr.span)
|
||||
&& let Ok(snippet) = this.r.tcx.sess.source_map().span_to_snippet(lhs_source_span)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue