Need comprehensive story for `target_feature` compat
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
From https://github.com/rust-lang/rust/pull/138872 per Amanieu:
I do think we need a more general mechanism to indicate that 2 target features are mutually incompatible. For example:
- RISC-V: Zfinx & F
- RISC-V: I & E
- ARM: mclass & rclass & aclass
Currently nothing stops you from enabling incompatible features with
#[target_feature]and-C target-feature, which will crash LLVM.
We should be emitting an error way before anything gets to LLVM because we have to have a better idea of what features are actually compatible. We effectively need to have both global and local notions of it.
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
Read the linked PR #138872 and trace the existing #[target_feature] and -C target-feature handling before LLVM. Define how incompatible features such as RISC-V Zfinx/F and I/E should be rejected, including both global and local cases. Done means incompatible combinations produce compiler errors instead of reaching LLVM.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100