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

Panic in pattern analysis #16774

Closed
Jesse-Bakker opened this issue Mar 7, 2024 · 8 comments
Closed

Panic in pattern analysis #16774

Jesse-Bakker opened this issue Mar 7, 2024 · 8 comments
Labels
A-pattern pattern handling related things C-bug Category: bug I-panic

Comments

@Jesse-Bakker
Copy link
Contributor

Jesse-Bakker commented Mar 7, 2024

rust-analyzer version: rust-analyzer 0.0.0 (ce15e73a8e 2024-03-06) (latest commit)

rustc version: rustc 1.76.0 (07dca489a 2024-02-04)

The panic happens inside ra_ap_rustc_pattern_analysis, calling row.head() on an empty row.
CC @Nadrieril

Backtrace
Panic context:
> fetch_native_diagnostics
thread 'Worker' panicked at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:954:18:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0:     0x5fb8d0551366 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x5fb8d0551366 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5fb8d0551366 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x5fb8d0551366 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb235daedd7c6190
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5fb8d0582490 - core::fmt::rt::Argument
::fmt::h76c38a80d925a410
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:     0x5fb8d0582490 - core::fmt::write::h3ed6aeaa977c8e45
       
                        at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6: 
    0x5fb8d054cb4f - std::io::Write::write_fmt::h78b18af5775fedb5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
 
  7:     0x5fb8d0551144 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb
         
                      at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x5fb8d0551144 - std::sys_common::backtrace::
print::h85035a511aafe7a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x5fb8d0552f97 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25
  10:     0x5fb8d0552cf9 - std
::panicking::default_hook::hf5fcb0f213fe709a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:     0x5fb8d04ce024
 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2efdf55e5d11e500
         
                      at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
  12:     0x5fb8d04ce024 - stdx::panic_context::
PanicContext::init::{{closure}}::{{closure}}::h4a896976e0ed3db7
             
                  at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/panic_context.rs:32:17
  13:     0x5fb8d04ce024 - stdx::panic_context::
with_ctx::{{closure}}::h8997c10eaf44557b
                               at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/panic_context.rs:
49:20
  14:     0x5fb8d04ce024 - std::thread::local::LocalKey<T>::try_with::hffb693f9da905bec
 
                              at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/local.rs:270:16
  15:     0x5fb8d04ce024 - std::thread::local::LocalKey<T>::with::h140646dc71fc726d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/local.rs:246:9
  16:     0x5fb8d0553626 - <alloc::boxed::Box<F,A> as core::ops::function::
Fn<Args>>::call::hbc5ccf4eb663e1e5
                               at 
/rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
  17:     0x5fb8d0553626 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee
  
                             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:783:13
  18:     0x5fb8d0553372 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
  19:     0x5fb8d0551866 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  20:    
 0x5fb8d05530d0 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  21:     0x5fb8d057f755 - core::panicking::panic_fmt::h784f20a50eaab275
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  22:     0x5fb8d057f992 - core::panicking::panic_bounds_check::h8331054858f0bf20
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:208:5
  23:     0x5fb8cff0200b - 
<usize as core::slice::index::SliceIndex<[T]>>::index::h66d15440063893a8
      
                         at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/slice/index.rs:255:10
  24:     0x5fb8cff0200b - core::slice::
index::<impl core::ops::index::Index<I> for [T]>::index::h4ee4225b01402a97
   
                            at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/slice/index.rs:18:9
  25:     0x5fb8cff0200b - <smallvec::SmallVec<A> as core::ops::index::Index<I>>::index::h028a23b831a2e371
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.13.1/src/lib.rs
:2030:18
  26:     0x5fb8cff0200b - ra_ap_rustc_pattern_analysis::usefulness::PatStack<Cx>::head::h8eab8a5cdfdafd92
             
                  at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:954:18
  27:     0x5fb8cff0200b - ra_ap_rustc_pattern_analysis::usefulness::MatrixRow<
Cx>::head::hfb234353ae50950a
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1034:19
  28:     0x5fb8cff0200b
 - ra_ap_rustc_pattern_analysis::usefulness::Matrix<Cx>::heads::{{closure}}::hbb6a0e4158115bf1
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1165:31
  29:     0x5fb8cff0200b - core::ops::function::impls::<impl core::ops::function::
FnOnce<A> for &mut F>::call_once::h5ec00a2f00a49549
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:305:13
  30:     0x5fb8cff0200b - core::option::Option<T
>::map::hc42db3c9ccee5156
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:1072:29
  31
:     0x5fb8cff0200b - <core::iter::adapters::map::Map<I,F> as core::
iter::traits::iterator::Iterator>::next::ha0c561c9f8230cdb
          
                     at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/map.rs:104:26
  32:     
0x5fb8cff0200b - <core::iter::adapters::map::Map<I,F> as core::iter::traits::
iterator::Iterator>::next::h6da8fb836dd77ff0
              
                 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/map.rs:104:9
  33:     0x5fb8cff0200b - 
<core::iter::adapters::cloned::Cloned<I> as core::iter::traits::iterator::Iterator>::next::h93aba89e372ff69a
   
                            at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/cloned.rs:40:9
  34: 
    0x5fb8cff0200b - ra_ap_rustc_pattern_analysis::constructor::ConstructorSet<Cx>::split::{{closure}}::hc06b2ee124269949
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/constructor.rs:909:21
  35:     0x5fb8cff0200b - ra_ap_rustc_pattern_analysis::constructor::ConstructorSet<Cx>::split::h41c3c5e43e56c8e0
      
                         at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/constructor.rs:894:5
  36:     0x5fb8cfe717e1 - ra_ap_rustc_pattern_analysis
::usefulness::PlaceInfo<Cx>::split_column_ctors::hf1e14d547fbeca44
                 
              at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:877:29
  37:     0x5fb8cfe717e1 - ra_ap_rustc_pattern_analysis::usefulness::
compute_exhaustiveness_and_usefulness::{{closure}}::hc6776fcd055c7079
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1558
:40
  38:     0x5fb8cfe717e1 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::h7c046c0a59309eb9
         
                      at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1521:1
  39:    
 0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::{{closure}}::{{closure}}::h42716a26f9bc5ce9
    
                           at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1572:13
  40:    
 0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::ensure_sufficient_stack::h0bff5bcdbd08b4ae
                  
             at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:727:5
  41:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::{{
closure}}::hc6776fcd055c7079
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1571:29
  42:    
 0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::h7c046c0a59309eb9
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs
:1521:1
  43:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::{{closure}}::{{closure}
}::h42716a26f9bc5ce9
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1572:13
  44:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::ensure_sufficient_stack::h0bff5bcdbd08b4ae
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:727:5
  45
:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::{{closure}}::hc6776fcd055c7079
                
               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1571:29
  46:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::h7c046c0a59309eb9
         
                      at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1521:1
  47:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::
{{closure}}::{{closure}}::h42716a26f9bc5ce9
                               at 
/home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1572:13
  48:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::ensure_sufficient_stack::h0bff5bcdbd08b4ae
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:727:5
  49:   
  0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::{{closure}}::hc6776fcd055c7079
           
                    at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1571:29
  50:     0x5fb8cfe72728 - ra_ap_rustc_pattern_analysis
::usefulness::compute_exhaustiveness_and_usefulness::h7c046c0a59309eb9
                               at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1521:
1
  51:     0x5fb8cfe70a2a
 - ra_ap_rustc_pattern_analysis::usefulness::compute_match_usefulness::h2e81a6b2f9dc8fbc
             
                  at /home/jesse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ra-ap-rustc_pattern_analysis-0.40.0/src/usefulness.rs:1677:40
  52:     0x5fb8cfccccd4 - hir_ty
::diagnostics::expr::ExprValidator::validate_block::hd2db7cb6989a2e80
                 
              at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/diagnostics/expr.rs:281:32
  53:     0x5fb8cfccccd4 - hir_ty::diagnostics::expr
::ExprValidator::validate_body::hee7650d53357272c
                               at 
/home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/diagnostics/expr.rs:122:21
  54:     0x5fb8cfccccd4 - hir_ty::diagnostics::expr::
BodyValidationDiagnostic::collect::hac4ab1bceea7fd19
                               at /home/jesse/dev/oss/rust-analyzer/crates/hir-ty/src/diagnostics/expr.rs:74:
9
  55:     0x5fb8cfc2c212 - hir
::DefWithBody::diagnostics::h7a4411550dc3587f
                               at /home/jesse/dev/oss/rust-analyzer/crates/hir/src/lib.rs:1797
:27
  56:     0x5fb8cfc214ec
 - hir::ModuleDef::diagnostics::h9cb338ec7b890f58
              
                 at /home/jesse/dev/oss/rust-analyzer/crates/hir/src/lib.rs:390:17
  57:     0x5fb8cfc227af
 - hir::Module::diagnostics::h6734faa7877cdcce
            
                   at /home/jesse/dev/oss/rust-analyzer/crates/hir/src/lib.rs:605:33
  58:     
0x5fb8cfc224dd - hir::Module::diagnostics::h6734faa7877cdcce
              
                 at /home/jesse/dev/oss/rust-analyzer/crates/hir/src/lib.rs:566:25
  59:     0x5fb8cf7a7673 - 
ide_diagnostics::diagnostics::he4d1812acb1ab3ba
                               at /home/jesse/dev/oss/rust-analyzer/crates/ide-diagnostics/src/lib.rs
