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

Path Error | Compiler ICE: src/librustc_typeck/astconv.rs:1516 #39237

Closed
zv opened this issue Jan 22, 2017 · 1 comment
Closed

Path Error | Compiler ICE: src/librustc_typeck/astconv.rs:1516 #39237

zv opened this issue Jan 22, 2017 · 1 comment

Comments

@zv
Copy link

zv commented Jan 22, 2017

When an enum value is incorrectly initialized as a variant, the Rust compiler slips on ICE.

Minimal

#[derive(PartialEq, PartialOrd, Clone, Debug)]
pub enum Sexp {
    /// A symbol or alist key
    List(Vec<Sexp>)
}

#[derive(Debug, Clone, Copy, PartialEq)]
enum InvalidType {
    ExpectingList
}

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum SexpError {
    InvalidType(InvalidType)
}

impl Sexp {
    pub fn delq(&self, other: Sexp) -> Result<Sexp, SexpError> {
        match *self {
            // I'm using unimplemented!() here to save space
           // changing the implementation here still makes some ICE.
            Sexp::List(ref elts) => unimplemented!(),
            _ => Err(SexpError::InvalidType::ExpectingList)
        }
    }
}

Meta

rustc --version --verbose:

rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)
binary: rustc
commit-hash: 47c8d9fdcf2e6502cf4ca7d7f059fdc1a2810afa
commit-date: 2017-01-08
host: x86_64-unknown-linux-gnu
release: 1.16.0-nightly
LLVM version: 3.9

Backtrace

[zv@syszv] sexpattern/src [icetest*] >> RUSTC_BACKTRACE=1 cargo build --verbose
       Fresh rustc-serialize v0.3.22
   Compiling sexpr v0.1.0 (file:///home/zv/Development/sexpattern)
     Running `rustc --crate-name sexpr lib.rs --crate-type lib --emit=dep-info,link -g -C metadata=d26636fcff6495c9 -C extra-filename=-d26636fcff6495c9 --out-dir /home/zv/Development/sexpattern/target/debug/deps -L dependency=/home/zv/Development/sexpattern/target/debug/deps --extern rustc_serialize=/home/zv/Development/sexpattern/target/debug/deps/librustc_serialize-03b62901d97343ea.rlib`
error: internal compiler error: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_typeck/astconv.rs:1516: unexpected definition: Variant(DefId { krate: CrateNum(0), node: DefIndex(75) => sexpr/65558c22e5fda111eadb1d551ef66576::SexpError[0]::InvalidType[0] })
  --> lib.rs:21:22
   |
21 |             _ => Err(SexpError::InvalidType::ExpectingList)
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_errors/lib.rs:382
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: Could not compile `sexpr`.

Caused by:
  process didn't exit successfully: `rustc --crate-name sexpr lib.rs --crate-type lib --emit=dep-info,link -g -C metadata=d26636fcff6495c9 -C extra-filename=-d26636fcff6495c9 --out-dir /home/zv/Development/sexpattern/target/debug/deps -L dependency=/home/zv/Development/sexpattern/target/debug/deps --extern rustc_serialize=/home/zv/Development/sexpattern/target/debug/deps/librustc_serialize-03b62901d97343ea.rlib` (exit code: 101)
@zv zv closed this as completed Jan 22, 2017
@zv zv reopened this Jan 22, 2017
@zv zv changed the title Compiler ICE: src/librustc_typeck/astconv.rs:1516 Path Error | Compiler ICE: src/librustc_typeck/astconv.rs:1516 Jan 22, 2017
@petrochenkov
Copy link
Contributor

Duplicate of #38862, fixed in #38925.

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

2 participants