Skip to content

specialization error #55543

Closed
Closed
@chills42

Description

@chills42

When trying to run the example code for the pyo3 library on mac I've been running into an error with specialization.

binary: rustc
commit-hash: d586d5d2f51489821b471f20959333558c24b129
commit-date: 2018-10-29
host: x86_64-apple-darwin
release: 1.31.0-nightly
LLVM version: 8.0
cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup
   Compiling pyo3 v0.4.1                                                                                                                                                      
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                                                                                                            
note: Run with `RUST_BACKTRACE=1` for a backtrace.                                                                                                                            
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 (d586d5d2f 2018-10-29) running on x86_64-apple-darwin                                                                                              
                                                                                                                                                                              
note: compiler flags: -C opt-level=3 --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.
craighills@chills-macbook:~/code/pyo3test|master⚡ 
⇒  RUST_BACKTRACE=1 cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup
   Compiling pyo3 v0.4.1                                                                                                                                                      
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                                                                                                               
   1: std::sys_common::backtrace::_print                                                                                                                                      
   2: std::panicking::default_hook::{{closure}}                                                                                                                               
   3: std::panicking::default_hook                                                                                                                                            
   4: rustc::util::common::panic_hook                                                                                                                                         
   5: std::panicking::rust_panic_with_hook                                                                                                                                    
   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::dep_graph::graph::DepGraph::with_task_impl                                                                                                                       
  28: rustc::ty::context::tls::with_related_context                                                                                                                           
  29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                     
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                                
  31: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_built                                                                                          
  32: rustc_mir::transform::check_unsafety::unsafety_check_result                                                                                                             
  33: rustc::ty::query::__query_compute::unsafety_check_result                                                                                                                
  34: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::unsafety_check_result<'tcx>>::compute                             
  35: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                       
  36: rustc::ty::context::tls::with_related_context                                                                                                                           
  37: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                     
  38: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                                
  39: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::unsafety_check_result                                                                              
  40: rustc_mir::transform::mir_const                                                                                                                                         
  41: rustc::ty::query::__query_compute::mir_const                                                                                                                            
  42: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_const<'tcx>>::compute                                         
  43: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                       
  44: rustc::ty::context::tls::with_related_context                                                                                                                           
  45: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                     
  46: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                                
  47: rustc::ty::query::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::mir_const                                                                                          
  48: rustc_mir::transform::mir_validated                                                                                                                                     
  49: rustc::ty::query::__query_compute::mir_validated                                                                                                                        
  50: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::mir_validated<'tcx>>::compute                                     
  51: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                       
  52: rustc::ty::context::tls::with_related_context                                                                                                                           
  53: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                     
  54: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                                
  55: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query                                                                             
  56: rustc_borrowck::borrowck::borrowck                                                                                                                                      
  57: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::borrowck<'tcx>>::compute                                          
  58: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                       
  59: rustc::ty::context::tls::with_related_context                                                                                                                           
  60: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                     
  61: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                                
  62: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::par_body_owners                                                                                           
  63: rustc_borrowck::borrowck::check_crate                                                                                                                                   
  64: rustc::util::common::time                                                                                                                                               
  65: rustc::ty::context::tls::enter_context                                                                                                                                  
  66: <std::thread::local::LocalKey<T>>::with                                                                                                                                 
  67: rustc::ty::context::TyCtxt::create_and_enter                                                                                                                            
  68: rustc_driver::driver::compile_input                                                                                                                                     
  69: rustc_driver::run_compiler_with_pool                                                                                                                                    
  70: rustc_driver::driver::spawn_thread_pool                                                                                                                                 
  71: rustc_driver::run_compiler                                                                                                                                              
  72: <scoped_tls::ScopedKey<T>>::set                                                                                                                                         
  73: syntax::with_globals                                                                                                                                                    
  74: __rust_maybe_catch_panic                                                                                                                                                
  75: rustc_driver::run                                                                                                                                                       
  76: rustc_driver::main                                                                                                                                                      
  77: std::rt::lang_start::{{closure}}                                                                                                                                        
  78: std::panicking::try::do_call                                                                                                                                            
  79: __rust_maybe_catch_panic                                                                                                                                                
  80: std::rt::lang_start_internal                                                                                                                                            
  81: main                                                                                                                                                                    
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 (d586d5d2f 2018-10-29) running on x86_64-apple-darwin                                                                                              
                                                                                                                                                                              
note: compiler flags: -C opt-level=3 --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

No one assigned

    Labels

    A-specializationArea: Trait impl specializationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions