@@ -548,9 +548,6 @@ struct DiagnosticMetadata<'ast> {
548
548
/// they are used (in a `break` or `continue` statement)
549
549
unused_labels : FxHashMap < NodeId , Span > ,
550
550
551
- /// Only used for better errors on `fn(): fn()`.
552
- current_type_ascription : Vec < Span > ,
553
-
554
551
/// Only used for better errors on `let x = { foo: bar };`.
555
552
/// In the case of a parse error with `let x = { foo: bar, };`, this isn't needed, it's only
556
553
/// needed for cases where this parses as a correct type ascription.
@@ -4057,17 +4054,8 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
4057
4054
}
4058
4055
}
4059
4056
}
4060
- ExprKind :: Type ( ref type_expr, ref ty) => {
4061
- // `ParseSess::type_ascription_path_suggestions` keeps spans of colon tokens in
4062
- // type ascription. Here we are trying to retrieve the span of the colon token as
4063
- // well, but only if it's written without spaces `expr:Ty` and therefore confusable
4064
- // with `expr::Ty`, only in this case it will match the span from
4065
- // `type_ascription_path_suggestions`.
4066
- self . diagnostic_metadata
4067
- . current_type_ascription
4068
- . push ( type_expr. span . between ( ty. span ) ) ;
4057
+ ExprKind :: Type ( ref _type_expr, ref _ty) => {
4069
4058
visit:: walk_expr ( self , expr) ;
4070
- self . diagnostic_metadata . current_type_ascription . pop ( ) ;
4071
4059
}
4072
4060
// `async |x| ...` gets desugared to `|x| async {...}`, so we need to
4073
4061
// resolve the arguments within the proper scopes so that usages of them inside the
0 commit comments