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

Regression resolving enum variant with name of struct when both are imported #30989

Closed
brson opened this Issue Jan 18, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@brson
Copy link
Contributor

brson commented Jan 18, 2016

rotor-http commit 42fc6cc9424bc32b8e2a36798f6f33ac4f065420 does not build on nightly 2fb0c5e with this error:

src/server/response.rs:43:37: 43:41 error: `Head` is the name of a struct or struct variant, but this expression uses it like a function name [E0423]
src/server/response.rs:43             body: if head.method == Head { Ignored } else { Normal },
                                                              ^~~~
src/server/response.rs:43:37: 43:41 help: run `rustc --explain E0423` to see a detailed explanation
src/server/response.rs:43:37: 43:41 help: did you mean to write: `Head { /* fields */ }`?

This worked as of nightly-2015-12-01, commit a2866e3.

Head is both a hyper::message::Message enum variant and a rotor-http struct and both are imported.

cc @rust-lang/lang @tailhook

@aturon

This comment has been minimized.

Copy link
Member

aturon commented Jan 18, 2016

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Jan 18, 2016

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Jan 18, 2016

This is due to #30896
The name conflict is legitimate, but it wasn't reported in cross-crate scenarios.
However, I expected this to be broken by #30882, not by #30896 o_O
cc #30882 (comment)

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Mar 24, 2016

@petrochenkov to be clear, are you saying this is a bug fix?

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Mar 24, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 7, 2016

Nominating for compiler team meeting, but I am inclined to flag this in the relnotes and take no action. Seems like it was a bug fix and I'm guessing rotor-http has fixed it downstream by now in any case, and there is no indication of widespread impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.