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 while documenting nalgebra #54744

Closed
waywardmonkeys opened this issue Oct 2, 2018 · 5 comments
Closed

Panic while documenting nalgebra #54744

waywardmonkeys opened this issue Oct 2, 2018 · 5 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@waywardmonkeys
Copy link
Contributor

When using the nightly with the bugfix for the problems with typenum, this error happens when trying to document the nalgebra crate:

note: rustc 1.31.0-nightly (de3d640 2018-10-01) running on x86_64-apple-darwin

 Documenting nalgebra v0.16.4 (/Users/bruce/Development/custodian/nalgebra)                                                                                                                                                            
error: internal compiler error: librustc/traits/select.rs:2531: Where clause `Binder(<base::default_allocator::DefaultAllocator as base::allocator::Allocator<_, _>>)` was applicable to `Obligation(predicate=Binder(TraitPredicate(<base::default_allocator::DefaultAllocator as base::allocator::Allocator<_, _, _>>)),depth=3)` but now is not
                                                                                                                                                                                                                                              
thread '<unnamed>' panicked at 'Box<Any>', librustc_errors/lib.rs:599: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: std::panicking::rust_panic_with_hook                                                                                                                                                                                                    
   5: std::panicking::begin_panic                                                                                                                                                                                                             
   6: rustc_errors::Handler::bug                                                                                                                                                                                                              
   7: rustc::util::bug::opt_span_bug_fmt::{{closure}}                                                                                                                                                                                         
   8: rustc::ty::context::tls::with_opt::{{closure}}                                                                                                                                                                                          
   9: rustc::ty::context::tls::with_context_opt                                                                                                                                                                                               
  10: rustc::ty::context::tls::with_opt                                                                                                                                                                                                       
  11: rustc::util::bug::opt_span_bug_fmt                                                                                                                                                                                                      
  12: rustc::util::bug::bug_fmt                                                                                                                                                                                                               
  13: rustc::traits::select::SelectionContext::confirm_candidate                                                                                                                                                                              
  14: rustc::infer::InferCtxt::probe                                                                                                                                                                                                          
  15: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                                                                                 
  16: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                                                                                       
  17: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                                                                                 
  18: rustc::infer::InferCtxt::probe                                                                                                                                                                                                          
  19: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                                                                                     
  20: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                                                                                         
  21: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                                                                             
  22: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                                                                                       
  23: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                                                                                      
  24: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                                                                                 
  25: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                                                                                       
  26: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                                                                                 
  27: rustc::infer::InferCtxt::probe                                                                                                                                                                                                          
  28: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                                                                                 
  29: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                                                                                       
  30: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                                                                                 
  31: rustc::infer::InferCtxt::probe                                                                                                                                                                                                          
  32: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                                                                                 
  33: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                                                                                       
  34: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                                                                                 
  35: rustc::traits::select::SelectionContext::evaluate_obligation_recursively                                                                                                                                                                
  36: rustc::ty::context::tls::with_related_context                                                                                                                                                                                           
  37: rustc::infer::InferCtxtBuilder::enter                                                                                                                                                                                                   
  38: rustc_traits::evaluate_obligation::evaluate_obligation                                                                                                                                                                                  
  39: rustc::ty::query::__query_compute::evaluate_obligation                                                                                                                                                                                  
  40: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::evaluate_obligation<'tcx>>::compute                                                                                               
  41: rustc::dep_graph::graph::DepGraph::with_task_impl                                                                                                                                                                                       
  42: rustc::ty::context::tls::with_related_context                                                                                                                                                                                           
  43: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job                                                                                                                                     
  44: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query                                                                                                                                                
  45: rustc::traits::query::evaluate_obligation::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx>>::evaluate_obligation                                                                                                                         
  46: rustc::ty::context::tls::with_context::{{closure}}                                                                                                                                                                                      
  47: rustdoc::clean::blanket_impl::BlanketImplFinder::get_blanket_impls::{{closure}}                                                                                                                                                         
  48: rustc::ty::trait_def::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::for_each_relevant_impl                                                                                                                                         
  49: rustdoc::clean::blanket_impl::BlanketImplFinder::get_blanket_impls                                                                                                                                                                      
  50: rustdoc::clean::def_ctor::get_def_from_node_id                                                                                                                                                                                          
  51: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> as rustdoc::fold::DocFolder>::fold_item                                                                                                          
  52: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                                                                                         
  53: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                                                                                         
  54: rustdoc::fold::DocFolder::fold_inner_recur                                                                                                                                                                                              
  55: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> as rustdoc::fold::DocFolder>::fold_item                                                                                                          
  56: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                                                                                         
  57: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                                                                                         
  58: rustdoc::fold::DocFolder::fold_inner_recur                                                                                                                                                                                              
  59: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector<'a, 'tcx, 'rcx, 'cstore> as rustdoc::fold::DocFolder>::fold_item                                                                                                          
  60: rustdoc::passes::collect_trait_impls::collect_trait_impls                                                                                                                                                                               
  61: rustdoc::core::run_core::{{closure}}::{{closure}}                                                                                                                                                                                       
  62: rustc::ty::context::tls::enter_context                                                                                                                                                                                                  
  63: <std::thread::local::LocalKey<T>>::with                                                                                                                                                                                                 
  64: rustc::ty::context::TyCtxt::create_and_enter                                                                                                                                                                                            
  65: rustc_driver::driver::phase_3_run_analysis_passes                                                                                                                                                                                       
  66: <scoped_tls::ScopedKey<T>>::set                                                                                                                                                                                                         
  67: rustdoc::core::run_core                                                                                                                                                                                                                 
  68: <scoped_tls::ScopedKey<T>>::set                                                                                                                                                                                                         
  69: syntax::with_globals                                                                                                                                                                                                                    
  70: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once                                                                                                                                                         
  71: std::panicking::try::do_call                                                                                                                                                                                                            
  72: __rust_maybe_catch_panic                                                                                                                                                                                                                
  73: rustc_driver::monitor                                                                                                                                                                                                                   
  74: rustdoc::rust_input                                                                                                                                                                                                                     
  75: rustdoc::main_args                                                                                                                                                                                                                      
  76: <scoped_tls::ScopedKey<T>>::set                                                                                                                                                                                                         
  77: syntax::with_globals                                                                                                                                                                                                                    
  78: std::panicking::try::do_call                                                                                                                                                                                                            
  79: __rust_maybe_catch_panic                                                                                                                                                                                                                
  80: <F as alloc::boxed::FnBox<A>>::call_box                                                                                                                                                                                                 
  81: std::sys_common::thread::start_thread                                                                                                                                                                                                   
  82: std::sys::unix::thread::Thread::new::thread_start                                                                                                                                                                                       
  83: _pthread_body                                                                                                                                                                                                                           
  84: _pthread_start                                                                                                                                                                                                                          
@waywardmonkeys
Copy link
Contributor Author

cc: @sebcrozet FYI

@zackmdavis zackmdavis added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 2, 2018
@memoryruins memoryruins added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 15, 2018
@izzabelle
Copy link

it seemed to document fine for me on the most recent nightly build

Aaron1011 added a commit to Aaron1011/rust that referenced this issue Oct 22, 2018
Fixes rust-lang#55001, rust-lang#54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
pietroalbini added a commit to pietroalbini/rust that referenced this issue Oct 23, 2018
…illaumeGomez

Fix Rustdoc ICE when checking blanket impls

Fixes rust-lang#55001, rust-lang#54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
kennytm added a commit to kennytm/rust that referenced this issue Oct 24, 2018
…illaumeGomez

Fix Rustdoc ICE when checking blanket impls

Fixes rust-lang#55001, rust-lang#54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
kennytm added a commit to kennytm/rust that referenced this issue Oct 26, 2018
…illaumeGomez

Fix Rustdoc ICE when checking blanket impls

Fixes rust-lang#55001, rust-lang#54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
kennytm added a commit to kennytm/rust that referenced this issue Oct 26, 2018
…illaumeGomez

Fix Rustdoc ICE when checking blanket impls

Fixes rust-lang#55001, rust-lang#54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
@Aaron1011
Copy link
Member

This is fixed as of rustdoc 1.31.0-nightly (cae6efc37 2018-10-27)

@steveklabnik
Copy link
Member

Closing then! Thanks! :D

@waywardmonkeys
Copy link
Contributor Author

Will this need backporting at all?

nikomatsakis pushed a commit to nikomatsakis/rust that referenced this issue Nov 20, 2018
Fixes rust-lang#55001, rust-lang#54744

Previously, SelectionContext would unconditionally cache the selection
result for an obligation. This worked fine for most users of
SelectionContext, but it caused an issue when used by Rustdoc's blanket
impl finder.

The issue occured when SelectionContext chose a ParamCandidate which
contained inference variables. Since inference variables can change
between calls to select(), it's not safe to cache the selection result -
the chosen candidate might not be applicable for future results, leading
to an ICE when we try to run confirmation.

This commit prevents SelectionContext from caching any ParamCandidate
that contains inference variables. This should always be completely
safe, as trait selection should never depend on a particular result
being cached.

I've also added some extra debug!() statements, which I found helpful in
tracking down this bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants