@@ -160,7 +160,7 @@ pub trait TypeInformationCtxt<'tcx> {
160
160
161
161
fn try_structurally_resolve_type ( & self , span : Span , ty : Ty < ' tcx > ) -> Ty < ' tcx > ;
162
162
163
- fn report_error ( & self , span : Span , msg : impl ToString ) -> Self :: Error ;
163
+ fn report_bug ( & self , span : Span , msg : impl ToString ) -> Self :: Error ;
164
164
165
165
fn error_reported_in_ty ( & self , ty : Ty < ' tcx > ) -> Result < ( ) , Self :: Error > ;
166
166
@@ -195,7 +195,7 @@ impl<'tcx> TypeInformationCtxt<'tcx> for &FnCtxt<'_, 'tcx> {
195
195
( * * self ) . try_structurally_resolve_type ( sp, ty)
196
196
}
197
197
198
- fn report_error ( & self , span : Span , msg : impl ToString ) -> Self :: Error {
198
+ fn report_bug ( & self , span : Span , msg : impl ToString ) -> Self :: Error {
199
199
self . dcx ( ) . span_delayed_bug ( span, msg. to_string ( ) )
200
200
}
201
201
@@ -245,7 +245,7 @@ impl<'tcx> TypeInformationCtxt<'tcx> for (&LateContext<'tcx>, LocalDefId) {
245
245
t
246
246
}
247
247
248
- fn report_error ( & self , span : Span , msg : impl ToString ) -> ! {
248
+ fn report_bug ( & self , span : Span , msg : impl ToString ) -> ! {
249
249
span_bug ! ( span, "{}" , msg. to_string( ) )
250
250
}
251
251
@@ -1218,7 +1218,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1218
1218
/// result of `*x'`, effectively, where `x'` is a `Categorization::Upvar` reference
1219
1219
/// tied to `x`. The type of `x'` will be a borrowed pointer.
1220
1220
impl < ' tcx , Cx : TypeInformationCtxt < ' tcx > , D : Delegate < ' tcx > > ExprUseVisitor < ' tcx , Cx , D > {
1221
- fn resolve_type_vars_or_error (
1221
+ fn resolve_type_vars_or_bug (
1222
1222
& self ,
1223
1223
id : HirId ,
1224
1224
ty : Option < Ty < ' tcx > > ,
@@ -1228,10 +1228,10 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1228
1228
let ty = self . cx . resolve_vars_if_possible ( ty) ;
1229
1229
self . cx . error_reported_in_ty ( ty) ?;
1230
1230
if ty. is_ty_var ( ) {
1231
- debug ! ( "resolve_type_vars_or_error : infer var from {:?}" , ty) ;
1231
+ debug ! ( "resolve_type_vars_or_bug : infer var from {:?}" , ty) ;
1232
1232
Err ( self
1233
1233
. cx
1234
- . report_error ( self . cx . tcx ( ) . hir ( ) . span ( id) , "encountered type variable" ) )
1234
+ . report_bug ( self . cx . tcx ( ) . hir ( ) . span ( id) , "encountered type variable" ) )
1235
1235
} else {
1236
1236
Ok ( ty)
1237
1237
}
@@ -1248,15 +1248,15 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1248
1248
}
1249
1249
1250
1250
fn node_ty ( & self , hir_id : HirId ) -> Result < Ty < ' tcx > , Cx :: Error > {
1251
- self . resolve_type_vars_or_error ( hir_id, self . cx . typeck_results ( ) . node_type_opt ( hir_id) )
1251
+ self . resolve_type_vars_or_bug ( hir_id, self . cx . typeck_results ( ) . node_type_opt ( hir_id) )
1252
1252
}
1253
1253
1254
1254
fn expr_ty ( & self , expr : & hir:: Expr < ' _ > ) -> Result < Ty < ' tcx > , Cx :: Error > {
1255
- self . resolve_type_vars_or_error ( expr. hir_id , self . cx . typeck_results ( ) . expr_ty_opt ( expr) )
1255
+ self . resolve_type_vars_or_bug ( expr. hir_id , self . cx . typeck_results ( ) . expr_ty_opt ( expr) )
1256
1256
}
1257
1257
1258
1258
fn expr_ty_adjusted ( & self , expr : & hir:: Expr < ' _ > ) -> Result < Ty < ' tcx > , Cx :: Error > {
1259
- self . resolve_type_vars_or_error (
1259
+ self . resolve_type_vars_or_bug (
1260
1260
expr. hir_id ,
1261
1261
self . cx . typeck_results ( ) . expr_ty_adjusted_opt ( expr) ,
1262
1262
)
@@ -1321,7 +1321,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1321
1321
debug ! ( "By-ref binding of non-derefable type" ) ;
1322
1322
Err ( self
1323
1323
. cx
1324
- . report_error ( pat. span , "by-ref binding of non-derefable type" ) )
1324
+ . report_bug ( pat. span , "by-ref binding of non-derefable type" ) )
1325
1325
}
1326
1326
}
1327
1327
} else {
@@ -1610,7 +1610,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1610
1610
Some ( ty) => ty,
1611
1611
None => {
1612
1612
debug ! ( "explicit deref of non-derefable type: {:?}" , base_curr_ty) ;
1613
- return Err ( self . cx . report_error (
1613
+ return Err ( self . cx . report_bug (
1614
1614
self . cx . tcx ( ) . hir ( ) . span ( node) ,
1615
1615
"explicit deref of non-derefable type" ,
1616
1616
) ) ;
@@ -1635,7 +1635,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1635
1635
let ty:: Adt ( adt_def, _) = self . cx . try_structurally_resolve_type ( span, ty) . kind ( ) else {
1636
1636
return Err ( self
1637
1637
. cx
1638
- . report_error ( span, "struct or tuple struct pattern not applied to an ADT" ) ) ;
1638
+ . report_bug ( span, "struct or tuple struct pattern not applied to an ADT" ) ) ;
1639
1639
} ;
1640
1640
1641
1641
match res {
@@ -1681,7 +1681,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1681
1681
let ty = self . cx . typeck_results ( ) . node_type ( pat_hir_id) ;
1682
1682
match self . cx . try_structurally_resolve_type ( span, ty) . kind ( ) {
1683
1683
ty:: Tuple ( args) => Ok ( args. len ( ) ) ,
1684
- _ => Err ( self . cx . report_error ( span, "tuple pattern not applied to a tuple" ) ) ,
1684
+ _ => Err ( self . cx . report_bug ( span, "tuple pattern not applied to a tuple" ) ) ,
1685
1685
}
1686
1686
}
1687
1687
@@ -1860,7 +1860,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
1860
1860
debug ! ( "explicit index of non-indexable type {:?}" , place_with_id) ;
1861
1861
return Err ( self
1862
1862
. cx
1863
- . report_error ( pat. span , "explicit index of non-indexable type" ) ) ;
1863
+ . report_bug ( pat. span , "explicit index of non-indexable type" ) ) ;
1864
1864
} ;
1865
1865
let elt_place = self . cat_projection (
1866
1866
pat. hir_id ,
0 commit comments