Skip to content

running "cargo doc" causes the compiler to panic #55583

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

Closed
nicklaswj opened this issue Nov 1, 2018 · 5 comments
Closed

running "cargo doc" causes the compiler to panic #55583

nicklaswj opened this issue Nov 1, 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

@nicklaswj
Copy link

When I run cargo doc in one of my crates (that I unfortunately can't show you) the compiler panics
at a seemingly random dependency, i.e. it changes from run to run.
I use rust stable:

rustc 1.30.0 (da5f414c2 2018-10-24)
binary: rustc
commit-hash: da5f414c2c0bfe5198934493f04c676e2b23ff2e
commit-date: 2018-10-24
host: x86_64-unknown-linux-gnu
release: 1.30.0
LLVM version: 8.0

This is the full output of "cargo doc":

$ RUST_BACKTRACE=1 cargo doc                                                                                                                                             101 ↵
 Documenting bytes v0.4.10                                                                                                                                                       
    Checking uuid v0.6.5                                                                                                                                                         
    Checking rand v0.3.22                                                                                                                                                        
 Documenting futures-cpupool v0.1.8                                                                                                                                              
 Documenting uuid v0.6.5                                                                                                                                                         
 Documenting rand v0.3.22                                                                                                                                                        
 Documenting resolv-conf v0.6.1                                                                                                                                                  
 Documenting msdos_time v0.1.6                                                                                                                                                   
 Documenting mio v0.6.15                                                                                                                                                         
 Documenting num-traits v0.2.6                                                                                                                                                   
 Documenting typenum v1.10.0                                                                                                                                                     
    Checking tokio-timer v0.2.6                                                                                                                                                  
    Checking tokio-current-thread v0.1.3                                                                                                                                         
error: internal compiler error: librustc/traits/structural_impls.rs:178: impossible case reached                                                                                 
                                                                                                                                                                                 
thread '<unnamed>' panicked at 'Box<Any>', librustc_errors/lib.rs:587:9                                                                                                          
 Documenting tokio-timer v0.2.6                                                                                                                                                  
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: std::panicking::rust_panic_with_hook                                                                                                                                       
             at libstd/panicking.rs:477                                                                                                                                          
   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::structural_impls::<impl rustc::ty::context::Lift<'tcx> for rustc::traits::SelectionError<'a>>::lift_to_tcx                                                  
  14: rustc::ty::context::TyCtxt::lift_to_global                                                                                                                                 
  15: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  16: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  17: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  18: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  19: rustc::infer::InferCtxt::probe                                                                                                                                             
  20: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  21: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  22: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  23: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  24: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  25: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  26: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  27: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  28: rustc::infer::InferCtxt::probe                                                                                                                                             
  29: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  30: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  31: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  32: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  33: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  34: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  35: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  36: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  37: rustc::infer::InferCtxt::probe                                                                                                                                             
  38: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  39: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  40: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  41: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  42: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  43: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  44: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  45: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  46: rustc::infer::InferCtxt::probe                                                                                                                                             
  47: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  48: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  49: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  50: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  51: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  52: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  53: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  54: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  55: rustc::infer::InferCtxt::probe                                                                                                                                             
  56: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  57: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  58: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  59: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  60: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  61: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  62: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  63: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  64: rustc::infer::InferCtxt::probe                                                                                                                                             
  65: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  66: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  67: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  68: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  69: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  70: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  71: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  72: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  73: rustc::infer::InferCtxt::probe                                                                                                                                             
  74: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  75: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  76: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  77: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  78: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  79: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  80: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  81: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  82: rustc::infer::InferCtxt::probe                                                                                                                                             
  83: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  84: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  85: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  86: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  87: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  88: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  89: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  90: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
  91: rustc::infer::InferCtxt::probe                                                                                                                                             
  92: <&'a mut I as core::iter::iterator::Iterator>::next                                                                                                                        
  93: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter                                                                                                            
  94: rustc::traits::select::SelectionContext::candidate_from_obligation_no_cache                                                                                                
  95: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  96: rustc::traits::select::SelectionContext::candidate_from_obligation                                                                                                         
  97: rustc::traits::select::SelectionContext::evaluate_stack                                                                                                                    
  98: rustc::dep_graph::graph::DepGraph::with_anon_task                                                                                                                          
  99: rustc::traits::select::SelectionContext::evaluate_predicate_recursively                                                                                                    
 Documenting tokio-current-thread v0.1.3                                                                                                                                         
                                                                                                                                                                                 
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.30.0 (da5f414c2 2018-10-24) running on x86_64-unknown-linux-gnu                                                                                                    
                                                                                                                                                                                 
error: Could not document `typenum`.                                                                                                                                             

Caused by:
  process didn't exit successfully: `rustdoc --crate-name typenum /home/nicklas/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/typenum-1.10.0/src/lib.rs --cap-lints allow --color always -o /home/nicklas/Documents/work/CMP/code/cmp_dem/target/doc -L dependency=/home/nicklas/Documents/work/CMP/code/cmp_dem/target/debug/deps` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed 
@steveklabnik
Copy link
Member

Can you try on nightly? We recently fixed a rustdoc ICE, I wonder if it's similar.

@nicklaswj
Copy link
Author

I've deleted my last two comments... I'm running nightly now, hang on ;)

@nicklaswj
Copy link
Author

nicklaswj commented Nov 1, 2018

Nightly doesn't panic, however I'm hitting another error where the Diesel documentation won't compile.
I don't know if it's unrelated error but I'm attaching it here just in case.
error.txt

Edit: It looks like nightly works, and I'm hitting a bug in the diesel crate instead, right?

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

The issue appears to be caused by Rustdoc not handling overflow during projections. I believe we need to extend #54199 to cover all cases of overflows during selection.

@pietroalbini
Copy link
Member

Duplicate of #52873

@pietroalbini pietroalbini marked this as a duplicate of #52873 Nov 4, 2018
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

4 participants