:329:9
  60:     0x5fb8cf60b013
 - ide::Analysis::diagnostics::{{closure}}::h267fee2c66062d41
       
                        at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:652:27
  61:  
   0x5fb8cf60b013 - ide::Analysis::with_db::{{closure}}::h4530d9130f559d7e
   
                            at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:775:29
  62
:     0x5fb8cf60b013 - std::panicking::try::do_call::hc137145cf160520a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:
552:40
  63:     0x5fb8cf60b013 - std::panicking::try::hbb6f866077113c4a
     
                          at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  64: 
    0x5fb8cf60b013 - std::panic::catch_unwind::h3f8e61a4c2b6a4e4
          
                     at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  65:     
0x5fb8cf60b013 - salsa::Cancelled::catch::h6df7eb997b2e836a
                
               at /home/jesse/dev/oss/rust-analyzer/crates/salsa/src/lib.rs:629:15
  66:     0x5fb8cf6942c5 - ide::
Analysis::with_db::h4401967ca28785c1
                               at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:775:9
  67:     0x5fb8cf5fd7cc - 
ide::Analysis::diagnostics::hbadaa49c2fbc4d8e
                  
             at /home/jesse/dev/oss/rust-analyzer/crates/ide/src/lib.rs:652:9
  68:     0x5fb8cf253623 - 
rust_analyzer::diagnostics::fetch_native_diagnostics::{{closure}}::hf5ff6c9b83c2c19a
            
                   at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs:157:31
  69:     0x5fb8cf253623 - 
core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut
 F>::call_mut::hfb5bbdf548b06a0d
             
                  at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:294:13
  70:     0x5fb8cf141a17 - core
::iter::traits::iterator::Iterator::find_map::check::{{closure}}::h94696d4ffaf9952f
       
                        at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2958:32
  71: 
    0x5fb8cf141a17 - core::iter::adapters::copied::copy_try_fold::{{closure}}::h47d6b3aa5a6fc2d0
 
                              at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/copied.rs:36:22
  72:     0x5fb8cf141a17 - core::iter::traits::iterator::Iterator::try_fold::h7d5d35cb8c6df314
   
                            at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2462:21
  
73:     0x5fb8cf141a17 - <core::iter::adapters::copied::Copied<I> as 
core::iter::traits::iterator::Iterator>::try_fold::h81f9c1037ae2c59a
       
                        at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/copied.rs:70:9
  74:     0x5fb8cf141a17 - core::iter::traits::iterator
::Iterator::find_map::h6e8990d3c089492d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2964:9
  
75:     0x5fb8cf141a17 - <core::iter::adapters::filter_map::FilterMap<I,F> as core::iter
::traits::iterator::Iterator>::next::h6a55146bd8035164
            
                   at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/adapters/filter_map.rs:63:9
  76:     
0x5fb8cf141a17 - <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::hed0a194dd4a9c2e1
    
                           at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/spec_from_iter_nested.rs:26:32
  77:  
   0x5fb8cf141a17 - <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T
,I>>::from_iter::h1e40a3d6eb95ba4b
              
                 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/spec_from_iter.rs:33:9
  78:     0x5fb8cf2e12c2 - <alloc::vec::Vec<
T> as core::iter::traits::collect::FromIterator<T>>::from_iter::h5a47058b2a93d9a6
   
                            at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/vec/mod.rs:2791:9
 
 79:     0x5fb8cf2e12c2 - core::iter::traits::iterator::Iterator::collect::h80499f96322fa86a
     
                          at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/iter/traits/iterator.rs:2054:9
  80: 
    0x5fb8cf2e12c2 - rust_analyzer::diagnostics::fetch_native_diagnostics::hf84832a501a147b1
           
                    at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/diagnostics.rs:152:27
  81:     0x5fb8cf33fe7d - 
rust_analyzer::main_loop::<impl rust_analyzer::global_state::GlobalState>::update_diagnostics::{{closure}}::h60b14bc62b34a89f
                               at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/main_loop.rs:511:39
  
82:     0x5fb8cf33fe7d - rust_analyzer::task_pool::TaskPool<T>::spawn::{{closure}}
::h82f3c00bf4ce6acc
                               at /home/jesse/dev/oss/rust-analyzer/crates/rust-analyzer/src/task_pool.rs:
26:33
  83:     0x5fb8cf33fe7d - stdx::thread::pool::Pool::
spawn::{{closure}}::ha19c5b24d5c9266d
           
                    at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/thread/pool.rs:82:13
  84:     0x
5fb8cf33fe7d - core::ops::function::FnOnce::call_once{{vtable.shim}}::haaa67dc5ec33554e
          
                     at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  85:     0x5fb8d04c8216 - <alloc
