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

Enum inside enum - assertion failed: !self.in_variant #40350

Closed
dtolnay opened this issue Mar 8, 2017 · 1 comment
Closed

Enum inside enum - assertion failed: !self.in_variant #40350

dtolnay opened this issue Mar 8, 2017 · 1 comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@dtolnay
Copy link
Member

dtolnay commented Mar 8, 2017

$ rustc --version
rustc 1.17.0-nightly (b1e31766d 2017-03-03)
enum E {
    A = {
        enum F { B }
        0
    }
}
thread 'rustc' panicked at 'assertion failed: !self.in_variant', /checkout/src/librustc_lint/builtin.rs:472

assert!(!self.in_variant);

@dtolnay dtolnay changed the title Proc macro in enum - assertion failed: !self.in_variant Enum inside enum - assertion failed: !self.in_variant Mar 8, 2017
@TimNN TimNN added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. labels Mar 8, 2017
@TimNN
Copy link
Contributor

TimNN commented Mar 8, 2017

Taking a quick look at the source, the fix here is probably to turn MissingDoc::in_variant into a depth counter and increment / decrement instead of setting to true / false.

bors added a commit that referenced this issue May 29, 2017
Don't ICE with nested enums in missing docs lint.

Fixes #40350.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants