Skip to content

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

Closed
@dwrensha

Description

@dwrensha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions