@@ -6,7 +6,7 @@ use rustc_errors::codes::*;
66use  rustc_errors:: { Diag ,  IntoDiagArg } ; 
77use  rustc_hir as  hir; 
88use  rustc_hir:: def:: { CtorOf ,  DefKind ,  Namespace ,  Res } ; 
9- use  rustc_hir:: def_id:: { DefId ,  LOCAL_CRATE ,   LocalDefId } ; 
9+ use  rustc_hir:: def_id:: { DefId ,  LocalDefId } ; 
1010use  rustc_hir:: intravisit:: { self ,  Visitor } ; 
1111use  rustc_hir:: { Body ,  Closure ,  Expr ,  ExprKind ,  FnRetTy ,  HirId ,  LetStmt ,  LocalSource } ; 
1212use  rustc_middle:: bug; 
@@ -18,7 +18,7 @@ use rustc_middle::ty::{
1818    TypeFoldable ,  TypeFolder ,  TypeSuperFoldable ,  TypeckResults , 
1919} ; 
2020use  rustc_span:: symbol:: { Ident ,  sym} ; 
21- use  rustc_span:: { BytePos ,  DUMMY_SP ,  FileName ,   Span } ; 
21+ use  rustc_span:: { BytePos ,  DUMMY_SP ,  Span } ; 
2222use  tracing:: { debug,  instrument,  warn} ; 
2323
2424use  crate :: error_reporting:: TypeErrCtxt ; 
@@ -385,7 +385,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
385385                bad_label, 
386386                was_written :  false , 
387387                path :  Default :: default ( ) , 
388-                 time_version :  false , 
389388            } ) , 
390389            TypeAnnotationNeeded :: E0283  => self . dcx ( ) . create_err ( AmbiguousImpl  { 
391390                span, 
@@ -576,10 +575,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
576575                } 
577576            } 
578577        } 
579- 
580-         let  time_version =
581-             self . detect_old_time_crate_version ( failure_span,  & kind,  & mut  infer_subdiags) ; 
582- 
583578        match  error_code { 
584579            TypeAnnotationNeeded :: E0282  => self . dcx ( ) . create_err ( AnnotationRequired  { 
585580                span, 
@@ -591,7 +586,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
591586                bad_label :  None , 
592587                was_written :  path. is_some ( ) , 
593588                path :  path. unwrap_or_default ( ) , 
594-                 time_version, 
595589            } ) , 
596590            TypeAnnotationNeeded :: E0283  => self . dcx ( ) . create_err ( AmbiguousImpl  { 
597591                span, 
@@ -617,42 +611,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
617611            } ) , 
618612        } 
619613    } 
620- 
621-     /// Detect the inference regression on crate `time` <= 0.3.35 and emit a more targeted error. 
622- /// <https://github.com/rust-lang/rust/issues/127343> 
623- // FIXME: we should figure out a more generic version of doing this, ideally in cargo itself. 
624-     fn  detect_old_time_crate_version ( 
625-         & self , 
626-         span :  Option < Span > , 
627-         kind :  & InferSourceKind < ' _ > , 
628-         // We will clear the non-actionable suggestion from the error to reduce noise. 
629-         infer_subdiags :  & mut  Vec < SourceKindSubdiag < ' _ > > , 
630-     )  -> bool  { 
631-         // FIXME(#129461): We are time-boxing this code in the compiler. It'll start failing 
632-         // compilation once we promote 1.89 to beta, which will happen in 9 months from now. 
633-         #[ cfg( not( version( "1.89" ) ) ) ]  
634-         const  fn  version_check ( )  { } 
635-         #[ cfg( version( "1.89" ) ) ]  
636-         const  fn  version_check ( )  { 
637-             panic ! ( "remove this check as presumably the ecosystem has moved from needing it" ) ; 
638-         } 
639-         const  {  version_check ( )  } ; 
640-         // Only relevant when building the `time` crate. 
641-         if  self . infcx . tcx . crate_name ( LOCAL_CRATE )  == sym:: time
642-             && let  Some ( span)  = span
643-             && let  InferSourceKind :: LetBinding  {  pattern_name,  .. }  = kind
644-             && let  Some ( name)  = pattern_name
645-             && name. as_str ( )  == "items" 
646-             && let  FileName :: Real ( file)  = self . infcx . tcx . sess . source_map ( ) . span_to_filename ( span) 
647-         { 
648-             let  path = file. local_path_if_available ( ) . to_string_lossy ( ) ; 
649-             if  path. contains ( "format_description" )  && path. contains ( "parse" )  { 
650-                 infer_subdiags. clear ( ) ; 
651-                 return  true ; 
652-             } 
653-         } 
654-         false 
655-     } 
656614} 
657615
658616#[ derive( Debug ) ]  
0 commit comments