rust-lang / rust-lang/rustfmt

panic: `Option::unwrap()` on a `None` value

Open
#5,738 6 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

C-bug P-low
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

This is a fuzzer-generated bug, please feel free to close and/or let me know if it's not helpful!

rustfmt 1.5.2-nightly (2eaeb1e 2023-04-05)
enum En4<'x1, 'x2, T: Tr1<As1:  >> {
    V0,
    V1,
}

enum _En5<'x1, 'x2, T: Tr1<As1:  >> {
    _V0,
    _V1,
}

enum En6
where
    T: Tr1<En2<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S<S>>>>>>>>>>>>>>>>>>>>>>>>,
{
    V0,
    V1,
    V2,
    V3,
}

enum _En7 
where
    T: ,
{
    V0,
    V1,
}

fn _make_en7()
where
    T: ,
{
    
}

enum EnSelf<T> where Self: Tr1<As1: > {
    V0(T),
    V1,
    V2,
}

impl  EnSelf {  }

fn main() {
    if  ::Outest("") = wrap_en1_1::<_> {  };
    ;
    ;
}
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/tools/rustfmt/src/items.rs:439:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/std/src/panicking.rs:577:5
   1: core::panicking::panic_fmt
             at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/core/src/panicking.rs:67:14
   2: core::panicking::panic
             at /rustc/2eaeb1eee1b21772de8b935236d16ff8e03fdcf5/library/core/src/panicking.rs:117:5
   3: <rustfmt_nightly::visitor::FmtVisitor>::visit_item
   4: <rustfmt_nightly::visitor::FmtVisitor>::visit_items_with_reordering
   5: <rustfmt_nightly::visitor::FmtVisitor>::walk_mod_items
   6: <rustfmt_nightly::visitor::FmtVisitor>::format_separate_mod
   7: rustfmt_nightly::formatting::format_project::<rustfmt_nightly::Session<std::io::stdio::Stdout>>
   8: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::with::<<rustfmt_nightly::Session<std::io::stdio::Stdout>>::format_input_inner::{closure#0}, core::result::Result<rustfmt_nightly::FormatReport, rustfmt_nightly::ErrorKind>>
   9: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_span::create_session_if_not_set_then<core::result::Result<rustfmt_nightly::FormatReport, rustfmt_nightly::ErrorKind>, <rustfmt_nightly::Session<std::io::stdio::Stdout>>::format_input_inner::{closure#0}>::{closure#0}, core::result::Result<rustfmt_nightly::FormatReport, rustfmt_nightly::ErrorKind>>
  10: <rustfmt_nightly::Session<std::io::stdio::Stdout>>::format
  11: rustfmt::format_and_emit_report::<std::io::stdio::Stdout>
  12: <rustfmt_nightly::Session<std::io::stdio::Stdout>>::override_config::<rustfmt::format::{closure#0}, ()>
  13: rustfmt::execute
  14: rustfmt::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.