Refactor: Use native TyTy subsystem for intrinsic signature validation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
The current implementation of the intrinsic signature checker introduces an ad-hoc IntrinsicRuleType enum and a manual IntrinsicChecker::check_type state machine. This approach creates a decoupled parallel type hierarchy that mirrors the compiler's actual type system (TyTy), leading to substantial boilerplate and maintenance overhead.
Instead of this,
build the expected signature type like we do with builtin macros within the compiler and then make sure both function match.
releated files:
gcc/rust/typecheck/rust-hir-type-check-intrinsic.hgcc/rust/typecheck/rust-hir-type-check-intrinsic.cc
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 with gcc/rust/typecheck/rust-hir-type-check-intrinsic.h and gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc, then trace the existing IntrinsicRuleType and IntrinsicChecker::check_type flow. Compare this with how builtin macros build expected signature types. Done means intrinsic validation uses the native TyTy representation and checks the expected and actual signatures without the parallel type hierarchy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100