Skip to content

ICE: Wrong temporary lifetime computation #11854

Closed
@flaper87

Description

@flaper87

Nested modules with static items cause this error:

error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
task 'rustc' failed at 'No enclosing scope for id 17', /home/flaper87/workspace/personal/rust/src/librustc/middle/region.rs:145

Output for: rustc test.rs --pretty expanded,identified

use std::prelude::*;
extern mod std = "std#0.10-pre";
extern mod green = "green#0.10-pre";
extern mod rustuv = "rustuv#0.10-pre";


fn main() {
    mod t {
        use std::prelude::*;
        enum E { V = (1 /* 10 */), A = (0 /* 12 */), }
        /*
        9
        */
        static C: E = (V /* 17 */);
        /*
        14
        */
    }
    /*
    7
    */
} /* block 19 */ /* 5 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions