@@ -542,9 +542,6 @@ struct DiagnosticMetadata<'ast> {
542
542
/// they are used (in a `break` or `continue` statement)
543
543
unused_labels : FxHashMap < NodeId , Span > ,
544
544
545
- /// Only used for better errors on `fn(): fn()`.
546
- current_type_ascription : Vec < Span > ,
547
-
548
545
/// Only used for better errors on `let x = { foo: bar };`.
549
546
/// In the case of a parse error with `let x = { foo: bar, };`, this isn't needed, it's only
550
547
/// 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> {
4033
4030
}
4034
4031
}
4035
4032
}
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) => {
4045
4034
visit:: walk_expr ( self , expr) ;
4046
- self . diagnostic_metadata . current_type_ascription . pop ( ) ;
4047
4035
}
4048
4036
// `async |x| ...` gets desugared to `|x| async {...}`, so we need to
4049
4037
// resolve the arguments within the proper scopes so that usages of them inside the
0 commit comments