Rust-GCC / Rust-GCC/gccrs

Missing type error on function pointers with different ABIs

Open
#2,034 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug diagnostic good-first-pr
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
20h 2m
Merged PRs (30d)
66

Description

I tried this code: https://github.com/rust-lang/rust/blob/aa3ca1994904f2e056679fce1f185db8c7ed2703/src/test/ui/issue-10764.rs

fn f(_: extern "Rust" fn()) {}
extern fn bar() {}

fn main() { f(bar) }
//~^ ERROR mismatched types

I expected to see this happen: //~^ ERROR mismatched types

Instead, this happened:

<source>:1:9: error: unknown ABI option
    1 | fn f(_: extern "Rust" fn()) {}
      |         ^~~~~~
Meta
  • What version of Rust GCC were you using, git sha if possible. be27571c110d99fe55324a9c2b6622787b08fb52

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 the reproduction in src/test/ui/issue-10764.rs at the referenced commit and run it through gccrs to confirm the current diagnostic. Trace how the compiler handles the extern "Rust" ABI and function-pointer type checking; done means the example reports the expected mismatched types error instead of unknown ABI option.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.