Fix name collision between C enum and typedef#2326
Merged
pvdrz merged 2 commits intorust-lang:masterfrom Nov 28, 2022
Merged
Conversation
|
☔ The latest upstream changes (presumably f160d11) made this pull request unmergeable. Please resolve the merge conflicts. |
error[E0428]: the name `Enum` is defined multiple times
--> bindgen-tests/tests/expectations/tests/enum-typedef.rs:10:1
|
9 | pub type Enum = ::std::os::raw::c_uint;
| --------------------------------------- previous definition of the type `Enum` here
10 | pub type Enum = i16;
| ^^^^^^^^^^^^^^^^^^^^ `Enum` redefined here
|
= note: `Enum` must be defined only once in the type namespace of this module
error[E0428]: the name `TypedefFirst` is defined multiple times
--> bindgen-tests/tests/expectations/tests/enum-typedef.rs:13:1
|
11 | pub type TypedefFirst = i16;
| ---------------------------- previous definition of the type `TypedefFirst` here
12 | pub const TypedefFirst_Variant2: TypedefFirst = 0;
13 | pub type TypedefFirst = ::std::os::raw::c_uint;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `TypedefFirst` redefined here
|
= note: `TypedefFirst` must be defined only once in the type namespace of this module
Member
Author
|
pvdrz
approved these changes
Nov 28, 2022
facebook-github-bot
pushed a commit
to facebookexperimental/rust-shed
that referenced
this pull request
Mar 22, 2023
Summary: Both waiting-in PRs have been merged and released: - rust-lang/rust-bindgen#2319 - rust-lang/rust-bindgen#2326 Adding `artifact = "bin"` removes the need for the `lib.rs` patch: - fbsource/bindgen@3579276 Reviewed By: jsgf Differential Revision: D44301594 fbshipit-source-id: d5ac1b54b099655e8e87974e42439bcd32aa5aed
facebook-github-bot
pushed a commit
to facebook/fb303
that referenced
this pull request
Mar 22, 2023
Summary: Both waiting-in PRs have been merged and released: - rust-lang/rust-bindgen#2319 - rust-lang/rust-bindgen#2326 Adding `artifact = "bin"` removes the need for the `lib.rs` patch: - fbsource/bindgen@3579276 Reviewed By: jsgf Differential Revision: D44301594 fbshipit-source-id: d5ac1b54b099655e8e87974e42439bcd32aa5aed
facebook-github-bot
pushed a commit
to facebook/sapling
that referenced
this pull request
Mar 22, 2023
Summary: Both waiting-in PRs have been merged and released: - rust-lang/rust-bindgen#2319 - rust-lang/rust-bindgen#2326 Adding `artifact = "bin"` removes the need for the `lib.rs` patch: - fbsource/bindgen@3579276 Reviewed By: jsgf Differential Revision: D44301594 fbshipit-source-id: d5ac1b54b099655e8e87974e42439bcd32aa5aed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2008.
Example:
This is valid and idiomatic C (though not valid C++).
cbindgenuses this idiom as the default C translation of Rust enums, the equivalent of what would beenum Enum : int16_t { Variant };in C++.bindgen header.hbefore:After: