@@ -1144,40 +1144,22 @@ impl<'tcx> TyCtxt<'tcx> {
1144
1144
/// Constructs a `TyKind::Error` type and registers a `delay_span_bug` to ensure it gets used.
1145
1145
#[ track_caller]
1146
1146
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" )
1152
1148
}
1153
1149
1154
1150
/// Constructs a `TyKind::Error` type and registers a `delay_span_bug` with the given `msg to
1155
1151
/// ensure it gets used.
1156
1152
#[ track_caller]
1157
1153
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) ;
1168
1155
self . mk_ty ( Error ( super :: sty:: DelaySpanBugEmitted ( ( ) ) ) )
1169
1156
}
1170
1157
1171
1158
/// Like `err` but for constants.
1172
1159
#[ track_caller]
1173
1160
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." ) ;
1181
1163
self . mk_const ( ty:: Const {
1182
1164
val : ty:: ConstKind :: Error ( super :: sty:: DelaySpanBugEmitted ( ( ) ) ) ,
1183
1165
ty,
0 commit comments