Skip to content

Scalable vector ABI check seems incomplete #161753

Description

@RalfJung

#143924 extended the ABI checks that we run during monomorphization to also cover scalable vectors. However, those ABI checks were only meant to catch "C" ABI problems, and they are therefore partially disabled for "Rust" ABI calls. Specifically, while we are checking "Rust" ABI definitions, we are not checking "Rust" ABI calls:

if extern_abi.is_rustic_abi() || extern_abi == ExternAbi::Unadjusted {
// We directly handle the soundness of Rust ABIs -- so let's skip the majority of
// call sites to avoid a perf regression.
// We disable all checks for the unadjusted ABI to allow linking to arbitrary LLVM
// intrinsics
return;
}

One can therefore compile this code without having the scalable vector target feature enabled:

fn foo(f: fn() -> svint32_t) {
  let _x = f();
}

At least, that's what I would expect; I don't have the setup to test this.

Cc @davidtwco @workingjubilee
Tracking issue: #145052

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-scalable-vectors`#[rustc_scalable_vector]`needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions