@@ -492,24 +492,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
492492 . filter ( |( _, enum_ty_path) | !enum_ty_path. starts_with ( "std::prelude::" ) )
493493 . collect ( ) ;
494494 if !enum_candidates. is_empty ( ) {
495- if let ( PathSource :: Type , Some ( span) ) =
496- ( source, self . diagnostic_metadata . current_type_ascription . last ( ) )
497- {
498- if self
499- . r
500- . tcx
501- . sess
502- . parse_sess
503- . type_ascription_path_suggestions
504- . borrow ( )
505- . contains ( span)
506- {
507- // Already reported this issue on the lhs of the type ascription.
508- err. downgrade_to_delayed_bug ( ) ;
509- return ( true , candidates) ;
510- }
511- }
512-
513495 enum_candidates. sort ( ) ;
514496
515497 // Contextualize for E0412 "cannot find type", but don't belabor the point
@@ -1375,26 +1357,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
13751357 Res :: Def ( DefKind :: Enum , def_id) ,
13761358 PathSource :: TupleStruct ( ..) | PathSource :: Expr ( ..) ,
13771359 ) => {
1378- if self
1379- . diagnostic_metadata
1380- . current_type_ascription
1381- . last ( )
1382- . map ( |sp| {
1383- self . r
1384- . tcx
1385- . sess
1386- . parse_sess
1387- . type_ascription_path_suggestions
1388- . borrow ( )
1389- . contains ( & sp)
1390- } )
1391- . unwrap_or ( false )
1392- {
1393- err. downgrade_to_delayed_bug ( ) ;
1394- // We already suggested changing `:` into `::` during parsing.
1395- return false ;
1396- }
1397-
13981360 self . suggest_using_enum_variant ( err, source, def_id, span) ;
13991361 }
14001362 ( Res :: Def ( DefKind :: Struct , def_id) , source) if ns == ValueNS => {
0 commit comments