File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -480,17 +480,19 @@ impl<'tcx> CPlace<'tcx> {
480480 // fn(&T) -> for<'l> fn(&'l T) is allowed
481481 }
482482 ( & ty:: Dynamic ( from_traits, _) , & ty:: Dynamic ( to_traits, _) ) => {
483- let from_traits = fx
484- . tcx
485- . normalize_erasing_late_bound_regions ( ParamEnv :: reveal_all ( ) , from_traits) ;
486- let to_traits = fx
487- . tcx
488- . normalize_erasing_late_bound_regions ( ParamEnv :: reveal_all ( ) , to_traits) ;
489- assert_eq ! (
490- from_traits, to_traits,
491- "Can't write trait object of incompatible traits {:?} to place with traits {:?}\n \n {:#?}" ,
492- from_traits, to_traits, fx,
493- ) ;
483+ for ( from, to) in from_traits. iter ( ) . zip ( to_traits) {
484+ let from = fx
485+ . tcx
486+ . normalize_erasing_late_bound_regions ( ParamEnv :: reveal_all ( ) , from) ;
487+ let to = fx
488+ . tcx
489+ . normalize_erasing_late_bound_regions ( ParamEnv :: reveal_all ( ) , to) ;
490+ assert_eq ! (
491+ from, to,
492+ "Can't write trait object of incompatible traits {:?} to place with traits {:?}\n \n {:#?}" ,
493+ from_traits, to_traits, fx,
494+ ) ;
495+ }
494496 // dyn for<'r> Trait<'r> -> dyn Trait<'_> is allowed
495497 }
496498 _ => {
You can’t perform that action at this time.
0 commit comments