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 on nested RPIT: cannot prove CoerceUnsized predicate #99642

Closed
aliemjay opened this issue Jul 23, 2022 · 5 comments · Fixed by #99714
Closed

ICE on nested RPIT: cannot prove CoerceUnsized predicate #99642

aliemjay opened this issue Jul 23, 2022 · 5 comments · Fixed by #99714
Assignees
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

@aliemjay
Copy link
Member

aliemjay commented Jul 23, 2022

Code

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=b8de6af93ef2a54292829ffbc9cbea25

fn test() -> impl Iterator<Item = impl Sized> {
    Box::new(0..) as Box<dyn Iterator<Item = _>>
}

Regressed between (263edd4 2022-07-17) .. (62b272d 2022-07-21). Probably #99495. Cc @oli-obk.

Edit: Regressed in #99506

Minimized from HFQR/xitca-web. Cc @fakeshadow.

@rustbot label regression-from-stable-to-nightly A-impl-trait

Backtrace

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

error: internal compiler error: broken MIR in DefId(0:3 ~ playground[5412]::test) (NoSolution): could not prove Binder(TraitPredicate(<std::boxed::Box<std::ops::RangeFrom<i32>> as std::ops::CoerceUnsized<std::boxed::Box<dyn std::iter::Iterator<Item = impl Sized>>>>, polarity:Positive), [])
 --> src/lib.rs:2:5
  |
2 |     Box::new(0..) as Box<dyn Iterator<Item = _>>
  |     ^^^^^^^^^^^^^
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/canonical.rs:151:13

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1426:13
stack backtrace:
   0:     0x7f9723d958a0 - std::backtrace_rs::backtrace::libunwind::trace::h9ae2a0a86525a721
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f9723d958a0 - std::backtrace_rs::backtrace::trace_unsynchronized::h2db65d70ea604a8b
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f9723d958a0 - std::sys_common::backtrace::_print_fmt::ha87108be4ced4d7b
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f9723d958a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8289c789e2444f52
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f9723deee7c - core::fmt::write::h4bc61850e148256a
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/core/src/fmt/mod.rs:1198:17
   5:     0x7f9723d86ea5 - std::io::Write::write_fmt::h39fafbe9deae7dce
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/io/mod.rs:1672:15
   6:     0x7f9723d98531 - std::sys_common::backtrace::_print::h48b22fe50876db47
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f9723d98531 - std::sys_common::backtrace::print::h4deb0c8c0ba6e812
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f9723d98531 - std::panicking::default_hook::{{closure}}::hec18832ee0d2183c
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/panicking.rs:295:22
   9:     0x7f9723d98203 - std::panicking::default_hook::h6fd5dc4e9c4f675e
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/panicking.rs:314:9
  10:     0x7f97245c7af1 - rustc_driver[c212bfd01fb1bd4e]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f9723d98d06 - std::panicking::rust_panic_with_hook::hb4a45181e5abcce3
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/panicking.rs:702:17
  12:     0x7f972577ec11 - std[c85d7afaac2a6227]::panicking::begin_panic::<rustc_errors[4d7b9c19931775fa]::ExplicitBug>::{closure#0}
  13:     0x7f972577e9a6 - std[c85d7afaac2a6227]::sys_common::backtrace::__rust_end_short_backtrace::<std[c85d7afaac2a6227]::panicking::begin_panic<rustc_errors[4d7b9c19931775fa]::ExplicitBug>::{closure#0}, !>
  14:     0x7f97257788c6 - std[c85d7afaac2a6227]::panicking::begin_panic::<rustc_errors[4d7b9c19931775fa]::ExplicitBug>
  15:     0x7f972577bad6 - std[c85d7afaac2a6227]::panic::panic_any::<rustc_errors[4d7b9c19931775fa]::ExplicitBug>
  16:     0x7f972705c0e3 - <rustc_errors[4d7b9c19931775fa]::HandlerInner as core[c7b8860b6e72b2f6]::ops::drop::Drop>::drop
  17:     0x7f9726788ff8 - core[c7b8860b6e72b2f6]::ptr::drop_in_place::<rustc_session[7be89286315efa93]::parse::ParseSess>
  18:     0x7f972678b523 - <alloc[2307dd647311a06c]::rc::Rc<rustc_session[7be89286315efa93]::session::Session> as core[c7b8860b6e72b2f6]::ops::drop::Drop>::drop
  19:     0x7f972676d7ed - core[c7b8860b6e72b2f6]::ptr::drop_in_place::<rustc_interface[e455626695b2bf4c]::interface::Compiler>
  20:     0x7f972676b974 - rustc_span[bd4aa58f7c6f9add]::with_source_map::<core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>, rustc_interface[e455626695b2bf4c]::interface::create_compiler_and_run<core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>, rustc_driver[c212bfd01fb1bd4e]::run_compiler::{closure#1}>::{closure#1}>
  21:     0x7f9726787e50 - rustc_interface[e455626695b2bf4c]::interface::create_compiler_and_run::<core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>, rustc_driver[c212bfd01fb1bd4e]::run_compiler::{closure#1}>
  22:     0x7f972679be22 - <scoped_tls[ae38fa8e7a890916]::ScopedKey<rustc_span[bd4aa58f7c6f9add]::SessionGlobals>>::set::<rustc_interface[e455626695b2bf4c]::interface::run_compiler<core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>, rustc_driver[c212bfd01fb1bd4e]::run_compiler::{closure#1}>::{closure#0}, core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>>
  23:     0x7f972676dcef - std[c85d7afaac2a6227]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e455626695b2bf4c]::util::run_in_thread_pool_with_globals<rustc_interface[e455626695b2bf4c]::interface::run_compiler<core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>, rustc_driver[c212bfd01fb1bd4e]::run_compiler::{closure#1}>::{closure#0}, core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>>::{closure#0}, core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>>
  24:     0x7f97267882a9 - <<std[c85d7afaac2a6227]::thread::Builder>::spawn_unchecked_<rustc_interface[e455626695b2bf4c]::util::run_in_thread_pool_with_globals<rustc_interface[e455626695b2bf4c]::interface::run_compiler<core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>, rustc_driver[c212bfd01fb1bd4e]::run_compiler::{closure#1}>::{closure#0}, core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>>::{closure#0}, core[c7b8860b6e72b2f6]::result::Result<(), rustc_errors[4d7b9c19931775fa]::ErrorGuaranteed>>::{closure#1} as core[c7b8860b6e72b2f6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7f9723da2753 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h713f45ba125dd07b
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/alloc/src/boxed.rs:1935:9
  26:     0x7f9723da2753 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5469f4a0b2b35b34
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/alloc/src/boxed.rs:1935:9
  27:     0x7f9723da2753 - std::sys::unix::thread::Thread::new::thread_start::h81d52548323558fa
                               at /rustc/848090dcd18553b790461132ca9d2a020aeea9a2/library/std/src/sys/unix/thread.rs:108:17
  28:     0x7f9723cc4609 - start_thread
  29:     0x7f9723be7133 - clone
  30:                0x0 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.

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.64.0-nightly (848090dcd 2022-07-22) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
warning: `playground` (lib) generated 1 warning
error: could not compile `playground`; 1 warning emitted

@aliemjay aliemjay 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 Jul 23, 2022
@rustbot rustbot added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. 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 Jul 23, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 24, 2022

Duplicate of #96572

@oli-obk oli-obk marked this as a duplicate of #96572 Jul 24, 2022
@oli-obk oli-obk closed this as completed Jul 24, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 24, 2022

No wait, huh? That's another issue

@oli-obk oli-obk reopened this Jul 24, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 24, 2022

This must've been broken before. That revert should not be able to cause a stable to nightly regression

@aliemjay
Copy link
Member Author

I was wrong, bisection points to #99506. I guess it is #99383. Cc @ouz-a.

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jul 24, 2022
@ouz-a
Copy link
Contributor

ouz-a commented Jul 24, 2022

@rustbot claim

@inquisitivecrystal inquisitivecrystal marked this as not a duplicate of #96572 Jul 24, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jul 28, 2022
@bors bors closed this as completed in 91b8b9b Jul 28, 2022
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

Successfully merging a pull request may close this issue.

6 participants