::boxed::Box<F,A> as core::ops::function::FnOnce<Args
>>::call_once::h1e06e9ec27a44305
               
                at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
  86:     0x5fb8d04c8216 - stdx
::thread::pool::Pool::new::{{closure}}::h2ce16c3d197219d5
         
                      at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/thread/pool.rs:61:29
  87:   
  0x5fb8d04c8216 - stdx::thread::Builder::spawn::{{closure}}::h127afa68e6998269
   
                            at /home/jesse/dev/oss/rust-analyzer/crates/stdx/src/thread.rs:66:13
  
88:     0x5fb8d04c8216 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0be81a1552f39324
          
                     at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
  89:     0x5fb8d04d0859 - 
std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::ha3316839910111c4
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:
529:17
  90:     0x5fb8d04d0859 - <core::panic::unwind_safe::AssertUnwindSafe<F
> as core::ops::function::FnOnce<()>>::call_once::hd871ea900dc266f2
   
                            at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panic/unwind_safe.rs:272:9
 
 91:     0x5fb8d04d0859 - std::panicking::try::do_call::he3be10e6d1d7f1f2
     
                          at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  92
:     0x5fb8d04d0859 - std::panicking::try::h8d750b6b6a1c2f0f
         
                      at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  93:     0x5fb8d04d0859 - std::panic
::catch_unwind::h73f10e3b705841a0
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  94:     0x5fb8d04d0859 - std::thread::Builder::spawn_unchecked_::{{closure}}::h10701b680b31587f
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/mod.rs:528
:30
  95:     0x5fb8d04d0859 - core::ops::function::FnOnce::call_once
{{vtable.shim}}::hf15aec3d962d4072
              
                 at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  96:     0x5fb8d05596c5 - <
alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>
>::call_once::h12de4fc57affb195
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs
:2015:9
  97:     0x5fb8d05596c5 - <alloc::boxed::Box<F,A> as 
core::ops::function::FnOnce<Args>>::call_once::h3c619f45059d5cf1
      
                         at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
  98: 
    0x5fb8d05596c5 - std::sys::unix::thread::Thread::new::thread_start::hbac657605e4b7389
   
                            at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys/unix/thread.rs:108:17
  99:     0x7fd20e9d255a - <unknown>
 100:     0x7fd20ea4fa3c - <unknown>
 101:      
          0x0 - <unknown>

Unfortunately, I don't have a public or small reproducer 😞

@Jesse-Bakker Jesse-Bakker added the C-bug Category: bug label Mar 7, 2024
@Veykril Veykril added I-panic A-pattern pattern handling related things labels Mar 7, 2024
@Nadrieril
Copy link
Member

Sounds like #16746! A fix is on its way :)

@Jesse-Bakker
Copy link
Contributor Author

Sorry, I looked at that issue and thought that "Fix in about a week" meant that the fix was already in RA, but it's not released as a stable RA version (and because I used the latest RA commit, that meant that I should have that fix already). I guess this means that it will be fixed when RA is next synced with rustc? In the meantime, I may use a local build with a git-dep on ra_ap_rustc_pattern_analysis from rustc.

Thanks for the reply and all your work on the pattern checking!

@lnicola
Copy link
Member

lnicola commented Mar 7, 2024

"Fixed on the rustc side" means it's in a crate in the rustc repo. That crate gets published on Sunday, but we currently upgrade it manually.

@Nadrieril
Copy link
Member

If you try the manual dep on rustc_pattern_analysis let me know if that fixes the problem because I haven't actually tested 😇

@lnicola
Copy link
Member

lnicola commented Mar 7, 2024

That will require updating ctor_sub_tys to match https://github.com/rust-lang/rust/blob/be31b6b6cdfd0d614a22214391b91070fe55d89e/compiler/rustc_pattern_analysis/src/rustc.rs#L194 because the return type has changed.

@Nadrieril
Copy link
Member

Could we actually trigger an early auto-publish? Lotsa people seem to be hitting this. Idk what the policy is

@lnicola
Copy link
Member

lnicola commented Mar 7, 2024

I just did, but the change to ctor_sub_tys predates the fix for this issue, and we haven't upgraded yet.

@Nadrieril
Copy link
Member

Thank you! The ctor_sub_tys change was a tricky one I had to do myself. Done now, #16778 hopefully fixes this (or reveals yet another panic x))

bors added a commit that referenced this issue Mar 7, 2024
Update `rustc_pattern_analysis` to 0.42.0

There was an important API change in 0.41.0, and (hopefully) a fix for #16774 in 0.42.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pattern pattern handling related things C-bug Category: bug I-panic
Projects
None yet
Development

No branches or pull requests

4 participants