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

Typedef'd enums cannot reference variants #31355

Closed
KiChjang opened this issue Feb 2, 2016 · 1 comment
Closed

Typedef'd enums cannot reference variants #31355

KiChjang opened this issue Feb 2, 2016 · 1 comment

Comments

@KiChjang
Copy link
Member

KiChjang commented Feb 2, 2016

The following code does not compile:

pub enum Foo {
    Bar,
    Qux,
}

pub type Alias = Foo;

fn main() {
    let baz = Alias::Bar;
}

It produces the following error message:

<anon>:9:15: 9:25 error: no associated item named `Bar` found for type `Foo` in the current scope
<anon>:9     let baz = Alias::Bar;
                       ^~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101
@mitaa
Copy link
Contributor

mitaa commented Feb 2, 2016

#26264

@jdm jdm closed this as completed Feb 2, 2016
Tycheon added a commit to Tycheon/servo that referenced this issue Feb 18, 2016
Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around rust-lang/rust#31355
jdm pushed a commit to jdm/servo that referenced this issue Mar 23, 2016
Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around rust-lang/rust#31355
bors-servo pushed a commit to servo/servo that referenced this issue Mar 24, 2016
Fix #9511. Export webidl enums using "pub use".

Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around rust-lang/rust#31355

Rebase of #9691.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10152)
<!-- Reviewable:end -->
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 1, 2019
…(from jdm:9511-rebase); r=nox

Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around rust-lang/rust#31355

Rebase of #9691.

Source-Repo: https://github.com/servo/servo
Source-Revision: edcf24fd4d39e86548717ecdfe36e2f1df30daac

UltraBlame original commit: 00562e792f94bec284362eb890efac88f6ce30c2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
…(from jdm:9511-rebase); r=nox

Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around rust-lang/rust#31355

Rebase of #9691.

Source-Repo: https://github.com/servo/servo
Source-Revision: edcf24fd4d39e86548717ecdfe36e2f1df30daac

UltraBlame original commit: 00562e792f94bec284362eb890efac88f6ce30c2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
…(from jdm:9511-rebase); r=nox

Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around rust-lang/rust#31355

Rebase of #9691.

Source-Repo: https://github.com/servo/servo
Source-Revision: edcf24fd4d39e86548717ecdfe36e2f1df30daac

UltraBlame original commit: 00562e792f94bec284362eb890efac88f6ce30c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants