Skip to content

"error: generic param redefined multiple times" when trying to use the same generic param multiple times in the same extern block #1131

@bjorn3

Description

@bjorn3

I tried this code:

extern "rust-intrinsic" {
    fn size_of<T>() -> usize;
    fn transmute<T, U>(_: T) -> U;
}

I expected to see this happen: It compiles

Instead, this happened:

<source>:3:18: error: generic param redefined multiple times
    3 |     fn transmute<T, U>(_: T) -> U;
      |                  ^
<source>:2:16: error: was defined here
    2 |     fn size_of<T>() -> usize;
      |                ^
Compiler returned: 1

Meta

  • What version of Rust GCC were you using, git sha if possible.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions