rust-lang / rust

Empowering everyone to build reliable and efficient software.

Home Page:https://www.rust-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'called `Result::unwrap_err()` on an `Ok` value: false', compiler/rustc_builtin_macros/src/format.rs:173:51

dwrensha opened this issue · comments

I'm seeing an internal compiler error on the following input, found by fuzz-rustc:

fn m(){print!("",(c for&g
u
e
e
$ rustc bug.rs
error: this file contains an unclosed delimiter
 --> bug.rs:4:2
  |
1 | fn m(){print!("",(c for&g
  |       -      -   - unclosed delimiter
  |       |      |
  |       |      unclosed delimiter
  |       unclosed delimiter
...
4 | e
  |  ^

error: missing `in` in `for` loop
 --> bug.rs:1:26
  |
1 |   fn m(){print!("",(c for&g
  |  __________________________^
2 | | u
  | |_ help: try adding `in` here

error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found keyword `for`
 --> bug.rs:1:21
  |
1 | fn m(){print!("",(c for&g
  |                     ^^^ expected one of 8 possible tokens

error: expected `;`, found `e`
 --> bug.rs:3:2
  |
3 | e
  |  ^ help: add `;` here
4 | e
  | - unexpected token

thread 'rustc' panicked at 'called `Result::unwrap_err()` on an `Ok` value: false', compiler/rustc_builtin_macros/src/format.rs:173:51
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.57.0-nightly (fdf65053e 2021-09-07) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 4 previous errors

searched nightlies: from nightly-2021-05-10 to nightly-2021-09-08
regressed nightly: nightly-2021-07-28
searched commits: from 08095fc to 2faabf5
regressed commit: 8bebfe5

bisected with cargo-bisect-rustc v0.6.0

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2021-5-10 --end=2021-09-08 --regress ice 

This regressed in #87436.
cc @ebobrow