Skip to content

Commit 06e77b9

Browse files
committed
Sync from rust fee693d
2 parents 8e234d5 + a921a47 commit 06e77b9

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/value_and_place.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff 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
_ => {

0 commit comments

Comments
 (0)