Skip to content

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

Closed
@brson

Description

@brson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.relnotesMarks issues that should be documented in the release notes of the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions