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

ICE: ['?0, &ReEarlyBound(DefId ... is not fully resolved #116947

Closed
matthiaskrgr opened this issue Oct 19, 2023 · 4 comments
Closed

ICE: ['?0, &ReEarlyBound(DefId ... is not fully resolved #116947

matthiaskrgr opened this issue Oct 19, 2023 · 4 comments
Labels
C-bug Category: This is a bug. 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

@matthiaskrgr
Copy link
Member

File: /tmp/icemaker/68F3FC748CB07BD5DEB482970DD90B65A892A54B35FF38D622C323A548BD2156.rs

auto-reduced (treereduce-rust):

#![feature(min_specialization)]

trait MySpecTrait {
    fn f();
}

impl<'a, T: ?Sized> MySpecTrait for T {
    default fn f() {}
}

impl<'a, T: ?Sized> MySpecTrait for &'a T {
    fn f() {}
}

fn main() {}

original:

// Check that lifetime parameters are allowed in specializing impls.

// check-pass

#![feature(min_specialization)]

trait MySpecTrait {
    fn f();
}

impl<'a, T: ?Sized> MySpecTrait for T {
    default fn f() {}
}

impl<'a, T: ?Sized> MySpecTrait for &'a T {
    fn f() {}
}

fn main() {}

Version information

rustc 1.75.0-nightly (3fbcfd2b6 2023-10-19)
binary: rustc
commit-hash: 3fbcfd2b6f7030cb70328aa759107efc1516912c
commit-date: 2023-10-19
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.3

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: `['?0, &ReEarlyBound(DefId(0:10 ~ 68F3FC748CB07BD5DEB482970DD90B65A892A54B35FF38D622C323A548BD2156[8290]::{impl#1}::'a), 0, 'a) T/#1]` is not fully resolved
  |
  = note: delayed at /rustc/3fbcfd2b6f7030cb70328aa759107efc1516912c/compiler/rustc_infer/src/infer/mod.rs:1434:26
             0: <rustc_errors::HandlerInner>::emit_diagnostic
             1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
             2: rustc_hir_analysis::impl_wf_check::min_specialization::check_always_applicable
             3: rustc_hir_analysis::impl_wf_check::check_mod_impl_wf
             4: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_impl_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
             5: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             6: rustc_query_impl::query_impl::check_mod_impl_wf::get_query_non_incr::__rust_end_short_backtrace
             7: rustc_hir_analysis::check_crate
             8: rustc_interface::passes::analysis
             9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
            10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
            11: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
            12: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            13: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            14: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/3fbcfd2b6f7030cb70328aa759107efc1516912c/library/alloc/src/boxed.rs:2007:9
            15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/3fbcfd2b6f7030cb70328aa759107efc1516912c/library/alloc/src/boxed.rs:2007:9
            16: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/3fbcfd2b6f7030cb70328aa759107efc1516912c/library/std/src/sys/unix/thread.rs:108:17
            17: <unknown>
            18: <unknown>


note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.75.0-nightly (3fbcfd2b6 2023-10-19) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 2 previous errors


this one still crashes after #116663 cc @compiler-errors maybe :D

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Oct 19, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 19, 2023
@compiler-errors
Copy link
Member

I don't really see the point of opening a new issue for literally the same bug as #103708. I'd prefer if we just edit the issue in the description of that issue to side-step the error that caused the delay span bug not to trigger.

@compiler-errors
Copy link
Member

Either that, or we should close #103708. There's no reason to close that one by adding a test -- the test isn't testing anything useful other than the fact that we don't ICE if we have already emitted an error.

@matthiaskrgr
Copy link
Member Author

Ah I got that one from my big "files that crash rustc" folder after checking if there would be any examples left before seeing your comment in #103708 (fwiw for that crash we are down to 2 crashing files instead of maybe 100-150 before :) )
Feel free to close either of them 🤷

@compiler-errors
Copy link
Member

Closing this one in favor of the older one -- I'll copy the autoreduced example into the PR description.

@compiler-errors compiler-errors closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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

No branches or pull requests

4 participants