Skip to content

ICE with pyo3 on 1.31.0 nightly  #55380

Closed
@konstin

Description

@konstin

Pyo3 used to compile on 1.30 nightly, but is now failing with an ICE on 1.31

git clone https://github.com/pyo3/pyo3
git checkout b90d45d7e71de4fbb4d48083d64c47ba2735e5c7
cargo build
   Compiling pyo3 v0.5.0-alpha.1 (/home/konsti/pyo3)                                                                                                                         
error: internal compiler error: librustc/traits/specialize/mod.rs:104: When translating substitutions for specialization, the expected specialization failed to hold         
                                                                                                                                                                             
thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:600:9                                                                                                           
stack backtrace:                                                                                                                                                             
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace                                                                                                              
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49                                                                                                                
   1: std::sys_common::backtrace::print                                                                                                                                      
             at libstd/sys_common/backtrace.rs:71                                                                                                                            
             at libstd/sys_common/backtrace.rs:59                                                                                                                            
   2: std::panicking::default_hook::{{closure}}                                                                                                                              
             at libstd/panicking.rs:211                                                                                                                                      
   3: std::panicking::default_hook                                                                                                                                           
             at libstd/panicking.rs:227                                                                                                                                      
   4: rustc::util::common::panic_hook                                                                                                                                        
   5: std::panicking::rust_panic_with_hook                                                                                                                                   
             at libstd/panicking.rs:480                                                                                                                                      
   6: std::panicking::begin_panic                                                                                                                                            
   7: rustc_errors::Handler::bug                                                                                                                                             
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}                                                                                                                        
   9: rustc::ty::context::tls::with_opt::{{closure}}                                                                                                                         
  10: rustc::ty::context::tls::with_context_opt                                                                                                                              
  11: rustc::ty::context::tls::with_opt                                                                                                                                      
  12: rustc::util::bug::opt_span_bug_fmt                                                                                                                                     
  13: rustc::util::bug::bug_fmt                                                                                                                                              
  14: rustc::traits::specialize::translate_substs::{{closure}}                                                                                                               
  15: rustc::traits::specialize::translate_substs                                                                                                                            
  16: rustc::ty::context::tls::with_related_context                                                                                                                          
  17: rustc::infer::InferCtxtBuilder::enter                                                                                                                                  
  18: rustc::traits::specialize::find_associated_item                                                                                                                        
  19: rustc::ty::instance::Instance::resolve                                                                                                                                 
  20: rustc_mir::lints::check                                                                                                                                                
  21: rustc::ty::context::tls::with_related_context                                                                                                                          
  22: rustc::infer::InferCtxtBuilder::enter                                                                                                                                  
  23: rustc_mir::build::mir_build                                                                                                                                            
  24: rustc_mir::transform::mir_built                                                                                                                                        
  25: rustc::ty::query::__query_compute::mir_built                                                                                                                           
  26: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_built<'tcx>>::compute                                        
  27: rustc::ty::context::tls::with_context                                                                                                                                  
  28: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                      
  29: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start                                                                                                             
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                    
  31: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                               
  32: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_built                                                                                         
  33: rustc_mir::transform::check_unsafety::unsafety_check_result                                                                                                            
  34: rustc::ty::query::__query_compute::unsafety_check_result                                                                                                               
  35: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::unsafety_check_result<'tcx>>::compute                            
  36: rustc::ty::context::tls::with_context                                                                                                                                  
  37: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                      
  38: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start                                                                                                             
  39: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                    
  40: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                               
  41: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::unsafety_check_result                                                                             
  42: rustc_mir::transform::mir_const                                                                                                                                        
  43: rustc::ty::query::__query_compute::mir_const                                                                                                                           
  44: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_const<'tcx>>::compute                                        
  45: rustc::ty::context::tls::with_context                                                                                                                                  
  46: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                      
  47: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start                                                                                                             
  48: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                    
  49: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                               
  50: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_const                                                                                         
  51: rustc_mir::transform::mir_validated                                                                                                                                    
  52: rustc::ty::query::__query_compute::mir_validated                                                                                                                       
  53: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_validated<'tcx>>::compute                                    
  54: rustc::ty::context::tls::with_context                                                                                                                                  
  55: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                      
  56: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start                                                                                                             
  57: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                    
  58: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                               
  59: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query                                                                            
  60: rustc_borrowck::borrowck::borrowck                                                                                                                                     
  61: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::borrowck<'tcx>>::compute                                         
  62: rustc::ty::context::tls::with_context                                                                                                                                  
  63: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                      
  64: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start                                                                                                             
  65: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                    
  66: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                               
  67: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners                                                                                          
  68: rustc_borrowck::borrowck::check_crate                                                                                                                                  
  69: rustc::util::common::time                                                                                                                                              
  70: rustc::ty::context::tls::enter_context                                                                                                                                 
  71: <std::thread::local::LocalKey<T>>::with                                                                                                                                
  72: rustc::ty::context::TyCtxt::create_and_enter                                                                                                                           
  73: rustc_driver::driver::compile_input                                                                                                                                    
  74: rustc_driver::run_compiler_with_pool                                                                                                                                   
  75: rustc_driver::driver::spawn_thread_pool                                                                                                                                
  76: rustc_driver::run_compiler                                                                                                                                             
  77: <scoped_tls::ScopedKey<T>>::set                                                                                                                                        
  78: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once                                                                                        
  79: __rust_maybe_catch_panic                                                                                                                                               
             at libpanic_unwind/lib.rs:102                                                                                                                                   
  80: rustc_driver::run                                                                                                                                                      
  81: rustc_driver::main                                                                                                                                                     
  82: std::rt::lang_start::{{closure}}                                                                                                                                       
  83: std::panicking::try::do_call                                                                                                                                           
             at libstd/rt.rs:59                                                                                                                                              
             at libstd/panicking.rs:310                                                                                                                                      
  84: __rust_maybe_catch_panic                                                                                                                                               
             at libpanic_unwind/lib.rs:102                                                                                                                                   
  85: std::rt::lang_start_internal                                                                                                                                           
             at libstd/panicking.rs:289                                                                                                                                      
             at libstd/panic.rs:392                                                                                                                                          
             at libstd/rt.rs:58                                                                                                                                              
  86: main                                                                                                                                                                   
  87: __libc_start_main                                                                                                                                                      
  88: <unknown>                                                                                                                                                              
query stack during panic:                                                                                                                                                    
#0 [mir_built] processing `freelist::<impl typeob::PyObjectAlloc<T> for T>::dealloc`                                                                                         
#1 [unsafety_check_result] processing `freelist::<impl typeob::PyObjectAlloc<T> for T>::dealloc`                                                                             
#2 [mir_const] processing `freelist::<impl typeob::PyObjectAlloc<T> for T>::dealloc`                                                                                         
#3 [mir_validated] processing `freelist::<impl typeob::PyObjectAlloc<T> for T>::dealloc`                                                                                     
#4 [borrowck] processing `freelist::<impl typeob::PyObjectAlloc<T> for T>::dealloc`                                                                                          
end of query stack                                                                                                                                                           
error: aborting due to previous error                                                                                                                                        
                                                                                                                                                                             
                                                                                                                                                                             
note: the compiler unexpectedly panicked. this is a bug.                                                                                                                     
                                                                                                                                                                             
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports                                                            
                                                                                                                                                                             
note: rustc 1.31.0-nightly (4bd4e4130 2018-10-25) running on x86_64-unknown-linux-gnu                                                                                        
                                                                                                                                                                             
note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib                                                                                                         
                                                                                                                                                                             
note: some of the compiler flags provided by cargo are hidden                                                                                                                
                                                                                                                                                                             
error: Could not compile `pyo3`.                                                                                                                                             

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

Labels

A-specializationArea: Trait impl specializationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions