Closed
Description
When compiling a personal project, I got an error that the compiler panicked and entered unreachable code.
I've dumped the output:
Checking small_sat v0.1.0 (/Users/julianknodt/Desktop/programming/projects/rustjects/small_sat)
error: incorrect close delimiter: `}`
--> src/watch_list.rs:88:9
|
85 | match next {
| - close delimiter possibly meant for this
86 | None => self.units.push(,
| - un-closed delimiter
87 | Some(next) => todo.push((other_lit, cref, next)),
88 | }
| ^ incorrect close delimiter
error: incorrect close delimiter: `}`
--> src/watch_list.rs:95:5
|
91 | for (watched_lit, clause, next) in todo {
| - close delimiter possibly meant for this
92 | self.occurrences[watched_lit.raw()].iter_mut().find(|
| - un-closed delimiter
...
95 | }
| ^ incorrect close delimiter
error: expected one of `:`, `;`, `=`, `@`, or `|`, found `if`
--> src/watch_list.rs:77:5
|
75 | let new_units
| - help: a semicolon may be missing here
76 |
77 | if let Some(clauses) = self.occurrences.get_mut(lit.raw() as usize) {
| ^^
error: expected expression, found `,`
--> src/watch_list.rs:86:35
|
86 | None => self.units.push(,
| -- ^ expected expression
| |
| while parsing the `match` arm starting here
error: expected one of `,`, `::`, or `:`, found `.`
--> src/watch_list.rs:93:13
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^ expected one of `,`, `::`, or `:` here
error: expected one of `,`, `:`, or `@`, found `[`
--> src/watch_list.rs:93:25
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^ expected one of `,`, `:`, or `@` here
error: expected one of `,`, `@`, `]`, or `|`, found `.`
--> src/watch_list.rs:93:37
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^ expected one of `,`, `@`, `]`, or `|` here
error: expected one of `,`, `]`, or `|`, found `as`
--> src/watch_list.rs:93:44
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^^ expected one of `,`, `]`, or `|` here
error: expected identifier, found keyword `as`
--> src/watch_list.rs:93:44
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
93 | self.occurrences[watched_lit.raw() r#as usize].insert(clause, *next),
| ^^^^
error: expected one of `,`, `@`, `]`, or `|`, found `usize`
--> src/watch_list.rs:93:47
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^^^^^ expected one of `,`, `@`, `]`, or `|` here
error: expected one of `,` or `:`, found `.`
--> src/watch_list.rs:93:53
|
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| ^ expected one of `,` or `:` here
error: expected one of `)`, `-`, `_`, `box`, `mut`, `ref`, `|`, identifier, or path, found `*`
--> src/watch_list.rs:93:69
|
86 | None => self.units.push(,
| - unclosed delimiter
...
93 | self.occurrences[watched_lit.raw() as usize].insert(clause, *next),
| -^
| |
| help: `)` may belong here
thread 'rustc' panicked at 'internal error: entered unreachable code', src/libsyntax/parse/parser.rs:446:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
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
note: rustc 1.40.0-nightly (95f437b3c 2019-10-27) running on x86_64-apple-darwin
note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
error: aborting due to 12 previous errors
error: could not compile `small_sat`.
To learn more, run the command again with --verbose.
And I committed my code which caused the bug here:
JulianKnodt/small_sat@5e82572
It might be because I had only written half of an anonymous function at watch_list.rs
at line 92.
This is not that urgent as I only saw it with half-written code, but since the compiler suggested I file a bug I did.
rustc --version --verbose
:
rustc 1.40.0-nightly (95f437b3c 2019-10-27)
binary: rustc
commit-hash: 95f437b3cfb2fec966d7eaf69d7c2e36f9c274d1
commit-date: 2019-10-27
host: x86_64-apple-darwin
release: 1.40.0-nightly
LLVM version: 9.0
Metadata
Metadata
Assignees
Labels
Area: Compiler frontend (errors, parsing and HIR)Area: The lexing & parsing of Rust source code to an ASTCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️High priorityRelevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.