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

ICE: 'No def'n found for syntax::ast::DefId{krate: 0u32, node: 4u32} in tcx.tcache', #17001

Closed
compyman opened this issue Sep 5, 2014 · 7 comments
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

@compyman
Copy link

compyman commented Sep 5, 2014

I get this output:

error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'No def'n found for syntax::ast::DefId{krate: 0u32, node: 4u32} in tcx.tcache', /home/nate/builds/rust/src/librustc/middle/ty.rs:3991

when I try and compile this code: http://pastie.org/9528361

@huonw huonw added the I-ICE label Sep 5, 2014
@mdinger
Copy link
Contributor

mdinger commented Sep 7, 2014

Smaller testcase:

mod Parser {
    enum ParseResult<T> {
        Ok(T),
    }

    struct Parser<T> {
        parse:  Box<ParseResult<T>>
    }
}

fn main(){
    let p = Parser{ parse: box Parser::Ok("world") };
}

@huonw huonw added A-associated-items Area: Associated items (types, constants & functions) and removed A-associated-items Area: Associated items (types, constants & functions) labels Nov 20, 2014
@jfager
Copy link
Contributor

jfager commented Nov 29, 2014

Updated smaller testcase that ICEs post-namespaced-enums:

mod Parser {
    enum ParseResult<T> {
        Ok(T),
    }

    struct Parser<T> {
        parse:  Box<ParseResult<T>>
    }
}

fn main(){
    let p = Parser{ parse: box Parser::ParseResult::Ok("world") };
}

@jfager
Copy link
Contributor

jfager commented Nov 29, 2014

Doesn't even need to be that complicated:

mod Parser {
    struct Parser {
        parse: int
    }
}

fn main() {
    let p = Parser{ parse: 0i };
}

@ftxqxd
Copy link
Contributor

ftxqxd commented Nov 29, 2014

The ICE is caused by using a module as a struct name:

mod foo {}
fn main() {
    let p = foo { x: () };
}

@pinumbernumber
Copy link

The ICE is caused by using a module as a struct name

Yep. Just got hit by exactly the same thing trying to figure out the module system.

@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

Still an issue.

@pmarcelll
Copy link
Contributor

It works on nightly now.

@alexcrichton alexcrichton added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Sep 1, 2015
bors added a commit that referenced this issue Sep 9, 2015
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

No branches or pull requests

9 participants