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

compiler panic on "this enum variant takes 1 argument but 2 arguments were supplied" #94444

Closed
leoleoasd opened this issue Feb 28, 2022 · 4 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@leoleoasd
Copy link

leoleoasd commented Feb 28, 2022

Code

https://github.com/leoleoasd/ptranse/blob/6e7d647a2ea77af904c461df7df6a9067c76809f/src/process.rs#L90

Sorry, I'm new to rust and I can't provide a more minimized example. Commenting this line out and everything works fine.

Meta

rustc --version --verbose:

rustc 1.61.0-nightly (68369a041 2022-02-22)
binary: rustc
commit-hash: 68369a041cea809a87e5bd80701da90e0e0a4799
commit-date: 2022-02-22
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Error output

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.61.0-nightly (68369a041 2022-02-22) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C opt-level=3 -C embed-bitcode=no

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `process::process`
#1 [typeck] type-checking `process::process::{closure#0}`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
Backtrace

  Compiling ptranse v0.1.0 (/home/leo/code/ptranse)
warning: unused imports: `ProgressIterator`, `ProgressStyle`
 --> src/process.rs:8:30
  |
8 | use indicatif::{ProgressBar, ProgressStyle, ProgressIterator};
  |                              ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error: internal compiler error: compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:318:26: while adjusting Expr { hir_id: HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 761 }, kind: MethodCall(PathSegment { ident: take#0, hir_id: Some(HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 755 }), res: Some(Err), args: None, infer_args: true }, [Expr { hir_id: HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 759 }, kind: MethodCall(PathSegment { ident: iter#0, hir_id: Some(HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 756 }), res: Some(Err), args: None, infer_args: true }, [Expr { hir_id: HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 758 }, kind: Path(Resolved(None, Path { span: src/process.rs:90:31: 90:32 (#0), res: Local(HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 748 }), segments: [PathSegment { ident: t#0, hir_id: Some(HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 757 }), res: Some(Local(HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 748 })), args: None, infer_args: true }] })), span: src/process.rs:90:31: 90:32 (#0) }], src/process.rs:90:33: 90:39 (#0)), span: src/process.rs:90:31: 90:39 (#0) }, Expr { hir_id: HirId { owner: DefId(0:50 ~ ptranse[60bd]::process::process), local_id: 760 }, kind: Lit(Spanned { node: Int(1, Unsuffixed), span: src/process.rs:90:45: 90:46 (#0) }), span: src/process.rs:90:45: 90:46 (#0) }], src/process.rs:90:40: 90:47 (#0)), span: src/process.rs:90:31: 90:47 (#0) }, can't compose [Borrow(Ref('_#440r, Mut { allow_two_phase_borrow: Yes })) -> &mut std::iter::Take<std::collections::hash_set::Iter<'_, &Triple<'_>>>] and [Borrow(Ref('_#454r, Mut { allow_two_phase_borrow: Yes })) -> &mut std::iter::Take<std::collections::hash_set::Iter<'_, &Triple<'_>>>]

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1160:9
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::bug
   3: <rustc_errors::Handler>::bug
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, ()>
   5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   6: rustc_middle::util::bug::bug_fmt
   7: <rustc_typeck::check::fn_ctxt::FnCtxt>::apply_adjustments
   8: <rustc_typeck::check::method::confirm::ConfirmContext>::confirm
   9: <rustc_typeck::check::fn_ctxt::FnCtxt>::lookup_method
  10: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  11: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  12: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  13: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
  14: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_call
  15: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  16: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17: <rustc_middle::ty::Ty as rustc_middle::ty::context::InternIteratorElement<rustc_middle::ty::Ty, rustc_middle::ty::Ty>>::intern_with::<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Expr>>, <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_tuple::{closure#1}>, <rustc_middle::ty::context::TyCtxt>::mk_tup<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Expr>>, <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_tuple::{closure#1}>>::{closure#0}>
  18: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  19: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  20: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  21: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  22: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  23: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  24: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  25: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  26: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  27: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  28: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  29: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  30: rustc_typeck::check::check::check_fn
  31: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_closure
  32: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  33: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_argument_types
  34: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  35: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  36: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  37: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  38: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  39: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  40: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_kind
  41: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  42: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_stmt
  43: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_block_with_expected
  44: <rustc_typeck::check::fn_ctxt::FnCtxt>::check_expr_with_expectation
  45: rustc_typeck::check::check::check_fn
  46: <rustc_infer::infer::InferCtxtBuilder>::enter::<&rustc_middle::ty::context::TypeckResults, <rustc_typeck::check::inherited::InheritedBuilder>::enter<rustc_typeck::check::typeck_with_fallback<rustc_typeck::check::typeck::{closure#0}>::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}>
  47: rustc_typeck::check::typeck
  48: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
  49: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
  50: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  51: rustc_typeck::check::typeck
  52: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>
  53: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::ty::context::TypeckResults>>
  54: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  55: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_typeck::check::typeck_item_bodies::{closure#0}>
  56: rustc_typeck::check::typeck_item_bodies
  57: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), ()>
  58: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), ()>>
  59: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
  60: rustc_typeck::check_crate
  61: rustc_interface::passes::analysis
  62: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorReported>>
  63: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorReported>>>
  64: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  65: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorReported>>
  66: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorReported>>
  67: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  68: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>
  69: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorReported>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.61.0-nightly (68369a041 2022-02-22) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `process::process`
#1 [typeck] type-checking `process::process::{closure#0}`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
warning: `ptranse` (bin "ptranse") generated 1 warning
error: could not compile `ptranse`; 1 warning emitted

Other information

rustc 1.58.0-nightly doesn't have this bug.

(i386)  ➜  ~/code/ptranse git:(master) rustc -V --verbose
rustc 1.58.0-nightly (e90c5fbbc 2021-11-12)
binary: rustc
commit-hash: e90c5fbbc5df5c81267747daeb937d4e955ce6ad
commit-date: 2021-11-12
host: x86_64-apple-darwin
release: 1.58.0-nightly
LLVM version: 13.0.0
(i386)  ➜  ~/code/ptranse git:(master) cargo build
   Compiling ptranse v0.1.0 (/Volumes/Code/ptranse)
warning: unused imports: `ProgressIterator`, `ProgressStyle`
 --> src/process.rs:8:30
  |
8 | use indicatif::{ProgressBar, ProgressStyle, ProgressIterator};
  |                              ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
  --> src/process.rs:90:26
   |
90 |                 (triple, Some(t.iter().take(1).next().unwrap(), r1.2 as f64 / total_length as f64))
   |                          ^^^^ --------------------------------  --------------------------------- supplied 2 arguments
   |                          |
   |                          expected 1 argument

warning: unused import: `rand::prelude`
 --> src/process.rs:7:5
  |
7 | use rand::prelude::*;
  |     ^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0061`.
warning: `ptranse` (bin "ptranse") generated 2 warnings
error: could not compile `ptranse` due to previous error; 2 warnings emitted
@leoleoasd leoleoasd added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 28, 2022
@YanWQ-monad
Copy link

YanWQ-monad commented Feb 28, 2022

Provide a minimized example based on the given code.

fn main() {
    let vector = vec![1];
    let _ = vector
        .iter()
        .map(|_| -> Option<(i32, i32)> {
            let t = vec![1];
            
            // It's expected to be a compile error
            // A correct version: Some((t.into_iter().next().unwrap(), 1))
            Some(t.into_iter().next().unwrap(), 1)
        })
        .collect::<Vec<_>>();
}
Compile Details

Rustc version

$ rustc --version -v
rustc 1.61.0-nightly (6a7055661 2022-02-27)
binary: rustc
commit-hash: 6a705566166debf5eff88c57140df607fa409aaa
commit-date: 2022-02-27
host: aarch64-apple-darwin
release: 1.61.0-nightly
LLVM version: 14.0.0

Compiler Output

$ rustc test.rs
error: internal compiler error: compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:327:26: while adjusting Expr { hir_id: HirId { owner: DefId(0:3 ~ test[da6a]::main), local_id: 42 }, kind: MethodCall(PathSegment { ident: into_iter#0, hir_id: Some(HirId { owner: DefId(0:3 ~ test[da6a]::main), local_id: 39 }), res: Some(Err), args: None, infer_args: true }, [Expr { hir_id: HirId { owner: DefId(0:3 ~ test[da6a]::main), local_id: 41 }, kind: Path(Resolved(None, Path { span: test.rs:10:18: 10:19 (#0), res: Local(HirId { owner: DefId(0:3 ~ test[da6a]::main), local_id: 34 }), segments: [PathSegment { ident: t#0, hir_id: Some(HirId { owner: DefId(0:3 ~ test[da6a]::main), local_id: 40 }), res: Some(Local(HirId { owner: DefId(0:3 ~ test[da6a]::main), local_id: 34 })), args: None, infer_args: true }] })), span: test.rs:10:18: 10:19 (#0) }], test.rs:10:20: 10:31 (#0)), span: test.rs:10:18: 10:31 (#0) }, can't compose [Borrow(Ref('_#6r, Mut { allow_two_phase_borrow: Yes })) -> &mut std::vec::IntoIter<{integer}>] and [Borrow(Ref('_#8r, Mut { allow_two_phase_borrow: Yes })) -> &mut std::vec::IntoIter<{integer}>]

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1158:9
stack backtrace:
   0:        0x103718b84 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1eb510dfd09ed899
   1:        0x10376dee0 - core::fmt::write::h00f1496c6caeaf10
   2:        0x10370aa8c - std::io::Write::write_fmt::h2bb9a347f72939fa
   3:        0x10371c8c8 - std::panicking::default_hook::{{closure}}::h437574f21bffb80b
   4:        0x10371c538 - std::panicking::default_hook::h0d118f23c310e4da
   5:        0x10a74da4c - rustc_driver[511e453c955ff185]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x10371d0c8 - std::panicking::rust_panic_with_hook::hf2ea2a5cb14e624b
   7:        0x10e1a9b7c - std[e23bf27bba9e92a8]::panicking::begin_panic::<rustc_errors[f4b0e5b914d5bbb1]::ExplicitBug>::{closure#0}
   8:        0x10e1a9b34 - std[e23bf27bba9e92a8]::sys_common::backtrace::__rust_end_short_backtrace::<std[e23bf27bba9e92a8]::panicking::begin_panic<rustc_errors[f4b0e5b914d5bbb1]::ExplicitBug>::{closure#0}, !>
   9:        0x10e4778f8 - std[e23bf27bba9e92a8]::panicking::begin_panic::<rustc_errors[f4b0e5b914d5bbb1]::ExplicitBug>
  10:        0x10e1d7ae4 - std[e23bf27bba9e92a8]::panic::panic_any::<rustc_errors[f4b0e5b914d5bbb1]::ExplicitBug>
  11:        0x10e1d54b0 - <rustc_errors[f4b0e5b914d5bbb1]::HandlerInner>::bug
  12:        0x10e1d3c44 - <rustc_errors[f4b0e5b914d5bbb1]::Handler>::bug
  13:        0x10e0824dc - rustc_middle[45aced61d2d8c29b]::ty::context::tls::with_opt::<rustc_middle[45aced61d2d8c29b]::util::bug::opt_span_bug_fmt<rustc_span[4a73d757271419d3]::span_encoding::Span>::{closure#0}, ()>
  14:        0x10e083948 - rustc_middle[45aced61d2d8c29b]::util::bug::opt_span_bug_fmt::<rustc_span[4a73d757271419d3]::span_encoding::Span>
  15:        0x10e46d628 - rustc_middle[45aced61d2d8c29b]::util::bug::bug_fmt
  16:        0x10cb5f78c - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::apply_adjustments
  17:        0x10cc4ac94 - <rustc_typeck[f85cebba5e32df34]::check::method::confirm::ConfirmContext>::confirm
  18:        0x10cb64148 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::lookup_method
  19:        0x10cb5b118 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_kind
  20:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:        0x10cb5b0d4 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_kind
  22:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23:        0x10cb30aa0 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_argument_types
  24:        0x10cb14354 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::confirm_builtin_call
  25:        0x10cb121fc - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_call
  26:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:        0x10cb33e00 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  28:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:        0x10cb24fa4 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_return_expr
  30:        0x10ccf3104 - rustc_typeck[f85cebba5e32df34]::check::check::check_fn
  31:        0x10cb58878 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_closure
  32:        0x10cb5b048 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_kind
  33:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:        0x10cb30aa0 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_argument_types
  35:        0x10cb2fca8 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_method_argument_types
  36:        0x10cb5d2d8 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_kind
  37:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  38:        0x10cb5b0d4 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_kind
  39:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  40:        0x10cb33318 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_decl_initializer
  41:        0x10cb33408 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_decl
  42:        0x10cb335d0 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_stmt
  43:        0x10cb33dd0 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  44:        0x10cb24490 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  45:        0x10cb24fa4 - <rustc_typeck[f85cebba5e32df34]::check::fn_ctxt::FnCtxt>::check_return_expr
  46:        0x10ccf3104 - rustc_typeck[f85cebba5e32df34]::check::check::check_fn
  47:        0x10cc2c118 - <rustc_infer[6d388a7be5ba51cf]::infer::InferCtxtBuilder>::enter::<&rustc_middle[45aced61d2d8c29b]::ty::context::TypeckResults, <rustc_typeck[f85cebba5e32df34]::check::inherited::InheritedBuilder>::enter<rustc_typeck[f85cebba5e32df34]::check::typeck_with_fallback<rustc_typeck[f85cebba5e32df34]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[45aced61d2d8c29b]::ty::context::TypeckResults>::{closure#0}>
  48:        0x10cbe95d8 - rustc_typeck[f85cebba5e32df34]::check::typeck
  49:        0x10d41b560 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::try_execute_query::<rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt, rustc_query_system[6d9035de7c2bf143]::query::caches::DefaultCache<rustc_span[4a73d757271419d3]::def_id::LocalDefId, &rustc_middle[45aced61d2d8c29b]::ty::context::TypeckResults>>
  50:        0x10d4fc0a4 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::get_query::<rustc_query_impl[3c53bdc758f33676]::queries::typeck, rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt>
  51:        0x10cbe99a8 - rustc_typeck[f85cebba5e32df34]::check::typeck
  52:        0x10d41b560 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::try_execute_query::<rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt, rustc_query_system[6d9035de7c2bf143]::query::caches::DefaultCache<rustc_span[4a73d757271419d3]::def_id::LocalDefId, &rustc_middle[45aced61d2d8c29b]::ty::context::TypeckResults>>
  53:        0x10d4fc0a4 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::get_query::<rustc_query_impl[3c53bdc758f33676]::queries::typeck, rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt>
  54:        0x10cc70ea8 - <rustc_middle[45aced61d2d8c29b]::hir::map::Map>::par_body_owners::<rustc_typeck[f85cebba5e32df34]::check::typeck_item_bodies::{closure#0}>
  55:        0x10cbecdcc - rustc_typeck[f85cebba5e32df34]::check::typeck_item_bodies
  56:        0x10d45e088 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::try_execute_query::<rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt, rustc_query_system[6d9035de7c2bf143]::query::caches::DefaultCache<(), ()>>
  57:        0x10d4ca764 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::get_query::<rustc_query_impl[3c53bdc758f33676]::queries::typeck_item_bodies, rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt>
  58:        0x10cbef764 - rustc_typeck[f85cebba5e32df34]::check_crate
  59:        0x10a827ba8 - rustc_interface[ebfef333567d6520]::passes::analysis
  60:        0x10d4538ec - rustc_query_system[6d9035de7c2bf143]::query::plumbing::try_execute_query::<rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt, rustc_query_system[6d9035de7c2bf143]::query::caches::DefaultCache<(), core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>>
  61:        0x10d4fc4f4 - rustc_query_system[6d9035de7c2bf143]::query::plumbing::get_query::<rustc_query_impl[3c53bdc758f33676]::queries::analysis, rustc_query_impl[3c53bdc758f33676]::plumbing::QueryCtxt>
  62:        0x10a743ab0 - <rustc_interface[ebfef333567d6520]::passes::QueryContext>::enter::<rustc_driver[511e453c955ff185]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>
  63:        0x10a70eff8 - <rustc_interface[ebfef333567d6520]::interface::Compiler>::enter::<rustc_driver[511e453c955ff185]::run_compiler::{closure#1}::{closure#2}, core[ced426ff7c2a0c73]::result::Result<core[ced426ff7c2a0c73]::option::Option<rustc_interface[ebfef333567d6520]::queries::Linker>, rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>
  64:        0x10a717ad8 - rustc_span[4a73d757271419d3]::with_source_map::<core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>, rustc_interface[ebfef333567d6520]::interface::create_compiler_and_run<core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>, rustc_driver[511e453c955ff185]::run_compiler::{closure#1}>::{closure#1}>
  65:        0x10a70dea4 - rustc_interface[ebfef333567d6520]::interface::create_compiler_and_run::<core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>, rustc_driver[511e453c955ff185]::run_compiler::{closure#1}>
  66:        0x10a6f40b8 - <scoped_tls[af87e99ea2c8eff7]::ScopedKey<rustc_span[4a73d757271419d3]::SessionGlobals>>::set::<rustc_interface[ebfef333567d6520]::interface::run_compiler<core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>, rustc_driver[511e453c955ff185]::run_compiler::{closure#1}>::{closure#0}, core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>
  67:        0x10a6f2130 - std[e23bf27bba9e92a8]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ebfef333567d6520]::util::run_in_thread_pool_with_globals<rustc_interface[ebfef333567d6520]::interface::run_compiler<core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>, rustc_driver[511e453c955ff185]::run_compiler::{closure#1}>::{closure#0}, core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>::{closure#0}, core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>
  68:        0x10a6ed6b4 - <<std[e23bf27bba9e92a8]::thread::Builder>::spawn_unchecked_<rustc_interface[ebfef333567d6520]::util::run_in_thread_pool_with_globals<rustc_interface[ebfef333567d6520]::interface::run_compiler<core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>, rustc_driver[511e453c955ff185]::run_compiler::{closure#1}>::{closure#0}, core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>::{closure#0}, core[ced426ff7c2a0c73]::result::Result<(), rustc_errors[f4b0e5b914d5bbb1]::ErrorReported>>::{closure#1} as core[ced426ff7c2a0c73]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:        0x1037287c0 - std::sys::unix::thread::Thread::new::thread_start::h3a76c8be5d1971dc
  70:        0x1a29b1240 - __pthread_deallocate

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.61.0-nightly (6a7055661 2022-02-27) running on aarch64-apple-darwin

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck] type-checking `main::{closure#0}`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

@Emilgardis
Copy link
Contributor

searched nightlies: from nightly-2022-01-27 to nightly-2022-01-29
regressed nightly: nightly-2022-01-29
searched commit range: 21b4a9c...e0a55f4
regressed commit: e0e70c0

bisected with cargo-bisect-rustc v0.6.1

Host triple: x86_64-pc-windows-msvc
Reproduce with:

cargo bisect-rustc --regress ice --start 2022-01-27 --end 2022-01-29

@compiler-errors
Copy link
Member

compiler-errors commented Feb 28, 2022

This is fixed by #94438, I think. I will check later.

@matthiaskrgr
Copy link
Member

Yes, not crashing anymore =)

~/.rustup/toolchains/master/bin/rustc 94444.rs
error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
  --> 94444.rs:10:13
   |
10 |             Some(t.into_iter().next().unwrap(), 1)
   |             ^^^^ -----------------------------  - supplied 2 arguments
   |
help: use parentheses to construct a tuple
   |
10 |             Some((t.into_iter().next().unwrap(), 1))
   |                  +                                +

error: aborting due to previous error

For more information about this error, try `rustc --explain E0061`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants