Skip to content

Commit

Permalink
make NOP dyn casts not require anything about the vtable
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 6, 2022
1 parent 451817e commit 8520535
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/unsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub(crate) fn unsized_info<'tcx>(
let old_info =
old_info.expect("unsized_info: missing old info for trait upcasting coercion");
if data_a.principal_def_id() == data_b.principal_def_id() {
// A NOP cast that doesn't actually change anything, should be allowed even with invalid vtables.
return old_info;
}

Expand Down

0 comments on commit 8520535

Please sign in to comment.