diff options
| author | bors <bors@rust-lang.org> | 2024-10-18 06:03:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-18 06:03:23 +0000 |
| commit | db8043bb199705e72246ca43d4af1e9dbe7d55be (patch) | |
| tree | 2d30f36d4ee071b0703062de9fa08e7ba4fe58a1 /compiler/rustc_codegen_ssa/src | |
| parent | d9c4b8d475360b52e6debead2cd710e9fe3c7110 (diff) | |
| parent | 13b398401f0f8b72b93227b557af8121ce2fcfa5 (diff) | |
| download | rust-db8043bb199705e72246ca43d4af1e9dbe7d55be.tar.gz rust-db8043bb199705e72246ca43d4af1e9dbe7d55be.zip | |
Auto merge of #131869 - matthiaskrgr:rollup-xrkz174, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #131654 (Various fixes for Xous) - #131743 (rustc_metadata: minor tidying) - #131823 (Bump libc to 0.2.161) - #131850 (Missing parenthesis) - #131857 (Allow dropping dyn principal) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index d91c0f0790d..f3d9a7d37e6 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -147,7 +147,7 @@ pub fn validate_trivial_unsize<'tcx>( infcx.leak_check(universe, None).is_ok() }) } - (None, None) => true, + (_, None) => true, _ => false, } } @@ -175,7 +175,8 @@ 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() { + let b_principal_def_id = data_b.principal_def_id(); + if data_a.principal_def_id() == b_principal_def_id || b_principal_def_id.is_none() { // Codegen takes advantage of the additional assumption, where if the // principal trait def id of what's being casted doesn't change, // then we don't need to adjust the vtable at all. This |
