Skip to content

ICE: broken MIR in DefId #55241

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Robbepop opened this issue Oct 21, 2018 · 9 comments · Fixed by #55323
Closed

ICE: broken MIR in DefId #55241

Robbepop opened this issue Oct 21, 2018 · 9 comments · Fixed by #55323
Assignees
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-NLL Area: Non-lexical lifetimes (NLL) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Robbepop
Copy link
Contributor

Robbepop commented Oct 21, 2018

When compiling paritytech/parity-common workspace using cargo test --features std.

As far as the error shows it has something to do with the patricia_trie sub crate.

Compiler output:

error: internal compiler error: broken MIR in DefId(0/0:377 ~ patricia_trie[2708]::Trie[0]::is_empty[0]) (NoSolution): failed to normalize `<_ as hashdb::Hasher>::Out`                                                                                       
                                                                                                                                                                                                                                                              
error: internal compiler error: broken MIR in DefId(0/0:129 ~ patricia_trie[2708]::triedbmut[0]::{{impl}}[5]::new[0]) (NoSolution): failed to normalize `<_ as hashdb::Hasher>::Out`                                                                          
                                                                                                                                                                                                                                                              
error: internal compiler error: broken MIR in DefId(0/0:146 ~ patricia_trie[2708]::triedbmut[0]::{{impl}}[6]::is_empty[0]) (NoSolution): failed to normalize `<_ as hashdb::Hasher>::Out`                                                                     
                                                                                                                                                                                                                                                              
error: internal compiler error: broken MIR in DefId(0/0:149 ~ patricia_trie[2708]::triedbmut[0]::{{impl}}[6]::remove[0]) (NoSolution): failed to normalize `<_ as hashdb::Hasher>::Out`                                                                       
                                                                                                                                                                                                                                                              
thread 'main' panicked at 'no errors encountered even though `delay_span_bug` issued', librustc_errors/lib.rs:334:17                                                                                                                                          
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 as core::ops::drop::Drop>::drop                                                                                                                                                                                                  
   8: core::ptr::drop_in_place                                                                                                                                                                                                                                
   9: core::ptr::drop_in_place                                                                                                                                                                                                                                
  10: core::ptr::drop_in_place                                                                                                                                                                                                                                
  11: <scoped_tls::ScopedKey<T>>::set                                                                                                                                                                                                                         
  12: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once                                                                                                                                                                         
  13: __rust_maybe_catch_panic                                                                                                                                                                                                                                
             at libpanic_unwind/lib.rs:102                                                                                                                                                                                                                    
  14: rustc_driver::run                                                                                                                                                                                                                                       
  15: rustc_driver::main                                                                                                                                                                                                                                      
  16: std::rt::lang_start::{{closure}}                                                                                                                                                                                                                        
  17: std::panicking::try::do_call                                                                                                                                                                                                                            
             at libstd/rt.rs:59                                                                                                                                                                                                                               
             at libstd/panicking.rs:310                                                                                                                                                                                                                       
  18: __rust_maybe_catch_panic                                                                                                                                                                                                                                
             at libpanic_unwind/lib.rs:102                                                                                                                                                                                                                    
  19: std::rt::lang_start_internal                                                                                                                                                                                                                            
             at libstd/panicking.rs:289                                                                                                                                                                                                                       
             at libstd/panic.rs:392                                                                                                                                                                                                                           
             at libstd/rt.rs:58                                                                                                                                                                                                                               
  20: main                                                                                                                                                                                                                                                    
  21: __libc_start_main                                                                                                                                                                                                                                       
  22: <unknown>                                                                                                                                                                                                                                               
query stack during panic:                                                                                                                                                                                                                                     
end of query stack                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                              
error: internal compiler error: unexpected panic                                                                                                                                                                                                              
                                                                                                                                                                                                                                                              
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 (78ff609d7 2018-10-19) 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 `patricia-trie`.                                                                                                                                                                                                                     
warning: build failed, waiting for other jobs to finish...
error: build failed
@matthewjasper matthewjasper added the A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html label Oct 21, 2018
@matthewjasper
Copy link
Contributor

cc @nikomatsakis

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

myrrlyn commented Oct 22, 2018

I think I have a similar ICE. The exact ICE point is:

'assertion failed: !impl_self_ty.has_infer_types()', librustc_mir/borrow_check/nll/type_check/mod.rs:1033:21

I have a snapshot of my project at https://files.myrrlyn.net/cosmonaut-ice-20181021.tar.xz

See the files ice/20181021.* for information and the backtrace.

@memoryruins memoryruins added the A-NLL Area: Non-lexical lifetimes (NLL) label Oct 23, 2018
@pnkfelix
Copy link
Member

assigning to self to reduce to a smaller test case.

@pnkfelix pnkfelix self-assigned this Oct 23, 2018
@nikomatsakis
Copy link
Contributor

Marking as an RC2 blocker -- though it might be better to shoot for a backport?

@nikomatsakis
Copy link
Contributor

I think we decided to push this to Rust 2018 release

@nikomatsakis
Copy link
Contributor

I just tested and this still seems to reproduce with #55229 :(

@nikomatsakis
Copy link
Contributor

OK, I have a fix for this.

@nikomatsakis
Copy link
Contributor

I did not yet manage to crate a narrowed test case for this particular case — it seems like a several similar root problem to #55219 though.

@nikomatsakis
Copy link
Contributor

OK, here is a standalone test case:

#![feature(nll)]

pub trait Hasher {
    type Out: Eq;
}

pub trait NodeCodec<H: Hasher> {
    const HASHED_NULL_NODE: H::Out;
}

pub trait Trie<H: Hasher, C: NodeCodec<H>> {
    fn root(&self) -> &H::Out;

    fn is_empty(&self) -> bool { *self.root() == C::HASHED_NULL_NODE }
}

fn main() { }

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Oct 24, 2018
Add regression tests for rust-lang#55219 and rust-lang#55241

Also another test where a duplicate-like error appears to have been
suppressed; I'm not 100% sure why this output changes, though I could
imagine that some duplicate suppression is enabled by this PR.
bors added a commit that referenced this issue Oct 25, 2018
introduce type-op for user-type ascription in NLL

Handle user-type ascription in a type operator, which gives us a lot more flexibility around the order in which we resolve things.

r? @pnkfelix

Fixes #55219
Fixes #55241
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-NLL Area: Non-lexical lifetimes (NLL) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants