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: Option<~str> in static struct => internal compiler error #8578

Closed
stepancheg opened this issue Aug 17, 2013 · 1 comment · Fixed by #11012
Closed

Regression: Option<~str> in static struct => internal compiler error #8578

stepancheg opened this issue Aug 17, 2013 · 1 comment · Fixed by #11012
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@stepancheg
Copy link
Contributor

pub struct UninterpretedOption_NamePart {
    name_part: Option<~str>,
}

impl<'self> UninterpretedOption_NamePart {
    pub fn default_instance() -> &'static UninterpretedOption_NamePart {
        static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart {
            name_part: None,
        };
        &'static instance
    }
}

fn main() {}

Compiler from master crashes with:

task <unnamed> failed at 'No enclosing scope for id 20', /Users/yozh/devel/rust-ide/rust/src/librustc/middle/region.rs:122
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task <unnamed> failed at 'explicit failure', /Users/yozh/devel/rust-ide/rust/src/librustc/rustc.rs:371

It is regression, code works in 0.7.

P. S. Compiler knows id of AST node, it could also report file and line number.

@alexcrichton
Copy link
Member

Good news! This has somehow been fixed in the meantime since a few months ago.

Flagging as needstest.

bors added a commit that referenced this issue Dec 18, 2013
alexcrichton added a commit that referenced this issue Dec 19, 2013
Closes #5806
Closes #5950
Closes #7178
Closes #8259
Closes #8578
Closes #8851
Closes #9129
Closes #10412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants