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: nested return types #116383

Closed
matthiaskrgr opened this issue Oct 3, 2023 · 5 comments · Fixed by #116415
Closed

ICE: nested return types #116383

matthiaskrgr opened this issue Oct 3, 2023 · 5 comments · Fixed by #116415
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

Code

-Zvalidate-mir
reduced from #107346

trait Duh {}

impl Duh for i32 {}

trait Trait {
    type Assoc: Duh;
}

impl<R: Duh, F: FnMut() -> R> Trait for F {
    type Assoc = R;
}

fn foo() -> impl Trait<Assoc = impl Send> {
    || 42
}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.75.0-nightly (eb0f3ed59 2023-10-03)
binary: rustc
commit-hash: eb0f3ed59c6508a37c6598bc9762987f053993a7
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2

Error output

<output>
Backtrace

warning: function `foo` is never used
  --> 107346.rs:18:4
   |
18 | fn foo() -> impl Trait<Assoc = impl Send> {
   |    ^^^
   |
   = note: `#[warn(dead_code)]` on by default

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

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (after pass Subtyper) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (before pass CleanupPostBorrowck) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (after pass CleanupPostBorrowck) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (before pass RemoveNoopLandingPads) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (after pass RemoveNoopLandingPads) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (before pass SimplifyCfg-early-opt) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (after pass SimplifyCfg-early-opt) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (before pass Derefer) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (after pass Derefer) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::validate_body
         5: rustc_mir_transform::pass_manager::run_passes_inner
         6: rustc_mir_transform::run_analysis_to_runtime_passes
         7: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: 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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_interface::passes::analysis
        12: 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]>>
        13: 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>
        14: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        15: 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>>
        16: <<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}
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        19: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        20: <unknown>
        21: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:11 ~ 107346[3e7c]::foo)) (after phase change to analysis-post-cleanup) at bb0[1]:
                                Failed subtyping Alias(
                                    Opaque,
                                    AliasTy {
                                        args: [
                                        ],
                                        def_id: DefId(0:14 ~ 107346[3e7c]::foo::{opaque#0}),
                                    },
                                ) and Closure(
                                    DefId(0:12 ~ 107346[3e7c]::foo::{closure#0}),
                                    [
                                    i8,
                                    Binder(extern "RustCall" fn(()) -> i32, []),
                                    (),
                                    ],
                                )
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^
   |
note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:96:25
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
         2: <rustc_const_eval::transform::validate::CfgChecker>::fail::<alloc::string::String>
         3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         4: rustc_mir_transform::pass_manager::run_passes_inner
         5: rustc_mir_transform::run_analysis_to_runtime_passes
         6: rustc_mir_transform::mir_drops_elaborated_and_const_checked
         7: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         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; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
         9: rustc_query_impl::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
        10: rustc_interface::passes::analysis
        11: 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]>>
        12: 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>
        13: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        14: 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>>
        15: <<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}
        16: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        17: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/alloc/src/boxed.rs:2007:9
        18: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/eb0f3ed59c6508a37c6598bc9762987f053993a7/library/std/src/sys/unix/thread.rs:108:17
        19: <unknown>
        20: <unknown>
  --> 107346.rs:19:5
   |
19 |     || 42
   |     ^^^^^

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: please attach the file at `/tmp/im/rustc-ice-2023-10-03T13:49:46.115359487Z-2977928.txt` to your bug report

note: compiler flags: -Z validate-mir

query stack during panic:
end of query stack
error: aborting due to 11 previous errors; 1 warning emitted

@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 3, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 3, 2023
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Oct 3, 2023

also with validate mir

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

pub fn main() {}

@matthiaskrgr
Copy link
Member Author

--edition=2021 -Zvalidate-mir

#![feature(async_await)]
#![feature(unsized_locals)]

async fn f() {}

async fn g(x: Box<dyn core::fmt::Display>) {
    let _x = *x;
    f().await;
}

fn main() {
    let _a = g(Box::new(5));
}

@matthiaskrgr
Copy link
Member Author

--edition=2021 -Zvalidate-mir

#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]

type F = impl core::future::Future<Output = u8>;

struct Bug {
    V1: [(); {
        fn concrete_use() -> F {
            async {}
        }
        let f: F = async { 1 };
        1
    }],
}

fn main() {}

@matthiaskrgr
Copy link
Member Author

Regression in eb0f3ed
#115025
cc @ouz-a

@ouz-a
Copy link
Contributor

ouz-a commented Oct 3, 2023

First two runs fine on #116378 (which contains ProjectionElem::Subtype and newly added fixes) but others err without ICE I think, that's intended/normal behaviour ?

So #116378 will fix this issue too

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 5, 2023
Move subtyper below reveal_all and change reveal_all

In previous attempt rust-lang#116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist.

r? `@oli-obk`

Fixes rust-lang#116332
Fixes rust-lang#116265
Fixes rust-lang#116383
Fixes rust-lang#116333
@bors bors closed this as completed in 08cc742 Oct 5, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 5, 2023
Rollup merge of rust-lang#116415 - ouz-a:move_subtyper, r=oli-obk

Move subtyper below reveal_all and change reveal_all

In previous attempt rust-lang#116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist.

r? ``@oli-obk``

Fixes rust-lang#116332
Fixes rust-lang#116265
Fixes rust-lang#116383
Fixes rust-lang#116333
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 5, 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
4 participants