Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'duplicate definitions' regression with winapi 0.2.5 #32247

Closed
brson opened this issue Mar 14, 2016 · 11 comments
Closed

'duplicate definitions' regression with winapi 0.2.5 #32247

brson opened this issue Mar 14, 2016 · 11 comments
Assignees
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@brson
Copy link
Contributor

brson commented Mar 14, 2016

With rustc 1.9.0-nightly (74b886ab1 2016-03-13) I see this error building winapi 0.2.5:

C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:148:13: 150:14 error: duplicate definitions with name `item`: [E0201]
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:148             pub unsafe fn $variant(&self) -> &$fieldtype {
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:149                 ::std::mem::transmute(&self.$field)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:150             }
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\commctrl.rs:2496:1: 2496:59 note: in this expansion of UNION! (defined in C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:148:13: 150:14 help: run `rustc --explain E0201` to see a detailed explanation
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:148:13: 150:14 note: conflicting definition is here:
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:148             pub unsafe fn $variant(&self) -> &$fieldtype {
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:149                 ::std::mem::transmute(&self.$field)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:150             }
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\commctrl.rs:2503:1: 2503:59 note: in this expansion of UNION! (defined in C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:152:13: 154:14 error: duplicate definitions with name `item_mut`: [E0201]
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:152             pub unsafe fn $variantmut(&mut self) -> &mut $fieldtype {
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:153                 ::std::mem::transmute(&mut self.$field)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:154             }
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\commctrl.rs:2496:1: 2496:59 note: in this expansion of UNION! (defined in C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:152:13: 154:14 help: run `rustc --explain E0201` to see a detailed explanation
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:152:13: 154:14 note: conflicting definition is here:
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:152             pub unsafe fn $variantmut(&mut self) -> &mut $fieldtype {
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:153                 ::std::mem::transmute(&mut self.$field)
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs:154             }
C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\commctrl.rs:2503:1: 2503:59 note: in this expansion of UNION! (defined in C:\Users\brian\AppData\Local\.multirust\cargo\registry\src\github.com-88ac128001ac3a9a\winapi-0.2.5\src\macros.rs)
error: aborting due to 2 previous errors

This worked as recently as rustc 1.9.0-nightly (c9629d61c 2016-03-10).

cc @retep998 @nikomatsakis

@brson brson added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Mar 14, 2016
@retep998
Copy link
Member

Apparently this is a legitimate error in winapi that retep998/winapi-rs#267 will fix.

However, how did Rust not error about this before? The commit that added those lines was authored on Jul 30, 2015.

@alexcrichton
Copy link
Member

This is likely due to #31925

cc @aturon, @rust-lang/lang

Also nominating (I guess for T-lang?) for some discussion, seems like a standard "let's ship a fix and continue with the course correction", however, to me.

@alexcrichton alexcrichton added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Mar 14, 2016
@aturon
Copy link
Member

aturon commented Mar 14, 2016

Oh wow, we didn't go through a warning cycle for this change because we didn't expect the error to be hit.

Is this a significant enough problem for the ecosystem that we should switch to yield a warning for now? That's a pretty easy change to make.

brson added a commit to rust-lang/rustup that referenced this issue Mar 14, 2016
@brson
Copy link
Contributor Author

brson commented Mar 14, 2016

Since it's winapi, it seems prudent to switch it to a warning.

@aturon
Copy link
Member

aturon commented Mar 14, 2016

@alexcrichton tells me on IRC that a quick publication on winapi should address this, but if it's still not looking good by tomorrow morning I'll push up a PR to move to warning.

@retep998
Copy link
Member

winapi = "0.2.6" has been published with a fix for this.

@aturon
Copy link
Member

aturon commented Mar 15, 2016

@retep998 Thanks much!

@brson Was that the only breakage you saw?

@brson
Copy link
Contributor Author

brson commented Mar 15, 2016

@aturon yes

@dpc
Copy link
Contributor

dpc commented Mar 17, 2016

I think #32301 is related.

@aturon
Copy link
Member

aturon commented Mar 17, 2016

Update: I'm planning to land a PR changing this error to a warning shortly. At the moment, we still intend to go forward with this change (which we see as a bugfix), but will have at least one release cycle with warnings first.

@nikomatsakis
Copy link
Contributor

triage: P-high

@rust-highfive rust-highfive added P-high High priority and removed I-nominated labels Mar 17, 2016
bors added a commit that referenced this issue Mar 18, 2016
Change inherent overlap error to a warning for now, to ease the breakage

Closes #32247

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants