@@ -1144,40 +1144,22 @@ impl<'tcx> TyCtxt<'tcx> {
11441144 /// Constructs a `TyKind::Error` type and registers a `delay_span_bug` to ensure it gets used.
11451145 #[ track_caller]
11461146 pub fn ty_error ( self ) -> Ty < ' tcx > {
1147- self . err_with_message_and_location (
1148- DUMMY_SP ,
1149- "TyKind::Error constructed but no error reported" ,
1150- std:: panic:: Location :: caller ( ) ,
1151- )
1147+ self . ty_error_with_message ( DUMMY_SP , "TyKind::Error constructed but no error reported" )
11521148 }
11531149
11541150 /// Constructs a `TyKind::Error` type and registers a `delay_span_bug` with the given `msg to
11551151 /// ensure it gets used.
11561152 #[ track_caller]
11571153 pub fn ty_error_with_message < S : Into < MultiSpan > > ( self , span : S , msg : & str ) -> Ty < ' tcx > {
1158- self . err_with_message_and_location ( span, msg, std:: panic:: Location :: caller ( ) )
1159- }
1160-
1161- pub fn err_with_message_and_location < S : Into < MultiSpan > > (
1162- self ,
1163- span : S ,
1164- msg : & str ,
1165- loc : & ' static std:: panic:: Location < ' static > ,
1166- ) -> Ty < ' tcx > {
1167- self . sess . delay_span_bug ( span, & format ! ( "{}: {}" , loc, msg) ) ;
1154+ self . sess . delay_span_bug ( span, msg) ;
11681155 self . mk_ty ( Error ( super :: sty:: DelaySpanBugEmitted ( ( ) ) ) )
11691156 }
11701157
11711158 /// Like `err` but for constants.
11721159 #[ track_caller]
11731160 pub fn const_error ( self , ty : Ty < ' tcx > ) -> & ' tcx Const < ' tcx > {
1174- self . sess . delay_span_bug (
1175- DUMMY_SP ,
1176- & format ! (
1177- "ty::ConstKind::Error constructed but no error reported. {}" ,
1178- std:: panic:: Location :: caller( )
1179- ) ,
1180- ) ;
1161+ self . sess
1162+ . delay_span_bug ( DUMMY_SP , "ty::ConstKind::Error constructed but no error reported." ) ;
11811163 self . mk_const ( ty:: Const {
11821164 val : ty:: ConstKind :: Error ( super :: sty:: DelaySpanBugEmitted ( ( ) ) ) ,
11831165 ty,
0 commit comments