diff options
| author | Zachary S <zasample18+github@gmail.com> | 2025-01-31 16:28:25 -0600 |
|---|---|---|
| committer | Zachary S <zasample18+github@gmail.com> | 2025-02-18 13:11:37 -0600 |
| commit | ae7b45a6d4b25f01f5c8b9ed547a980146c0d519 (patch) | |
| tree | 929ab183022dd8bbdf72d47903b9d06586044e96 /compiler/rustc_resolve/src | |
| parent | bfde43c84bfb35fd0d7c7ea46f8cdb0d682ef680 (diff) | |
| download | rust-ae7b45a6d4b25f01f5c8b9ed547a980146c0d519.tar.gz rust-ae7b45a6d4b25f01f5c8b9ed547a980146c0d519.zip | |
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.
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 2731efdba48..b37c684a055 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -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) { |
