Rust-GCC / Rust-GCC/gccrs

Refactor: Use native TyTy subsystem for intrinsic signature validation

Open
#4,596 0 comments 0 reactions 0 assignees View on GitHub

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.h
  • gcc/rust/typecheck/rust-hir-type-check-intrinsic.cc

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.