Scalable vector ABI check seems incomplete
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
https://github.com/rust-lang/rust/pull/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:
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: https://github.com/rust-lang/rust/issues/145052
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in compiler/rustc_monomorphize/src/mono_checks/abi_check.rs around lines 199-205 and compare the existing Rust ABI definition handling with Rust ABI calls. Use the scalable-vector function-pointer example in the issue as the reproduction case. Done means the call is checked consistently and the example cannot compile without the scalable vector target feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100