Most extern "*-interrupt-*" fn
should enforce 0-sized signatures · Issue #132837 · rust-lang/rust (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
I tried this code with rustc --target riscv64gc-unknown-linux-gnu rust_code.rs
:
#![feature(abi_riscv_interrupt)] pub extern "riscv-interrupt-m" fn interrupt_machine(_a: u8, _b: u8, _c: u8) { }
pub extern "riscv-interrupt-s" fn interrupt_supervisor(_a: u8, _b: u8, _c: u8) { }
pub fn main() { interrupt_machine(1, 2, 3); interrupt_supervisor(4, 5, 6); }
I expected to see rustc catch this invalid signature.
Instead, this happened:
rustc-LLVM ERROR: Functions with the interrupt attribute cannot have arguments!
My understanding is that the same story applies for non-x86 interrupt ABIs like MSP430's.
Meta
rustc --version --verbose
:
rustc 1.84.0-nightly (a0d98ff0e 2024-10-31)
binary: rustc
commit-hash: a0d98ff0e5b6e1f2c63fd26f68484792621b235c
commit-date: 2024-10-31
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1
@rustbot label: +A-hardware-interrupts +A-LLVM +O-riscv +O-msp430 +A-ABI +T-compiler