microsoft / microsoft/injectorppforrust

`fake!` macro needs to be scalable

Open
#65 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement help wanted
Dominant language
Rust
Stars
404
Forks
19
Avg merge
23h 57m
Merged PRs (30d)
1

Description

Current implementation of fake! is not scalable. It becomes more important now as type check is introduced. Especially for func_type which could result in many different options. For example, supporting unsafe extern "C" could result in copy and paste all the existing matchers and modify just the prefix.

Type check will fail if an unsafe function is faked by using a safe function as they have different signatures. So this will become a bottleneck for users who want to use the safe version APIs.

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 src/interface/macros.rs at the fake! macro implementation linked in the issue. Review how func_type matchers are currently handled and how the introduced type check distinguishes safe functions from unsafe extern "C" functions. Done means the macro scales to additional function-type variants without duplicating every matcher and preserves correct signature checking.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.