diff options
| author | bors <bors@rust-lang.org> | 2020-12-17 18:21:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-17 18:21:20 +0000 |
| commit | eb4fc71dc9024f15a0c9cc44bcc10c861e9d585e (patch) | |
| tree | 98e37a458058d875b8a5d7cb0d3a5a99e8414b9d /compiler/rustc_codegen_cranelift/src | |
| parent | d23e08448332425a84ae23124bea4dbd685536ce (diff) | |
| parent | 2edd3016c8bab6f849ca3a907ecd800777e36846 (diff) | |
| download | rust-eb4fc71dc9024f15a0c9cc44bcc10c861e9d585e.tar.gz rust-eb4fc71dc9024f15a0c9cc44bcc10c861e9d585e.zip | |
Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis
Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/value_and_place.rs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/value_and_place.rs b/compiler/rustc_codegen_cranelift/src/value_and_place.rs index cb40d4ed9a6..5bcb11fd515 100644 --- a/compiler/rustc_codegen_cranelift/src/value_and_place.rs +++ b/compiler/rustc_codegen_cranelift/src/value_and_place.rs @@ -480,17 +480,19 @@ impl<'tcx> CPlace<'tcx> { // fn(&T) -> for<'l> fn(&'l T) is allowed } (&ty::Dynamic(from_traits, _), &ty::Dynamic(to_traits, _)) => { - let from_traits = fx - .tcx - .normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), from_traits); - let to_traits = fx - .tcx - .normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), to_traits); - assert_eq!( - from_traits, to_traits, - "Can't write trait object of incompatible traits {:?} to place with traits {:?}\n\n{:#?}", - from_traits, to_traits, fx, - ); + for (from, to) in from_traits.iter().zip(to_traits) { + let from = fx + .tcx + .normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), from); + let to = fx + .tcx + .normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), to); + assert_eq!( + from, to, + "Can't write trait object of incompatible traits {:?} to place with traits {:?}\n\n{:#?}", + from_traits, to_traits, fx, + ); + } // dyn for<'r> Trait<'r> -> dyn Trait<'_> is allowed } _ => { |
