ABI compat check: detect unadjusted ABI mismatches
This commit is contained in:
parent
bf662eb808
commit
ab7b03e3f4
4 changed files with 26 additions and 6 deletions
|
@ -1700,7 +1700,9 @@ impl<FieldIdx: Idx, VariantIdx: Idx> LayoutS<FieldIdx, VariantIdx> {
|
|||
|
||||
/// Checks if these two `Layout` are equal enough to be considered "the same for all function
|
||||
/// call ABIs". Note however that real ABIs depend on more details that are not reflected in the
|
||||
/// `Layout`; the `PassMode` need to be compared as well.
|
||||
/// `Layout`; the `PassMode` need to be compared as well. Also note that we assume
|
||||
/// aggregates are passed via `PassMode::Indirect` or `PassMode::Cast`; more strict
|
||||
/// checks would otherwise be required.
|
||||
pub fn eq_abi(&self, other: &Self) -> bool {
|
||||
// The one thing that we are not capturing here is that for unsized types, the metadata must
|
||||
// also have the same ABI, and moreover that the same metadata leads to the same size. The
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue