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 1.73 nightly #115051

Closed
sftse opened this issue Aug 21, 2023 · 9 comments
Closed

ICE 1.73 nightly #115051

sftse opened this issue Aug 21, 2023 · 9 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sftse
Copy link

sftse commented Aug 21, 2023

Code

trait Q<I>: Sized {
    type S;
}

trait P<I> {
    type X: Q<I>;
    fn a(_: &mut M<I, <Self::X as Q<I>>::S>)
    where
        Self: Sized,
    {
    }
}

struct R<A>(A);

impl<I, E: Q<I>, A> P<I> for R<A>
where
    A: P<I, X = E>,
{
    type X = E;

    fn a(_: &mut M<I, <Self::X as Q<I>>::S>)
    where
        Self: Sized,
    {
    }
}

struct M<I, S, Iter: Iterator<Item = S> + ?Sized = dyn Iterator<Item = S>>(I, S, Iter);

Meta

Builds on
rustc --version --verbose:

rustc 1.71.1 (eb26296b5 2023-08-03)
binary: rustc
commit-hash: eb26296b556cef10fb713a38f3d16b9886080f26
commit-date: 2023-08-03
host: x86_64-unknown-linux-gnu
release: 1.71.1
LLVM version: 16.0.5

ICE on

rustc 1.73.0-nightly (28eb857b9 2023-08-12)
binary: rustc
commit-hash: 28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1
commit-date: 2023-08-12
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 17.0.0

Error output

delayed span bug: unresolved inference variable in outlives: ?8t
   0: <rustc_errors::HandlerInner>::emit_diagnostic
   1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   2: <rustc_infer::infer::outlives::obligations::TypeOutlives<&rustc_infer::infer::InferCtxt>>::components_must_outlive
   3: <rustc_infer::infer::InferCtxt>::resolve_regions
   4: rustc_hir_analysis::check::compare_impl_item::compare_method_predicate_entailment
   5: rustc_hir_analysis::check::check::check_mod_item_types
   6: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
   7: <rustc_query_impl::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
   8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
   9: rustc_query_impl::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  10: <rustc_middle::hir::map::Map>::for_each_module::<rustc_hir_analysis::check_crate::{closure#6}::{closure#0}>
  11: rustc_hir_analysis::check_crate
  12: rustc_interface::passes::analysis
  13: 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]>>
  14: <rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
  15: 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>
  16: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  17: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  18: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  19: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_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>>
  20: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_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}
  21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1/library/alloc/src/boxed.rs:2007:9
  22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1/library/alloc/src/boxed.rs:2007:9
  23: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1/library/std/src/sys/unix/thread.rs:108:17
  24: <unknown>
  25: <unknown>

delayed span bug: unresolved inference variable in outlives: ?7t
   0: <rustc_errors::HandlerInner>::emit_diagnostic
   1: <rustc_session::session::Session>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   2: <rustc_infer::infer::outlives::obligations::TypeOutlives<&rustc_infer::infer::InferCtxt>>::components_must_outlive
   3: <rustc_infer::infer::InferCtxt>::resolve_regions
   4: rustc_hir_analysis::check::compare_impl_item::compare_method_predicate_entailment
   5: rustc_hir_analysis::check::check::check_mod_item_types
   6: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
   7: <rustc_query_impl::query_impl::check_mod_item_types::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
   8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
   9: rustc_query_impl::query_impl::check_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
  10: <rustc_middle::hir::map::Map>::for_each_module::<rustc_hir_analysis::check_crate::{closure#6}::{closure#0}>
  11: rustc_hir_analysis::check_crate
  12: rustc_interface::passes::analysis
  13: 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]>>
  14: <rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
  15: 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>
  16: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  17: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  18: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  19: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_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>>
  20: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_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}
  21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1/library/alloc/src/boxed.rs:2007:9
  22: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1/library/alloc/src/boxed.rs:2007:9
  23: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/28eb857b9504bd05bbed0cf8af8e825fbdbb1fa1/library/std/src/sys/unix/thread.rs:108:17
  24: <unknown>
  25: <unknown>



rustc version: 1.73.0-nightly (28eb857b9 2023-08-12)
platform: x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
@sftse sftse added 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. labels Aug 21, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 21, 2023
@sftse
Copy link
Author

sftse commented Aug 21, 2023

trait Q {
    type S;
}

trait P {
    type X: Q;
    fn a(_: &<Self::X as Q>::S)
    {
    }
}

struct R<A>(A);

impl<E: Q, A> P for R<A>
where
    A: P<X = E>,
{
    type X = E;

    fn a(_: &<Self::X as Q>::S)
    {
    }
}

@rustbot rustbot added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 21, 2023
@darklyspaced
Copy link
Contributor

darklyspaced commented Aug 21, 2023

@rustbot label -I-prioritize +E-needs-bisection +regression-from-stable-to-nightly

@rustbot rustbot removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 21, 2023
@apiraino
Copy link
Contributor

@sftse I'm afraid I can't reproduce the ICE with the provided MCVE. Can you post a bit more info on how to reproduce it? thanks

@darklyspaced did you remove the I-prioritize label intentionally? We use it to mark regressions that have not yet been estimated a priority. I'm going to reapply it.

@rustbot prioritize

@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 21, 2023
@compiler-errors
Copy link
Member

This is likely fixed by #115039.

@sftse
Copy link
Author

sftse commented Aug 22, 2023

@apiraino I'm not familiar with the compiler development process, can you elaborate what issues could be preventing you from reproducing this? The rustc version is as stated, the dependency that triggered the ICE from which the MCVE was constructed is the chumsky crate.

@Noratrieb Noratrieb added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 22, 2023
@apiraino
Copy link
Contributor

apiraino commented Aug 22, 2023

@sftse I've tried compiling the MCVE you provided in this comment by downloading the rustc version you indicated (1.73.0-nightly (28eb857 2023-08-12)) and then run:

$ rustc +nightly-2023-08-12-x86_64-unknown-linux-gnu --version
rustc 1.73.0-nightly (a6f8aa5a0 2023-08-11)

$ rustc +nightly-2023-08-12-x86_64-unknown-linux-gnu main.rs ; ./main

Also attempted to bisect to earlier versions of rustc. On my Linux workstation that does not emit any ICE so clearly I'm missing some context. What's the correct command line you run to compile that MCVE to make it trigger the ICE? Unsure why you mention the "chumsky" crate, at a cursory look I don't identify how this is relevant here. Or is it? thanks

@sftse
Copy link
Author

sftse commented Aug 22, 2023

@apiraino The commit you listed, of your rustc, does not match the commit I listed. It seems providing rustc with the flags you did results in a compiler built from a day prior.

@apiraino
Copy link
Contributor

yes, my bad. the bisection was slightly confusing because this has already been fixed in #115039 (comment), so latest nightly already don't reproduce this issue.

@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 23, 2023
@JohnTitor
Copy link
Member

Triage: Let's close this issue in favor of the PR mentioned above. If the regression test added by it doesn't cover this case, please re-open!

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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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

7 participants