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: Failed to normalize <[closure] as std::ops::FnOnce<(&S,)>>::Output #2433

Closed
matthiaskrgr opened this issue Jul 24, 2022 · 16 comments · Fixed by rust-lang/rust#100980
Closed
Labels
A-interpreter Area: affects the core interpreter C-bug Category: This is a bug. I-ICE Impact: makes Miri crash with some ICE

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jul 24, 2022

code from rustc ./src/test/ui/type-alias-impl-trait/issue-72793.rs

// check-pass
// compile-flags: -Zmir-opt-level=3

#![feature(type_alias_impl_trait)]

trait T { type Item; }

type Alias<'a> = impl T<Item = &'a ()>;

struct S;
impl<'a> T for &'a S {
    type Item = &'a ();
}

fn filter_positive<'a>() -> Alias<'a> {
    &S
}

fn with_positive(fun: impl Fn(Alias<'_>)) {
    fun(filter_positive());
}

fn main() {
    with_positive(|_| ());
}
WARNING: Ignoring `RUSTC_WRAPPER` environment variable, Miri does not support wrapping.
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri target/miri/x86_64-unknown-linux-gnu/debug/m`
error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:199:90: Failed to normalize <[closure@src/main.rs:24:19: 24:22] as std::ops::FnOnce<(&S,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/compiler/rustc_errors/src/lib.rs:1392:9
stack backtrace:
   0:     0x7f7fc64a37a0 - std::backtrace_rs::backtrace::libunwind::trace::h763ecd2b1c94eb47
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f7fc64a37a0 - std::backtrace_rs::backtrace::trace_unsynchronized::h7346e33da5e91dc9
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f7fc64a37a0 - std::sys_common::backtrace::_print_fmt::h8ca9befc16375e7f
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f7fc64a37a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h35a76e8acc949815
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f7fc64fda2c - core::fmt::write::h1966177bbb3b1b76
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/core/src/fmt/mod.rs:1198:17
   5:     0x7f7fc6494f85 - std::io::Write::write_fmt::he17142a652adbfaa
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/io/mod.rs:1672:15
   6:     0x7f7fc64a6471 - std::sys_common::backtrace::_print::h58fd682547bc6ff7
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f7fc64a6471 - std::sys_common::backtrace::print::hb71ddfedfd79ba3f
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f7fc64a6471 - std::panicking::default_hook::{{closure}}::h866ffdcbb9391663
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/panicking.rs:295:22
   9:     0x7f7fc64a6143 - std::panicking::default_hook::hc53d610bee87e7b5
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/panicking.rs:314:9
  10:     0x7f7fc6d53731 - rustc_driver[ee492072531d29b9]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f7fc64a6c46 - std::panicking::rust_panic_with_hook::h1f2457f8494b1ce0
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/panicking.rs:702:17
  12:     0x7f7fc7dbfb31 - std[af12de6c3337c1b7]::panicking::begin_panic::<rustc_errors[30e8870fe27fb8ba]::ExplicitBug>::{closure#0}
  13:     0x7f7fc7dbee66 - std[af12de6c3337c1b7]::sys_common::backtrace::__rust_end_short_backtrace::<std[af12de6c3337c1b7]::panicking::begin_panic<rustc_errors[30e8870fe27fb8ba]::ExplicitBug>::{closure#0}, !>
  14:     0x7f7fc7d9cdd6 - std[af12de6c3337c1b7]::panicking::begin_panic::<rustc_errors[30e8870fe27fb8ba]::ExplicitBug>
  15:     0x7f7fc7d59ea6 - std[af12de6c3337c1b7]::panic::panic_any::<rustc_errors[30e8870fe27fb8ba]::ExplicitBug>
  16:     0x7f7fc7d55755 - <rustc_errors[30e8870fe27fb8ba]::HandlerInner>::bug::<&alloc[327c298d5f7f3986]::string::String>
  17:     0x7f7fc7d554b0 - <rustc_errors[30e8870fe27fb8ba]::Handler>::bug::<&alloc[327c298d5f7f3986]::string::String>
  18:     0x7f7fc7e142ad - rustc_middle[ba567b0c63397382]::ty::context::tls::with_context_opt::<rustc_middle[ba567b0c63397382]::ty::context::tls::with_opt<rustc_middle[ba567b0c63397382]::util::bug::opt_span_bug_fmt<rustc_span[e8a062c38fd06fcf]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7f7fc7e1a2b6 - rustc_middle[ba567b0c63397382]::util::bug::opt_span_bug_fmt::<rustc_span[e8a062c38fd06fcf]::span_encoding::Span>
  20:     0x7f7fc7e1a233 - rustc_middle[ba567b0c63397382]::util::bug::bug_fmt
  21:     0x7f7fc8d7daa7 - <rustc_middle[ba567b0c63397382]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle[ba567b0c63397382]::ty::fold::TypeFolder>::fold_ty
  22:     0x5623e49ee3c1 - rustc_middle[ba567b0c63397382]::ty::util::fold_list::<rustc_middle[ba567b0c63397382]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder, rustc_middle[ba567b0c63397382]::ty::Ty, <&rustc_middle[ba567b0c63397382]::ty::list::List<rustc_middle[ba567b0c63397382]::ty::Ty> as rustc_middle[ba567b0c63397382]::ty::fold::TypeFoldable>::try_fold_with<rustc_middle[ba567b0c63397382]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder>::{closure#0}>
  23:     0x5623e48f7af0 - <rustc_middle[ba567b0c63397382]::ty::context::TyCtxt>::normalize_erasing_late_bound_regions::<rustc_middle[ba567b0c63397382]::ty::sty::FnSig>
  24:     0x5623e495d99f - <rustc_const_eval[fabfa6a4d198841f]::interpret::eval_context::InterpCx<miri[ab945d3d15ab0ad0]::machine::Evaluator>>::terminator
  25:     0x5623e4933c3d - <core[7b47b893e00d8dca]::panic::unwind_safe::AssertUnwindSafe<miri[ab945d3d15ab0ad0]::eval::eval_entry::{closure#0}> as core[7b47b893e00d8dca]::ops::function::FnOnce<()>>::call_once
  26:     0x5623e4912e6c - miri[ab945d3d15ab0ad0]::eval::eval_entry
  27:     0x5623e4867c89 - <rustc_interface[c2045ebdcb88575c]::passes::QueryContext>::enter::<<miri[a2bdd18a035b3443]::MiriCompilerCalls as rustc_driver[ee492072531d29b9]::Callbacks>::after_analysis::{closure#0}, ()>
  28:     0x5623e486c653 - <miri[a2bdd18a035b3443]::MiriCompilerCalls as rustc_driver[ee492072531d29b9]::Callbacks>::after_analysis
  29:     0x7f7fc8f06c8b - <rustc_interface[c2045ebdcb88575c]::interface::Compiler>::enter::<rustc_driver[ee492072531d29b9]::run_compiler::{closure#1}::{closure#2}, core[7b47b893e00d8dca]::result::Result<core[7b47b893e00d8dca]::option::Option<rustc_interface[c2045ebdcb88575c]::queries::Linker>, rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>>
  30:     0x7f7fc8f02f3a - rustc_span[e8a062c38fd06fcf]::with_source_map::<core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>, rustc_interface[c2045ebdcb88575c]::interface::create_compiler_and_run<core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>, rustc_driver[ee492072531d29b9]::run_compiler::{closure#1}>::{closure#1}>
  31:     0x7f7fc8f1f360 - rustc_interface[c2045ebdcb88575c]::interface::create_compiler_and_run::<core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>, rustc_driver[ee492072531d29b9]::run_compiler::{closure#1}>
  32:     0x7f7fc8f33362 - <scoped_tls[7afe57960397b723]::ScopedKey<rustc_span[e8a062c38fd06fcf]::SessionGlobals>>::set::<rustc_interface[c2045ebdcb88575c]::interface::run_compiler<core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>, rustc_driver[ee492072531d29b9]::run_compiler::{closure#1}>::{closure#0}, core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>>
  33:     0x7f7fc8f0532f - std[af12de6c3337c1b7]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c2045ebdcb88575c]::util::run_in_thread_pool_with_globals<rustc_interface[c2045ebdcb88575c]::interface::run_compiler<core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>, rustc_driver[ee492072531d29b9]::run_compiler::{closure#1}>::{closure#0}, core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>>::{closure#0}, core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>>
  34:     0x7f7fc8f1f7b9 - <<std[af12de6c3337c1b7]::thread::Builder>::spawn_unchecked_<rustc_interface[c2045ebdcb88575c]::util::run_in_thread_pool_with_globals<rustc_interface[c2045ebdcb88575c]::interface::run_compiler<core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>, rustc_driver[ee492072531d29b9]::run_compiler::{closure#1}>::{closure#0}, core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>>::{closure#0}, core[7b47b893e00d8dca]::result::Result<(), rustc_errors[30e8870fe27fb8ba]::ErrorGuaranteed>>::{closure#1} as core[7b47b893e00d8dca]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7f7fc64b0693 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2535c4f17d1ae00a
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/alloc/src/boxed.rs:1935:9
  36:     0x7f7fc64b0693 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9555fa64d2fdcc1f
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/alloc/src/boxed.rs:1935:9
  37:     0x7f7fc64b0693 - std::sys::unix::thread::Thread::new::thread_start::hcd4b7b87c76163e2
                               at /rustc/93ffde6f04d3d24327a4e17a2a2bf4f63c246235/library/std/src/sys/unix/thread.rs:108:17
  38:     0x7f7fc619954d - <unknown>
  39:     0x7f7fc621e874 - clone
  40:                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 (93ffde6f0 2022-07-23) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-cpu=native

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

query stack during panic:
end of query stack

Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> src/main.rs:20:5
   |
20 |     fun(filter_positive());
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: inside `with_positive::<[closure@src/main.rs:24:19: 24:22]>` at src/main.rs:20:5
note: inside `main` at src/main.rs:24:5
  --> src/main.rs:24:5
   |
24 |     with_positive(|_| ());
   |     ^^^^^^^^^^^^^^^^^^^^^
   = note: inside `<fn() as std::ops::FnOnce<()>>::call_once - shim(fn())` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:248:5
   = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:122:18
   = note: inside closure at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:145:18
   = note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:280:13
   = note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:492:40
   = note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:456:19
   = note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:137:14
   = note: inside closure at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:128:48
   = note: inside `std::panicking::r#try::do_call::<[closure@std::rt::lang_start_internal::{closure#2}], isize>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:492:40
   = note: inside `std::panicking::r#try::<isize, [closure@std::rt::lang_start_internal::{closure#2}]>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:456:19
   = note: inside `std::panic::catch_unwind::<[closure@std::rt::lang_start_internal::{closure#2}], isize>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:137:14
   = note: inside `std::rt::lang_start_internal` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:128:20
   = note: inside `std::rt::lang_start::<()>` at /home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:144:17

error: aborting due to previous error

This has been fixed on the rustc side, why does this crash with miri now? 🤔

@RalfJung
Copy link
Member

Uh, no idea... all that normalization stuff is a black box to me.^^ "Failed to normalize <[closure@src/main.rs:24:19: 24:22] as std::ops::FnOnce<(&S,)>>::Output" is odd, if it knows the closure type it should be able to just figure out the output type?

@oli-obk any idea?

@RalfJung RalfJung changed the title ICE. normalisation failure ICE: Failed to normalize <[closure] as std::ops::FnOnce<(&S,)>>::Output Jul 24, 2022
@RalfJung RalfJung added C-bug Category: This is a bug. A-interpreter Area: affects the core interpreter I-ICE Impact: makes Miri crash with some ICE labels Jul 24, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jul 28, 2022

if this is a recent regression, it could be due to rust-lang/rust#99383

Though... in RevealAll mode we should never actually constrain an opaque type and instead be revealing them... that's probably a bug in rustc.

@RalfJung
Copy link
Member

Yeah, with the 2022-07-19 nightly there seems to be no ICE.

@RalfJung
Copy link
Member

RalfJung commented Aug 22, 2022

@ouz-a reports the problem remains after reverting their PR. OTOH I have confirmed that the problem definitely started with this rollup: rust-lang/rust#99506.

@RalfJung
Copy link
Member

RalfJung commented Aug 23, 2022

Uh... so with 3c3c5da9adfdf308b5189b8034c07e0dc5492a54 I get a different error, somehow?

>thread 'rustc' panicked at 'assertion failed: `(left == right)`
>  left: `Some(Obligation(predicate=Binder(TraitPredicate(<&S as std::marker::Sized>, polarity:Positive), []), depth=0))`,
> right: `None`', compiler/rustc_traits/src/normalize_erasing_regions.rs:LL:CC
>stack backtrace:
>   0: std::backtrace_rs::backtrace::libunwind::trace::h45c496ed2150e509
> at RUSTLIB/std/src/../../backtrace/src/backtrace/libunwind.rs:LL:CC
>   1: std::backtrace_rs::backtrace::trace_unsynchronized::h4a55eb92770e244f
> at RUSTLIB/std/src/../../backtrace/src/backtrace/mod.rs:LL:CC
>   2: std::sys_common::backtrace::_print_fmt::h0821ded70d0475c9
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbbb39798153b4dd1
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   4: core::fmt::write::hdf3432484eef9649
> at RUSTLIB/core/src/fmt/mod.rs:LL:CC
>   5: std::io::Write::write_fmt::had572b91d539a41b
> at RUSTLIB/std/src/io/mod.rs:LL:CC
>   6: std::sys_common::backtrace::_print::h8a2961faada59383
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   7: std::sys_common::backtrace::print::h6e3d32371dd00b05
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   8: std::panicking::default_hook::{{closure}}::he6c029a195cbaf5c
>   9: std::panicking::default_hook::h32158034ae7d775d
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  10: <alloc[13b3ae67d8724159]::boxed::Box<dyn for<'a, 'b> core[5b8050c91244cb8c]::ops::function::Fn<(&'a core[5b8050c91244cb8c]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[5b8050c91244cb8c]::marker::Sync + core[5b8050c91244cb8c]::marker::Send> as core[5b8050c91244cb8c]::ops::function::Fn<(&core[5b8050c91244cb8c]::panic::panic_info::PanicInfo,)>>::call
> at RUSTLIB/alloc/src/boxed.rs:LL:CC
>  11: rustc_driver[ad1eb020797fdf50]::DEFAULT_HOOK::{closure#0}::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_driver/src/lib.rs:LL:CC
>  12: std::panicking::rust_panic_with_hook::hbeeb00606897b943
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  13: std::panicking::begin_panic_handler::{{closure}}::h8c1695f63e99aedd
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  14: std::sys_common::backtrace::__rust_end_short_backtrace::h7a1c515ec200c0bd
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>  15: rust_begin_unwind
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  16: core::panicking::panic_fmt::hab2abc629ba5f823
> at RUSTLIB/core/src/panicking.rs:LL:CC
>  17: core::panicking::assert_failed_inner::h15dec335fb309c3e
>  18: core[5b8050c91244cb8c]::panicking::assert_failed
> at RUSTLIB/core/src/panicking.rs:LL:CC
>  19: rustc_traits[cada738367de0cb2]::normalize_erasing_regions::try_normalize_after_erasing_regions::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_traits/src/normalize_erasing_regions.rs:LL:CC
>  20: <rustc_infer[c78697b5a9375a9f]::infer::InferCtxtBuilder>::enter
> at /home/r/src/rust/rustc/compiler/rustc_infer/src/infer/mod.rs:LL:CC
>  21: rustc_traits[cada738367de0cb2]::normalize_erasing_regions::try_normalize_after_erasing_regions
> at /home/r/src/rust/rustc/compiler/rustc_traits/src/normalize_erasing_regions.rs:LL:CC
>  22: rustc_traits[cada738367de0cb2]::normalize_erasing_regions::provide::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_traits/src/normalize_erasing_regions.rs:LL:CC
>  23: <rustc_traits[cada738367de0cb2]::normalize_erasing_regions::provide::{closure#0} as core[5b8050c91244cb8c]::ops::function::FnOnce<(rustc_middle[8b201c99d8595a14]::ty::context::TyCtxt, rustc_middle[8b201c99d8595a14]::ty::ParamEnvAnd<rustc_middle[8b201c99d8595a14]::ty::subst::GenericArg>)>>::call_once
> at RUSTLIB/core/src/ops/function.rs:LL:CC
>  24: <rustc_query_system[69dac6cd847e2dda]::query::config::QueryVtable<rustc_query_impl[bce8bd1772b237eb]::plumbing::QueryCtxt, rustc_middle[8b201c99d8595a14]::ty::ParamEnvAnd<rustc_middle[8b201c99d8595a14]::ty::subst::GenericArg>, core[5b8050c91244cb8c]::result::Result<rustc_middle[8b201c99d8595a14]::ty::subst::GenericArg, rustc_middle[8b201c99d8595a14]::traits::query::NoSolution>>>::compute
> at /home/r/src/rust/rustc/compiler/rustc_query_system/src/query/config.rs:LL:CC
>  25: rustc_query_system[69dac6cd847e2dda]::query::plumbing::execute_job::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_query_system/src/query/plumbing.rs:LL:CC
>  26: stacker[a19e7495bd0af162]::maybe_grow
> at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.14/src/lib.rs:LL:CC
>  27: rustc_data_structures[680399caad47321f]::stack::ensure_sufficient_stack
> at /home/r/src/rust/rustc/compiler/rustc_data_structures/src/stack.rs:LL:CC
>  28: <rustc_query_impl[bce8bd1772b237eb]::plumbing::QueryCtxt as rustc_query_system[69dac6cd847e2dda]::query::QueryContext>::start_query::{closure#0}::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_query_impl/src/plumbing.rs:LL:CC
>  29: rustc_middle[8b201c99d8595a14]::ty::context::tls::enter_context::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  30: rustc_middle[8b201c99d8595a14]::ty::context::tls::set_tlv
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  31: rustc_middle[8b201c99d8595a14]::ty::context::tls::enter_context
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  32: <rustc_query_impl[bce8bd1772b237eb]::plumbing::QueryCtxt as rustc_query_system[69dac6cd847e2dda]::query::QueryContext>::start_query::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_query_impl/src/plumbing.rs:LL:CC
>  33: rustc_middle[8b201c99d8595a14]::ty::context::tls::with_related_context::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  34: rustc_middle[8b201c99d8595a14]::ty::context::tls::with_context::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  35: rustc_middle[8b201c99d8595a14]::ty::context::tls::with_context_opt
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  36: rustc_middle[8b201c99d8595a14]::ty::context::tls::with_context
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  37: rustc_middle[8b201c99d8595a14]::ty::context::tls::with_related_context
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  38: <rustc_query_impl[bce8bd1772b237eb]::plumbing::QueryCtxt as rustc_query_system[69dac6cd847e2dda]::query::QueryContext>::start_query
> at /home/r/src/rust/rustc/compiler/rustc_query_impl/src/plumbing.rs:LL:CC
>  39: rustc_query_system[69dac6cd847e2dda]::query::plumbing::execute_job
> at /home/r/src/rust/rustc/compiler/rustc_query_system/src/query/plumbing.rs:LL:CC
>  40: rustc_query_system[69dac6cd847e2dda]::query::plumbing::try_execute_query
> at /home/r/src/rust/rustc/compiler/rustc_query_system/src/query/plumbing.rs:LL:CC
>  41: rustc_query_system[69dac6cd847e2dda]::query::plumbing::get_query
> at /home/r/src/rust/rustc/compiler/rustc_query_system/src/query/plumbing.rs:LL:CC
>  42: <rustc_query_impl[bce8bd1772b237eb]::Queries as rustc_middle[8b201c99d8595a14]::ty::query::QueryEngine>::try_normalize_generic_arg_after_erasing_regions
> at /home/r/src/rust/rustc/compiler/rustc_query_impl/src/lib.rs:LL:CC
>  43: <rustc_middle[8b201c99d8595a14]::ty::query::TyCtxtAt>::try_normalize_generic_arg_after_erasing_regions
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/query.rs:LL:CC
>  44: <rustc_middle[8b201c99d8595a14]::ty::context::TyCtxt>::try_normalize_generic_arg_after_erasing_regions
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/query.rs:LL:CC
>  45: <rustc_middle[8b201c99d8595a14]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder>::normalize_generic_arg_after_erasing_regions
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:LL:CC
>  46: <rustc_middle[8b201c99d8595a14]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle[8b201c99d8595a14]::ty::fold::TypeFolder>::fold_ty
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:LL:CC
>  47: <rustc_middle[8b201c99d8595a14]::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle[8b201c99d8595a14]::ty::fold::FallibleTypeFolder>::try_fold_ty
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/fold.rs:LL:CC
>  48: <rustc_middle[8b201c99d8595a14]::ty::Ty as rustc_middle[8b201c99d8595a14]::ty::fold::TypeFoldable>::try_fold_with
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/structural_impls.rs:LL:CC
>  49: rustc_middle[8b201c99d8595a14]::ty::util::fold_list::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/util.rs:LL:CC
>  50: core[5b8050c91244cb8c]::iter::traits::iterator::Iterator::find_map::check::{closure#0}
> at RUSTLIB/core/src/iter/traits/iterator.rs:LL:CC
>  51: <core[5b8050c91244cb8c]::iter::adapters::enumerate::Enumerate<_> as core[5b8050c91244cb8c]::iter::traits::iterator::Iterator>::try_fold::enumerate::{closure#0}
> at RUSTLIB/core/src/iter/adapters/enumerate.rs:LL:CC
>  52: <&mut core[5b8050c91244cb8c]::iter::adapters::copied::Copied<core[5b8050c91244cb8c]::slice::iter::Iter<rustc_middle[8b201c99d8595a14]::ty::Ty>> as core[5b8050c91244cb8c]::iter::traits::iterator::Iterator>::try_fold
> at RUSTLIB/core/src/iter/traits/iterator.rs:LL:CC
>  53: <core[5b8050c91244cb8c]::iter::adapters::enumerate::Enumerate<&mut core[5b8050c91244cb8c]::iter::adapters::copied::Copied<core[5b8050c91244cb8c]::slice::iter::Iter<rustc_middle[8b201c99d8595a14]::ty::Ty>>> as core[5b8050c91244cb8c]::iter::traits::iterator::Iterator>::try_fold
> at RUSTLIB/core/src/iter/adapters/enumerate.rs:LL:CC
>  54: <core[5b8050c91244cb8c]::iter::adapters::enumerate::Enumerate<&mut core[5b8050c91244cb8c]::iter::adapters::copied::Copied<core[5b8050c91244cb8c]::slice::iter::Iter<rustc_middle[8b201c99d8595a14]::ty::Ty>>> as core[5b8050c91244cb8c]::iter::traits::iterator::Iterator>::find_map
> at RUSTLIB/core/src/iter/traits/iterator.rs:LL:CC
>  55: rustc_middle[8b201c99d8595a14]::ty::util::fold_list
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/util.rs:LL:CC
>  56: <rustc_middle[8b201c99d8595a14]::ty::sty::FnSig as rustc_middle[8b201c99d8595a14]::ty::fold::TypeFoldable>::try_fold_with
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/sty.rs:LL:CC
>  57: <rustc_middle[8b201c99d8595a14]::ty::sty::FnSig as rustc_middle[8b201c99d8595a14]::ty::fold::TypeFoldable>::fold_with
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/fold.rs:LL:CC
>  58: <rustc_middle[8b201c99d8595a14]::ty::context::TyCtxt>::normalize_erasing_regions
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:LL:CC
>  59: <rustc_middle[8b201c99d8595a14]::ty::context::TyCtxt>::normalize_erasing_late_bound_regions
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:LL:CC
>  60: <rustc_const_eval[4ea2dcbffdb1ad3c]::interpret::eval_context::InterpCx<miri[218d66e17e4f8954]::machine::Evaluator>>::eval_terminator
> at /home/r/src/rust/rustc/compiler/rustc_const_eval/src/interpret/terminator.rs:LL:CC
>  61: <rustc_const_eval[4ea2dcbffdb1ad3c]::interpret::eval_context::InterpCx<miri[218d66e17e4f8954]::machine::Evaluator>>::terminator
> at /home/r/src/rust/rustc/compiler/rustc_const_eval/src/interpret/step.rs:LL:CC
>  62: <rustc_const_eval[4ea2dcbffdb1ad3c]::interpret::eval_context::InterpCx<miri[218d66e17e4f8954]::machine::Evaluator>>::step
> at /home/r/src/rust/rustc/compiler/rustc_const_eval/src/interpret/step.rs:LL:CC
>  63: miri[218d66e17e4f8954]::eval::eval_entry::{closure#0}
> at /home/r/src/rust/rustc/src/tools/miri/src/eval.rs:LL:CC
>  64: <miri[218d66e17e4f8954]::eval::eval_entry::{closure#0} as core[5b8050c91244cb8c]::ops::function::FnOnce<()>>::call_once
> at RUSTLIB/core/src/ops/function.rs:LL:CC
>  65: <core[5b8050c91244cb8c]::panic::unwind_safe::AssertUnwindSafe<miri[218d66e17e4f8954]::eval::eval_entry::{closure#0}> as core[5b8050c91244cb8c]::ops::function::FnOnce<()>>::call_once
> at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
>  66: std[d84d995932d417c4]::panicking::try::do_call
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  67: std[d84d995932d417c4]::panicking::try
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  68: std[d84d995932d417c4]::panic::catch_unwind
> at RUSTLIB/std/src/panic.rs:LL:CC
>  69: miri[218d66e17e4f8954]::eval::eval_entry
> at /home/r/src/rust/rustc/src/tools/miri/src/eval.rs:LL:CC
>  70: <miri[272047cec92aca5d]::MiriCompilerCalls as rustc_driver[ad1eb020797fdf50]::Callbacks>::after_analysis::{closure#0}
> at /home/r/src/rust/rustc/src/tools/miri/src/bin/miri.rs:LL:CC
>  71: <rustc_interface[d35721db742c9398]::passes::QueryContext>::enter::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/passes.rs:LL:CC
>  72: rustc_middle[8b201c99d8595a14]::ty::context::tls::enter_context::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  73: rustc_middle[8b201c99d8595a14]::ty::context::tls::set_tlv
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  74: rustc_middle[8b201c99d8595a14]::ty::context::tls::enter_context
> at /home/r/src/rust/rustc/compiler/rustc_middle/src/ty/context.rs:LL:CC
>  75: <rustc_interface[d35721db742c9398]::passes::QueryContext>::enter
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/passes.rs:LL:CC
>  76: <miri[272047cec92aca5d]::MiriCompilerCalls as rustc_driver[ad1eb020797fdf50]::Callbacks>::after_analysis
> at /home/r/src/rust/rustc/src/tools/miri/src/bin/miri.rs:LL:CC
>  77: rustc_driver[ad1eb020797fdf50]::run_compiler::{closure#1}::{closure#2}
> at /home/r/src/rust/rustc/compiler/rustc_driver/src/lib.rs:LL:CC
>  78: <rustc_interface[d35721db742c9398]::interface::Compiler>::enter
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/queries.rs:LL:CC
>  79: rustc_driver[ad1eb020797fdf50]::run_compiler::{closure#1}
> at /home/r/src/rust/rustc/compiler/rustc_driver/src/lib.rs:LL:CC
>  80: rustc_interface[d35721db742c9398]::interface::create_compiler_and_run::{closure#1}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/interface.rs:LL:CC
>  81: rustc_span[6115e481c46720f9]::with_source_map
> at /home/r/src/rust/rustc/compiler/rustc_span/src/lib.rs:LL:CC
>  82: rustc_interface[d35721db742c9398]::interface::create_compiler_and_run
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/interface.rs:LL:CC
>  83: rustc_interface[d35721db742c9398]::interface::run_compiler::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/interface.rs:LL:CC
>  84: <scoped_tls[e354f08e85e11ec1]::ScopedKey<rustc_span[6115e481c46720f9]::SessionGlobals>>::set
> at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:LL:CC
>  85: rustc_span[6115e481c46720f9]::create_session_globals_then
> at /home/r/src/rust/rustc/compiler/rustc_span/src/lib.rs:LL:CC
>  86: rustc_interface[d35721db742c9398]::util::run_in_thread_pool_with_globals::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/util.rs:LL:CC
>  87: std[d84d995932d417c4]::sys_common::backtrace::__rust_begin_short_backtrace
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>  88: <std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_::{closure#1}::{closure#0}
> at RUSTLIB/std/src/thread/mod.rs:LL:CC
>  89: <core[5b8050c91244cb8c]::panic::unwind_safe::AssertUnwindSafe<<std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_<rustc_interface[d35721db742c9398]::util::run_in_thread_pool_with_globals<rustc_interface[d35721db742c9398]::interface::run_compiler<core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>, rustc_driver[ad1eb020797fdf50]::run_compiler::{closure#1}>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#1}::{closure#0}> as core[5b8050c91244cb8c]::ops::function::FnOnce<()>>::call_once
> at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
>  90: std[d84d995932d417c4]::panicking::try::do_call
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  91: std[d84d995932d417c4]::panicking::try
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  92: std[d84d995932d417c4]::panic::catch_unwind
> at RUSTLIB/std/src/panic.rs:LL:CC
>  93: <std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_::{closure#1}
> at RUSTLIB/std/src/thread/mod.rs:LL:CC
>  94: <<std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_<rustc_interface[d35721db742c9398]::util::run_in_thread_pool_with_globals<rustc_interface[d35721db742c9398]::interface::run_compiler<core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>, rustc_driver[ad1eb020797fdf50]::run_compiler::{closure#1}>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#1} as core[5b8050c91244cb8c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
> at RUSTLIB/core/src/ops/function.rs:LL:CC
>  95: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8a1dda340491a5ac
> at RUSTLIB/alloc/src/boxed.rs:LL:CC
>  96: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he8a925ef37b3c273
> at RUSTLIB/alloc/src/boxed.rs:LL:CC
>  97: std::sys::PLATFORM::thread::Thread::new::thread_start::h65cc7689d5c2f187
> at RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC
>  98: start_thread
>                               at ./nptl/./nptl/pthread_create.c:435:8
>  99: __GI___clone3
>                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
> 100: <unknown>
>
>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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
>
>note: rustc 1.64.0-dev running on x86_64-unknown-linux-gnu
>
>note: compiler flags: -Z ui-testing
>
>query stack during panic:
>#0 [try_normalize_generic_arg_after_erasing_regions] normalizing `<[closure@$DIR/ice.rs:LL:CC] as core::ops::function::FnOnce<(&S,)>>::Output`
>end of query stack
>
>Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
>note: the place in the program where the ICE was triggered
>  --> $DIR/ice.rs:LL:CC
>   |
>LL |     fun(filter_positive());
>   |     ^^^^^^^^^^^^^^^^^^^^^^
>   |
>   = note: inside `with_positive::<[closure@$DIR/ice.rs:LL:CC]>` at $DIR/ice.rs:LL:CC
>note: inside `main` at $DIR/ice.rs:LL:CC
>  --> $DIR/ice.rs:LL:CC
>   |
>LL |     with_positive(|_| ());
>   |     ^^^^^^^^^^^^^^^^^^^^^
>   = note: inside `<fn() as std::ops::FnOnce<()>>::call_once - shim(fn())` at RUSTLIB/core/src/ops/function.rs:LL:CC
>   = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
>   = note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at RUSTLIB/core/src/ops/function.rs:LL:CC
>   = note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
>   = note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
>   = note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panic.rs:LL:CC
>   = note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
>   = note: inside `std::panicking::r#try::do_call::<[closure@std::rt::lang_start_internal::{closure#2}], isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
>   = note: inside `std::panicking::r#try::<isize, [closure@std::rt::lang_start_internal::{closure#2}]>` at RUSTLIB/std/src/panicking.rs:LL:CC
>   = note: inside `std::panic::catch_unwind::<[closure@std::rt::lang_start_internal::{closure#2}], isize>` at RUSTLIB/std/src/panic.rs:LL:CC
>   = note: inside `std::rt::lang_start_internal` at RUSTLIB/std/src/rt.rs:LL:CC
>   = note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC
>
>error: internal compiler error: no errors encountered even though `delay_span_bug` issued
>
>error: internal compiler error: VecMap([(OpaqueTypeKey { def_id: DefId(0:7 ~ ice[ec0d]::Alias::{opaque#0}), substs: ['_#0r] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: no-location (#0), ty: &S }, origin: TyAlias })])
>   |
>   = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:LL:CC
>
>thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:LL:CC
>stack backtrace:
>   0: std::backtrace_rs::backtrace::libunwind::trace::h45c496ed2150e509
> at RUSTLIB/std/src/../../backtrace/src/backtrace/libunwind.rs:LL:CC
>   1: std::backtrace_rs::backtrace::trace_unsynchronized::h4a55eb92770e244f
> at RUSTLIB/std/src/../../backtrace/src/backtrace/mod.rs:LL:CC
>   2: std::sys_common::backtrace::_print_fmt::h0821ded70d0475c9
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbbb39798153b4dd1
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   4: core::fmt::write::hdf3432484eef9649
> at RUSTLIB/core/src/fmt/mod.rs:LL:CC
>   5: std::io::Write::write_fmt::had572b91d539a41b
> at RUSTLIB/std/src/io/mod.rs:LL:CC
>   6: std::sys_common::backtrace::_print::h8a2961faada59383
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   7: std::sys_common::backtrace::print::h6e3d32371dd00b05
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>   8: std::panicking::default_hook::{{closure}}::he6c029a195cbaf5c
>   9: std::panicking::default_hook::h32158034ae7d775d
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  10: <alloc[13b3ae67d8724159]::boxed::Box<dyn for<'a, 'b> core[5b8050c91244cb8c]::ops::function::Fn<(&'a core[5b8050c91244cb8c]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[5b8050c91244cb8c]::marker::Sync + core[5b8050c91244cb8c]::marker::Send> as core[5b8050c91244cb8c]::ops::function::Fn<(&core[5b8050c91244cb8c]::panic::panic_info::PanicInfo,)>>::call
> at RUSTLIB/alloc/src/boxed.rs:LL:CC
>  11: rustc_driver[ad1eb020797fdf50]::DEFAULT_HOOK::{closure#0}::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_driver/src/lib.rs:LL:CC
>  12: std::panicking::rust_panic_with_hook::hbeeb00606897b943
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  13: std[d84d995932d417c4]::panicking::begin_panic::{closure#0}
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  14: std[d84d995932d417c4]::sys_common::backtrace::__rust_end_short_backtrace
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>  15: std[d84d995932d417c4]::panicking::begin_panic
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  16: std[d84d995932d417c4]::panic::panic_any
> at RUSTLIB/std/src/panic.rs:LL:CC
>  17: <rustc_errors[1f2e9c39b045ec0e]::HandlerInner>::flush_delayed
> at /home/r/src/rust/rustc/compiler/rustc_errors/src/lib.rs:LL:CC
>  18: <rustc_errors[1f2e9c39b045ec0e]::HandlerInner as core[5b8050c91244cb8c]::ops::drop::Drop>::drop
> at /home/r/src/rust/rustc/compiler/rustc_errors/src/lib.rs:LL:CC
>  19: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  20: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  21: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  22: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  23: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  24: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  25: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  26: <alloc[13b3ae67d8724159]::rc::Rc<rustc_session[e1ca85e9ac1110a0]::session::Session> as core[5b8050c91244cb8c]::ops::drop::Drop>::drop
> at RUSTLIB/alloc/src/rc.rs:LL:CC
>  27: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  28: core[5b8050c91244cb8c]::ptr::drop_in_place
> at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>  29: rustc_interface[d35721db742c9398]::interface::create_compiler_and_run::{closure#1}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/interface.rs:LL:CC
>  30: rustc_span[6115e481c46720f9]::with_source_map
> at /home/r/src/rust/rustc/compiler/rustc_span/src/lib.rs:LL:CC
>  31: rustc_interface[d35721db742c9398]::interface::create_compiler_and_run
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/interface.rs:LL:CC
>  32: rustc_interface[d35721db742c9398]::interface::run_compiler::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/interface.rs:LL:CC
>  33: <scoped_tls[e354f08e85e11ec1]::ScopedKey<rustc_span[6115e481c46720f9]::SessionGlobals>>::set
> at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:LL:CC
>  34: rustc_span[6115e481c46720f9]::create_session_globals_then
> at /home/r/src/rust/rustc/compiler/rustc_span/src/lib.rs:LL:CC
>  35: rustc_interface[d35721db742c9398]::util::run_in_thread_pool_with_globals::{closure#0}
> at /home/r/src/rust/rustc/compiler/rustc_interface/src/util.rs:LL:CC
>  36: std[d84d995932d417c4]::sys_common::backtrace::__rust_begin_short_backtrace
> at RUSTLIB/std/src/sys_common/backtrace.rs:LL:CC
>  37: <std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_::{closure#1}::{closure#0}
> at RUSTLIB/std/src/thread/mod.rs:LL:CC
>  38: <core[5b8050c91244cb8c]::panic::unwind_safe::AssertUnwindSafe<<std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_<rustc_interface[d35721db742c9398]::util::run_in_thread_pool_with_globals<rustc_interface[d35721db742c9398]::interface::run_compiler<core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>, rustc_driver[ad1eb020797fdf50]::run_compiler::{closure#1}>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#1}::{closure#0}> as core[5b8050c91244cb8c]::ops::function::FnOnce<()>>::call_once
> at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
>  39: std[d84d995932d417c4]::panicking::try::do_call
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  40: std[d84d995932d417c4]::panicking::try
> at RUSTLIB/std/src/panicking.rs:LL:CC
>  41: std[d84d995932d417c4]::panic::catch_unwind
> at RUSTLIB/std/src/panic.rs:LL:CC
>  42: <std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_::{closure#1}
> at RUSTLIB/std/src/thread/mod.rs:LL:CC
>  43: <<std[d84d995932d417c4]::thread::Builder>::spawn_unchecked_<rustc_interface[d35721db742c9398]::util::run_in_thread_pool_with_globals<rustc_interface[d35721db742c9398]::interface::run_compiler<core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>, rustc_driver[ad1eb020797fdf50]::run_compiler::{closure#1}>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#0}, core[5b8050c91244cb8c]::result::Result<(), rustc_errors[1f2e9c39b045ec0e]::ErrorGuaranteed>>::{closure#1} as core[5b8050c91244cb8c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
> at RUSTLIB/core/src/ops/function.rs:LL:CC
>  44: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8a1dda340491a5ac
> at RUSTLIB/alloc/src/boxed.rs:LL:CC
>  45: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he8a925ef37b3c273
> at RUSTLIB/alloc/src/boxed.rs:LL:CC
>  46: std::sys::PLATFORM::thread::Thread::new::thread_start::h65cc7689d5c2f187
> at RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC
>  47: start_thread
>                               at ./nptl/./nptl/pthread_create.c:435:8
>  48: __GI___clone3
>                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
>  49: <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-dev running on x86_64-unknown-linux-gnu
>
>note: compiler flags: -Z ui-testing
>
>query stack during panic:
>end of query stack
>thread panicked while panicking. aborting.

@ouz-a which error did you get after reverting, was it just some ICE or exactly the ICE that @matthiaskrgr reported?

@RalfJung
Copy link
Member

Okay so this is fascinating. With just the first two PRs of the rollup, I get the above ICE. That is almost certainly rust-lang/rust#99345 (since the only other PR included yet is something about Apple Watch). When I also include rust-lang/rust#99383, I get the ICE @matthiaskrgr reports.

@RalfJung
Copy link
Member

Yeah I think we are actually seeing 2 ICEs in one example. If I merge either rust-lang/rust#99345 or rust-lang/rust#99383, I get an ICE.

@compiler-errors
Copy link
Member

@RalfJung how does one reproduce this error? I don't know how to pass a UI test to a locally built Miri.

@RalfJung
Copy link
Member

Who are the people to ping for TAIT trouble? @oli-obk and @lcnr I guess?

@compiler-errors
Copy link
Member

compiler-errors commented Aug 23, 2022

For the record, I checked out rust-lang/rust@d60d88f, which is bors merge commit directly prior to the rollup mentioned in this issue. The ICE that was mentioned in this comment reproduces on that commit as well. (at least, I think I tested it correctly...)

Note that it's a debug assertion in try_normalize_after_erasing_regions, so it has probably failed for much longer, but can't be bisected because AFAICT we don't have debug assertions enabled on nightly artifacts.

The ICE that @matthiaskrgr reported at the beginning of this issue is almost certainly due to rust-lang/rust#99383, and the debug assertion that is seen when one tries to reproduce it locally by checking out a commit in the repo and building locally is probably unrelated. It's probably worthwhile to investigate both. I know opaques pretty well and I might spend some time looking at it tonight.

@RalfJung
Copy link
Member

@RalfJung how does one reproduce this error? I don't know how to pass a UI test to a locally built Miri.

After checking out this repo, you can do

./rustup-toolchain
./miri run filename.rs

to run a file with a main function. (That's not 'compiletest', i.e. there is no magic comment interpretation, but that is not needed for this issue.)

For the record, I checked out rust-lang/rust@d60d88f, which is bors merge commit directly prior to the rollup mentioned in this issue. The ICE that was mentioned in #2433 (comment) reproduces on that commit as well. (at least, I think I tested it correctly...)

Strange, I did the same and couldn't reproduce. But it is also possible I made a mistake, between my too-many-checkouts, so I'll try again.

@RalfJung
Copy link
Member

RalfJung commented Aug 23, 2022

Note that it's a debug assertion in try_normalize_after_erasing_regions, so it has probably failed for much longer, but can't be bisected because AFAICT we don't have debug assertions enabled on nightly artifacts.

Oh, good point. When I tried to reproduce I did that with a release build, later when I tested the individual parts of the rollup I used a local rustc build with debug assertions.

So rust-lang/rust#99345 is probably innocent, sorry for the noise.
EDIT: Confirmed, I also get the ICE on rust-lang/rust@d60d88f when debug assertions are on.

The ICE that @matthiaskrgr reported at the beginning of this issue is almost certainly due to rust-lang/rust#99383, and the debug assertion that is seen when one tries to reproduce it locally by checking out a commit in the repo and building locally is probably unrelated. It's probably worthwhile to investigate both.

Yeah... also that debug assertion means when one uses a local build to try and fix the problem (e.g. by reverting rust-lang/rust#99383, as a first test), one still gets an ICE.

I know opaques pretty well and I might spend some time looking at it tonight.

That would be great. :) I am at a complete loss here, I don't know this stuff at all.

@RalfJung
Copy link
Member

By applying @bjorn3 's suggestion to turn DefiningAnchor::Error back into DefiningAnchor::Bubble, I can change it back to the previous debug assertion ICE. So without debug assertions this would probably fix Miri.

@compiler-errors
Copy link
Member

@oli-obk:

Though... in RevealAll mode we should never actually constrain an opaque type and instead be revealing them... that's probably a bug in rustc.

This is due to rust-lang/rust@a84e3fa. Removing that causes this ICE to go away on master. Might be worth revisiting rust-lang/rust#89285 and formulating a better fix.

@RalfJung
Copy link
Member

By applying @bjorn3 's suggestion to turn DefiningAnchor::Error back into DefiningAnchor::Bubble, I can change it back to the previous debug assertion ICE. So without debug assertions this would probably fix Miri.

I submitted that as rust-lang/rust#100918.

But we cannot really add this as a test if it still fails with debug assertions enabled; that would break any time I do ./miri test against a locally built rustc.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 23, 2022
add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc rust-lang/miri#2433
r? `@oli-obk`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 23, 2022
add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc rust-lang/miri#2433
r? `@oli-obk`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 23, 2022
add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc rust-lang/miri#2433
r? ``@oli-obk``
oli-obk pushed a commit to oli-obk/miri that referenced this issue Sep 26, 2022
add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc rust-lang#2433
r? ``@oli-obk``
RalfJung pushed a commit to RalfJung/miri that referenced this issue Oct 4, 2022
add regression test for miri issue 2433

Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace.

Cc rust-lang#2433
r? ``@oli-obk``
@RalfJung
Copy link
Member

This bug exists again now due to a revert, but it's a rustc bug so we track it at rust-lang/rust#104601.

bors added a commit to rust-lang-ci/rust that referenced this issue Nov 20, 2022
…_regions, r=oli-obk

try_normalize_after_erasing_regions: promote an assertion to always run

In rust-lang/miri#2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.
RalfJung pushed a commit to RalfJung/miri that referenced this issue Nov 20, 2022
… r=oli-obk

try_normalize_after_erasing_regions: promote an assertion to always run

In rust-lang#2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interpreter Area: affects the core interpreter C-bug Category: This is a bug. I-ICE Impact: makes Miri crash with some ICE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants