@@ -3,7 +3,6 @@ use std::ops::ControlFlow;
3
3
4
4
use rustc_hir:: def_id:: DefId ;
5
5
use rustc_infer:: infer:: TyCtxtInferExt ;
6
- use rustc_infer:: infer:: at:: ToTrace ;
7
6
use rustc_infer:: traits:: ObligationCause ;
8
7
use rustc_infer:: traits:: util:: PredicateSet ;
9
8
use rustc_middle:: bug;
@@ -128,7 +127,8 @@ fn prepare_vtable_segments_inner<'tcx, T>(
128
127
. iter_identity_copied ( )
129
128
. filter_map ( move |( pred, _) | {
130
129
Some (
131
- tcx. instantiate_bound_regions_with_erased (
130
+ tcx. normalize_erasing_late_bound_regions (
131
+ ty:: TypingEnv :: fully_monomorphized ( ) ,
132
132
pred. instantiate_supertrait (
133
133
tcx,
134
134
ty:: Binder :: dummy ( inner_most_trait_ref) ,
@@ -229,6 +229,8 @@ fn vtable_entries<'tcx>(
229
229
tcx : TyCtxt < ' tcx > ,
230
230
trait_ref : ty:: TraitRef < ' tcx > ,
231
231
) -> & ' tcx [ VtblEntry < ' tcx > ] {
232
+ debug_assert ! ( !trait_ref. has_non_region_infer( ) && !trait_ref. has_non_region_param( ) ) ;
233
+
232
234
debug ! ( "vtable_entries({:?})" , trait_ref) ;
233
235
234
236
let mut entries = vec ! [ ] ;
@@ -422,17 +424,8 @@ fn trait_refs_are_compatible<'tcx>(
422
424
let ocx = ObligationCtxt :: new ( & infcx) ;
423
425
let source_principal = ocx. normalize ( & ObligationCause :: dummy ( ) , param_env, vtable_principal) ;
424
426
let target_principal = ocx. normalize ( & ObligationCause :: dummy ( ) , param_env, target_principal) ;
425
- let Ok ( ( ) ) = ocx. eq_trace (
426
- & ObligationCause :: dummy ( ) ,
427
- param_env,
428
- ToTrace :: to_trace (
429
- & ObligationCause :: dummy ( ) ,
430
- ty:: Binder :: dummy ( target_principal) ,
431
- ty:: Binder :: dummy ( source_principal) ,
432
- ) ,
433
- target_principal,
434
- source_principal,
435
- ) else {
427
+ let Ok ( ( ) ) = ocx. eq ( & ObligationCause :: dummy ( ) , param_env, target_principal, source_principal)
428
+ else {
436
429
return false ;
437
430
} ;
438
431
ocx. select_all_or_error ( ) . is_empty ( )
0 commit comments