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: feature(let_chains) #82073

Closed
mareq opened this issue Feb 13, 2021 · 2 comments
Closed

Compiler panic: feature(let_chains) #82073

mareq opened this issue Feb 13, 2021 · 2 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-let_chains `#![feature(let_chains)]` 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

@mareq
Copy link

mareq commented Feb 13, 2021

Code

#![feature(let_chains)]
...snip...
use sqlx::PgPool;
...snip...
#[async_std::main]
async fn main() -> tide::Result<()> {
...snip...
    if let Some(_) = postgres_reset && let Some(connected_postgres) = postgres {
        reset_postgres(connected_postgres)?;
    }
...snip...
    Ok(())
}

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.52.0-nightly (3f5aee2d5 2021-02-12)
binary: rustc
commit-hash: 3f5aee2d5241139d808f4fdece0026603489afd1
commit-date: 2021-02-12
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 11.0.1

Error output

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.52.0-nightly (3f5aee2d5 2021-02-12) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
end of query stack
Backtrace

   0:     0x7fdf8633ec70 - std::backtrace_rs::backtrace::libunwind::trace::hb4de9797f80b7b8c
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fdf8633ec70 - std::backtrace_rs::backtrace::trace_unsynchronized::h59566d0bd20efff7
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fdf8633ec70 - std::sys_common::backtrace::_print_fmt::hcfa5ce6be50275d4
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fdf8633ec70 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd8c307a38b9bab04
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fdf863afeec - core::fmt::write::h3868db8542c90941
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/core/src/fmt/mod.rs:1096:17
   5:     0x7fdf86331ba2 - std::io::Write::write_fmt::hab90295d5a0f197d
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/io/mod.rs:1568:15
   6:     0x7fdf86342b55 - std::sys_common::backtrace::_print::h19224910b8700cf1
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fdf86342b55 - std::sys_common::backtrace::print::h25dedfa68c5fb84a
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fdf86342b55 - std::panicking::default_hook::{{closure}}::h12c5765653a72a42
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/panicking.rs:208:50
   9:     0x7fdf863426b3 - std::panicking::default_hook::he65cee71c4209f0c
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/panicking.rs:225:9
  10:     0x7fdf86b9d52b - rustc_driver::report_ice::h9bfcf5769c15fbf2
  11:     0x7fdf74b3a866 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf172061590dc818b
                               at /home/mareq/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1562:9
  12:     0x7fdf74b3b689 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h66eefe9f42ea6bce
                               at /home/mareq/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7fdf86343456 - std::panicking::rust_panic_with_hook::h01a674d863fe0d8a
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/panicking.rs:595:17
  14:     0x7fdf86342f77 - std::panicking::begin_panic_handler::{{closure}}::h9b9fecf185178864
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/panicking.rs:497:13
  15:     0x7fdf8633f10c - std::sys_common::backtrace::__rust_end_short_backtrace::h57be46a42dc7f24b
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7fdf86342ed9 - rust_begin_unwind
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/panicking.rs:493:5
  17:     0x7fdf86342e8b - std::panicking::begin_panic_fmt::h12277576db89392f
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/panicking.rs:435:5
  18:     0x7fdf88772b7e - rustc_ast_lowering::LoweringContext::lower_node_id_generic::hf147b46663c9016c
  19:     0x7fdf8876d533 - rustc_ast_lowering::path::<impl rustc_ast_lowering::LoweringContext>::lower_qpath::h090d8042e0bdcfdb
  20:     0x7fdf88780aa4 - rustc_data_structures::stack::ensure_sufficient_stack::h1eb7da3bdd0230e9
  21:     0x7fdf8878579a - <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend::h8e377630664dfc33
  22:     0x7fdf8876578f - rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_exprs::h11a1b46cd3c20941
  23:     0x7fdf88780d07 - rustc_data_structures::stack::ensure_sufficient_stack::h1eb7da3bdd0230e9
  24:     0x7fdf89336589 - rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_expr_try::ha12737f8f3ca90fd
  25:     0x7fdf887815f7 - rustc_data_structures::stack::ensure_sufficient_stack::h1eb7da3bdd0230e9
  26:     0x7fdf8877a1fb - rustc_ast_lowering::LoweringContext::lower_stmt::h5d21732a1ccddea4
  27:     0x7fdf88764aba - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::he04b241b1704b110
  28:     0x7fdf887846a9 - <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next::h7d1cf3a16151d387
  29:     0x7fdf88785b13 - <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend::h8e7828aaac813db9
  30:     0x7fdf8877c246 - rustc_arena::cold_path::h62f5e8b09cf18d4e
  31:     0x7fdf8932fc78 - rustc_ast_lowering::expr::<impl rustc_ast_lowering::LoweringContext>::lower_expr_if::hb12cdca7d720af72
  32:     0x7fdf8878145f - rustc_data_structures::stack::ensure_sufficient_stack::h1eb7da3bdd0230e9
  33:     0x7fdf8877a6dd - rustc_ast_lowering::LoweringContext::lower_stmt::h5d21732a1ccddea4
  34:     0x7fdf88764aba - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::he04b241b1704b110
  35:     0x7fdf887846a9 - <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next::h7d1cf3a16151d387
  36:     0x7fdf88785b13 - <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend::h8e7828aaac813db9
  37:     0x7fdf8877c246 - rustc_arena::cold_path::h62f5e8b09cf18d4e
  38:     0x7fdf88779f8e - rustc_ast_lowering::LoweringContext::lower_block::h971d1d3737ccc357
  39:     0x7fdf887811d2 - rustc_data_structures::stack::ensure_sufficient_stack::h1eb7da3bdd0230e9
  40:     0x7fdf88764a50 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::he04b241b1704b110
  41:     0x7fdf887846a9 - <core::iter::adapters::flatten::Flatten<I> as core::iter::traits::iterator::Iterator>::next::h7d1cf3a16151d387
  42:     0x7fdf88785b13 - <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend::h8e7828aaac813db9
  43:     0x7fdf8877c246 - rustc_arena::cold_path::h62f5e8b09cf18d4e
  44:     0x7fdf8876a6a8 - rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_maybe_async_body::hfbc5687fa6ebc7e1
  45:     0x7fdf8876735e - rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::lower_item::h8213f479c0798312
  46:     0x7fdf887743d5 - rustc_ast_lowering::LoweringContext::with_hir_id_owner::h716ec6a273281522
  47:     0x7fdf887919e6 - rustc_ast::visit::walk_stmt::hcd16e9255f4285fa
  48:     0x7fdf8878c666 - rustc_ast::visit::walk_fn::h49a1efb3d179bf03
  49:     0x7fdf8878f5e2 - rustc_ast::visit::walk_item::h8f8574c432a26e18
  50:     0x7fdf88765f29 - rustc_ast_lowering::item::<impl rustc_ast_lowering::LoweringContext>::with_parent_item_lifetime_defs::hf3a1308574c37413
  51:     0x7fdf8877f1dc - <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_mod::h4d4c359e05d8ecf3
  52:     0x7fdf887700f6 - rustc_ast_lowering::lower_crate::h044777afc0a38ccc
  53:     0x7fdf88f35e9f - rustc_interface::passes::BoxedResolver::access::{{closure}}::had62fd3aa3635716
  54:     0x7fdf88f20f84 - rustc_interface::passes::configure_and_expand::{{closure}}::hf2412f09eb5bc869
  55:     0x7fdf88f2fb1e - rustc_interface::queries::Queries::lower_to_hir::h01de47237772b802
  56:     0x7fdf88f32cee - rustc_interface::queries::Queries::global_ctxt::h1dd84911e01ce7e5
  57:     0x7fdf88ec87c7 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h2ac7000621882a7f
  58:     0x7fdf88ec1391 - rustc_span::with_source_map::h9c33ff8439fe9783
  59:     0x7fdf88ec80b3 - scoped_tls::ScopedKey<T>::set::h0eb8893a0191dbc1
  60:     0x7fdf88ec9ac8 - std::sys_common::backtrace::__rust_begin_short_backtrace::hccc56e59b0e3233c
  61:     0x7fdf88ea819a - core::ops::function::FnOnce::call_once{{vtable.shim}}::h09f6484b7e2514ef
  62:     0x7fdf86353dda - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h321523073ee11258
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/alloc/src/boxed.rs:1548:9
  63:     0x7fdf86353dda - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf0e85e12c83b99b3
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/alloc/src/boxed.rs:1548:9
  64:     0x7fdf86353dda - std::sys::unix::thread::Thread::new::thread_start::hba22c7961aa0e2f8
                               at /rustc/3f5aee2d5241139d808f4fdece0026603489afd1/library/std/src/sys/unix/thread.rs:71:17
  65:     0x7fdf86261fb7 - start_thread
  66:     0x7fdf861812cf - __clone
  67:                0x0 - <unknown>

@mareq mareq 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 13, 2021
@jyn514 jyn514 added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Feb 13, 2021
@jonas-schievink jonas-schievink added the F-let_chains `#![feature(let_chains)]` label Feb 13, 2021
@fanninpm
Copy link

fanninpm commented Feb 19, 2021

@jyn514 Minimization:

#![feature(let_chains)]
#[async_std::main]
async fn main() -> Result<()> {
    if let Some(_) = 2 && let Some(sixteen) = 16 {
        isize::from_str_radix("A", sixteen)?;
    }
    Ok(())
}

Playground link

fanninpm added a commit to fanninpm/glacier that referenced this issue Feb 20, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 20, 2021

Even smaller:

#![feature(let_chains)]
fn main() {
    if let Some(_) = 2 && let Some(sixteen) = 16 {
        let _ = sixteen;
    }
}

Which means this is a duplicate of #82290 and #82250.

@jyn514 jyn514 closed this as completed Feb 20, 2021
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. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example F-let_chains `#![feature(let_chains)]` 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

4 participants