about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-08-06 17:18:59 -0400
committerRalf Jung <post@ralfj.de>2022-08-06 18:31:59 -0400
commit3c8563abcf91eda340aa77d238954dd00fa0cb34 (patch)
treed7e3ee5ab863b63b9379a90e3542c4940a54cb47 /compiler/rustc_codegen_ssa
parentaffe0d3a00e92fa7885e3f5d2c5073fde432d154 (diff)
downloadrust-3c8563abcf91eda340aa77d238954dd00fa0cb34.tar.gz
rust-3c8563abcf91eda340aa77d238954dd00fa0cb34.zip
make NOP dyn casts not require anything about the vtable
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/base.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs
index a840b270974..4c6be3f9108 100644
--- a/compiler/rustc_codegen_ssa/src/base.rs
+++ b/compiler/rustc_codegen_ssa/src/base.rs
@@ -151,6 +151,7 @@ pub fn unsized_info<'a, 'tcx, Bx: BuilderMethods<'a, '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;
             }