Skip to content

Commit 2e71518

Browse files
authored
Rollup merge of #146664 - fmease:clean-up-dyn, r=jdonszelmann
Clean up `ty::Dynamic` 1. As a follow-up to PR rust-lang/rust#143036, remove `DynKind` entirely. 2. Inside HIR ty lowering, consolidate modules `dyn_compatibility` and `lint` into `dyn_trait` * `dyn_compatibility` wasn't about dyn compatibility itself, it's about lowering trait object types * `lint` contained dyn-Trait-specific diagnostics+lints only
2 parents 8b7d5f1 + e53af72 commit 2e71518

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ pub(crate) fn codegen_drop<'tcx>(
715715
fx.bcx.ins().jump(ret_block, &[]);
716716
} else {
717717
match ty.kind() {
718-
ty::Dynamic(_, _, ty::Dyn) => {
718+
ty::Dynamic(_, _) => {
719719
// IN THIS ARM, WE HAVE:
720720
// ty = *mut (dyn Trait)
721721
// which is: exists<T> ( *mut T, Vtable<T: Trait> )

src/unsize.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ pub(crate) fn unsized_info<'tcx>(
3030
fx.pointer_type,
3131
len.try_to_target_usize(fx.tcx).expect("expected monomorphic const in codegen") as i64,
3232
),
33-
(&ty::Dynamic(data_a, _, src_dyn_kind), &ty::Dynamic(data_b, _, target_dyn_kind))
34-
if src_dyn_kind == target_dyn_kind =>
35-
{
33+
(&ty::Dynamic(data_a, _), &ty::Dynamic(data_b, _)) => {
3634
let old_info =
3735
old_info.expect("unsized_info: missing old info for trait upcasting coercion");
3836
let b_principal_def_id = data_b.principal_def_id();

src/value_and_place.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,7 @@ pub(crate) fn assert_assignable<'tcx>(
909909
);
910910
// fn(&T) -> for<'l> fn(&'l T) is allowed
911911
}
912-
(&ty::Dynamic(from_traits, _, _from_kind), &ty::Dynamic(to_traits, _, _to_kind)) => {
913-
// FIXME(dyn-star): Do the right thing with DynKinds
912+
(&ty::Dynamic(from_traits, _), &ty::Dynamic(to_traits, _)) => {
914913
for (from, to) in from_traits.iter().zip(to_traits) {
915914
let from = fx.tcx.normalize_erasing_late_bound_regions(fx.typing_env(), from);
916915
let to = fx.tcx.normalize_erasing_late_bound_regions(fx.typing_env(), to);

0 commit comments

Comments
 (0)