Skip to content

Commit 56dc116

Browse files
committed
remove current_type_ascription from DiagnosticMetadata
1 parent a10251e commit 56dc116

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

compiler/rustc_resolve/src/late.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,6 @@ struct DiagnosticMetadata<'ast> {
542542
/// they are used (in a `break` or `continue` statement)
543543
unused_labels: FxHashMap<NodeId, Span>,
544544

545-
/// Only used for better errors on `fn(): fn()`.
546-
current_type_ascription: Vec<Span>,
547-
548545
/// Only used for better errors on `let x = { foo: bar };`.
549546
/// In the case of a parse error with `let x = { foo: bar, };`, this isn't needed, it's only
550547
/// needed for cases where this parses as a correct type ascription.
@@ -4033,17 +4030,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
40334030
}
40344031
}
40354032
}
4036-
ExprKind::Type(ref type_expr, ref ty) => {
4037-
// `ParseSess::type_ascription_path_suggestions` keeps spans of colon tokens in
4038-
// type ascription. Here we are trying to retrieve the span of the colon token as
4039-
// well, but only if it's written without spaces `expr:Ty` and therefore confusable
4040-
// with `expr::Ty`, only in this case it will match the span from
4041-
// `type_ascription_path_suggestions`.
4042-
self.diagnostic_metadata
4043-
.current_type_ascription
4044-
.push(type_expr.span.between(ty.span));
4033+
ExprKind::Type(ref _type_expr, ref _ty) => {
40454034
visit::walk_expr(self, expr);
4046-
self.diagnostic_metadata.current_type_ascription.pop();
40474035
}
40484036
// `async |x| ...` gets desugared to `|x| async {...}`, so we need to
40494037
// resolve the arguments within the proper scopes so that usages of them inside the

0 commit comments

Comments
 (0)