@@ -365,8 +365,12 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
365
365
for ( & local_id, c_ty) in fcx_tables. user_provided_types ( ) . iter ( ) {
366
366
let hir_id = hir:: HirId { owner : common_hir_owner, local_id } ;
367
367
368
- if cfg ! ( debug_assertions) && c_ty. has_local_value ( ) {
369
- span_bug ! ( hir_id. to_span( self . fcx. tcx) , "writeback: `{:?}` is a local value" , c_ty) ;
368
+ if cfg ! ( debug_assertions) && c_ty. needs_infer ( ) {
369
+ span_bug ! (
370
+ hir_id. to_span( self . fcx. tcx) ,
371
+ "writeback: `{:?}` has inference variables" ,
372
+ c_ty
373
+ ) ;
370
374
} ;
371
375
372
376
self . tables . user_provided_types_mut ( ) . insert ( hir_id, c_ty. clone ( ) ) ;
@@ -399,10 +403,10 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
399
403
assert_eq ! ( fcx_tables. hir_owner, self . tables. hir_owner) ;
400
404
401
405
for ( & def_id, c_sig) in fcx_tables. user_provided_sigs . iter ( ) {
402
- if cfg ! ( debug_assertions) && c_sig. has_local_value ( ) {
406
+ if cfg ! ( debug_assertions) && c_sig. needs_infer ( ) {
403
407
span_bug ! (
404
408
self . fcx. tcx. hir( ) . span_if_local( def_id) . unwrap( ) ,
405
- "writeback: `{:?}` is a local value " ,
409
+ "writeback: `{:?}` has inference variables " ,
406
410
c_sig
407
411
) ;
408
412
} ;
@@ -457,7 +461,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
457
461
}
458
462
}
459
463
460
- if !opaque_defn. substs . has_local_value ( ) {
464
+ if !opaque_defn. substs . needs_infer ( ) {
461
465
// We only want to add an entry into `concrete_opaque_types`
462
466
// if we actually found a defining usage of this opaque type.
463
467
// Otherwise, we do nothing - we'll either find a defining usage
@@ -485,7 +489,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
485
489
}
486
490
}
487
491
} else {
488
- self . tcx ( ) . sess . delay_span_bug ( span, "`opaque_defn` is a local value " ) ;
492
+ self . tcx ( ) . sess . delay_span_bug ( span, "`opaque_defn` has inference variables " ) ;
489
493
}
490
494
}
491
495
}
@@ -579,8 +583,8 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
579
583
T : TypeFoldable < ' tcx > ,
580
584
{
581
585
let x = x. fold_with ( & mut Resolver :: new ( self . fcx , span, self . body ) ) ;
582
- if cfg ! ( debug_assertions) && x. has_local_value ( ) {
583
- span_bug ! ( span. to_span( self . fcx. tcx) , "writeback: `{:?}` is a local value " , x) ;
586
+ if cfg ! ( debug_assertions) && x. needs_infer ( ) {
587
+ span_bug ! ( span. to_span( self . fcx. tcx) , "writeback: `{:?}` has inference variables " , x) ;
584
588
}
585
589
x
586
590
}
0 commit comments