diff options
| author | bors <bors@rust-lang.org> | 2024-04-08 20:31:08 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-08 20:31:08 +0000 | 
| commit | ab5bda1aa70f707014e2e691e43bc37a8819252a (patch) | |
| tree | 6950654770e3f3641ae9af51225599a53f623ff3 /compiler/rustc_middle/src/ty/instance.rs | |
| parent | 211518e5fb1336de6a4aab45dc1c05f5d83ce856 (diff) | |
| parent | 0520200a9c739da59e399350e618e16c25ab5ab4 (diff) | |
| download | rust-ab5bda1aa70f707014e2e691e43bc37a8819252a.tar.gz rust-ab5bda1aa70f707014e2e691e43bc37a8819252a.zip | |
Auto merge of #123645 - matthiaskrgr:rollup-yd8d7f1, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #122781 (Fix argument ABI for overaligned structs on ppc64le) - #123367 (Safe Transmute: Compute transmutability from `rustc_target::abi::Layout`) - #123518 (Fix `ByMove` coroutine-closure shim (for 2021 precise closure capturing behavior)) - #123547 (bootstrap: remove unused pub fns) - #123564 (Don't emit divide-by-zero panic paths in `StepBy::len`) - #123578 (Restore `pred_known_to_hold_modulo_regions`) - #123591 (Remove unnecessary cast from `LLVMRustGetInstrProfIncrementIntrinsic`) - #123632 (parser: reduce visibility of unnecessary public `UnmatchedDelim`) - #123635 (CFI: Fix ICE in KCFI non-associated function pointers) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src/ty/instance.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/instance.rs | 5 | 
1 files changed, 4 insertions, 1 deletions
| diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index 4a7720b38f8..f8f59fbeab4 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -520,7 +520,10 @@ impl<'tcx> Instance<'tcx> { // Reify `Trait::method` implementations if KCFI is enabled // FIXME(maurer) only reify it if it is a vtable-safe function _ if tcx.sess.is_sanitizer_kcfi_enabled() - && tcx.associated_item(def_id).trait_item_def_id.is_some() => + && tcx + .opt_associated_item(def_id) + .and_then(|assoc| assoc.trait_item_def_id) + .is_some() => { // If this function could also go in a vtable, we need to `ReifyShim` it with // KCFI because it can only attach one type per function. | 
