@@ -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
@@ -1391,26 +1373,6 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
13911373 Res :: Def ( DefKind :: Enum , def_id) ,
13921374 PathSource :: TupleStruct ( ..) | PathSource :: Expr ( ..) ,
13931375 ) => {
1394- if self
1395- . diagnostic_metadata
1396- . current_type_ascription
1397- . last ( )
1398- . map ( |sp| {
1399- self . r
1400- . tcx
1401- . sess
1402- . parse_sess
1403- . type_ascription_path_suggestions
1404- . borrow ( )
1405- . contains ( & sp)
1406- } )
1407- . unwrap_or ( false )
1408- {
1409- err. downgrade_to_delayed_bug ( ) ;
1410- // We already suggested changing `:` into `::` during parsing.
1411- return false ;
1412- }
1413-
14141376 self . suggest_using_enum_variant ( err, source, def_id, span) ;
14151377 }
14161378 ( Res :: Def ( DefKind :: Struct , def_id) , source) if ns == ValueNS => {
0 commit comments