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: -Zdrop-tracking: Broken MIR: generator contains type &u32 in MIR, but typeck only knows about #101243

Closed
matthiaskrgr opened this issue Aug 31, 2022 · 2 comments
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

./src/test/ui/async-await/issue-73137.rs

Code

// Regression test for <https://github.com/rust-lang/rust/issues/73137>

// run-pass
// edition:2018

#![allow(dead_code)]
use std::future::Future;
use std::task::{Waker, Wake, Context};
use std::sync::Arc;

struct DummyWaker;
impl Wake for DummyWaker {
    fn wake(self: Arc<Self>) {}
}

struct Foo {
    a: usize,
    b: &'static u32,
}

#[inline(never)]
fn nop<T>(_: T) {}

fn main() {
    let mut fut = Box::pin(async {
        let action = Foo {
            b: &42,
            a: async { 0 }.await,
        };

        // An error in the generator transform caused `b` to be overwritten with `a` when `b` was
        // borrowed.
        nop(&action.b);
        assert_ne!(0usize, unsafe { std::mem::transmute(action.b) });

        async {}.await;
    });
    let waker = Waker::from(Arc::new(DummyWaker));
    let mut cx = Context::from_waker(&waker);
    let _ = fut.as_mut().poll(&mut cx);
}

Meta

rustc --version --verbose:

rustc 1.65.0-nightly (4fd4de7ea 2022-08-31)
binary: rustc
commit-hash: 4fd4de7ea358ad6fc28c5780533ea8ccc09e1006
commit-date: 2022-08-31
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

rustc ./issue-73137.rs -Zvalidate-mir -Zdrop-tracking --edition=2021

<output>
Backtrace

error: internal compiler error: compiler/rustc_mir_transform/src/generator.rs:760:13: Broken MIR: generator contains type &u32 in MIR, but typeck only knows about {ResumeTy, u32, impl Future<Output = usize>, (), Foo, impl Future<Output = ()>} and []
  --> ./issue-73137.rs:25:34
   |
25 |       let mut fut = Box::pin(async {
   |  __________________________________^
26 | |         let action = Foo {
27 | |             b: &42,
28 | |             a: async { 0 }.await,
...  |
36 | |         async {}.await;
37 | |     });
   | |_____^

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/compiler/rustc_errors/src/lib.rs:1393:9
stack backtrace:
   0:     0x7f2a582c0520 - std::backtrace_rs::backtrace::libunwind::trace::ha93b1d4802475003
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f2a582c0520 - std::backtrace_rs::backtrace::trace_unsynchronized::h40d7f2da011bd85b
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2a582c0520 - std::sys_common::backtrace::_print_fmt::hd4c318607ed6977d
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f2a582c0520 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3d1dee5bf49c390e
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f2a5831b24e - core::fmt::write::h5629927f37465513
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f2a582b11b5 - std::io::Write::write_fmt::h41e38f576096734b
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/io/mod.rs:1672:15
   6:     0x7f2a582c31e3 - std::sys_common::backtrace::_print::hb4df1a69959f2fbc
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f2a582c31e3 - std::sys_common::backtrace::print::h7093396eb4e737fc
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f2a582c31e3 - std::panicking::default_hook::{{closure}}::h044155a56acd855d
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:295:22
   9:     0x7f2a582c2ecf - std::panicking::default_hook::hf2b314c3c2ce4158
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:314:9
  10:     0x7f2a5aaf1cd1 - rustc_driver[5c6f06715f70ec5d]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f2a582c3a1d - std::panicking::rust_panic_with_hook::he1240b7f7e10f2ad
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:702:17
  12:     0x7f2a5acbd7e1 - std[f534759d154ebe3c]::panicking::begin_panic::<rustc_errors[796597d4f3161658]::ExplicitBug>::{closure#0}
  13:     0x7f2a5acbb5c6 - std[f534759d154ebe3c]::sys_common::backtrace::__rust_end_short_backtrace::<std[f534759d154ebe3c]::panicking::begin_panic<rustc_errors[796597d4f3161658]::ExplicitBug>::{closure#0}, !>
  14:     0x7f2a5ad29506 - std[f534759d154ebe3c]::panicking::begin_panic::<rustc_errors[796597d4f3161658]::ExplicitBug>
  15:     0x7f2a5ad5de46 - std[f534759d154ebe3c]::panic::panic_any::<rustc_errors[796597d4f3161658]::ExplicitBug>
  16:     0x7f2a5ad5bfe1 - <rustc_errors[796597d4f3161658]::HandlerInner>::span_bug::<rustc_span[50cd62b67dc70a93]::span_encoding::Span, &alloc[4886e805f51c44d9]::string::String>
  17:     0x7f2a5ad5bd50 - <rustc_errors[796597d4f3161658]::Handler>::span_bug::<rustc_span[50cd62b67dc70a93]::span_encoding::Span, &alloc[4886e805f51c44d9]::string::String>
  18:     0x7f2a5ad915e8 - rustc_middle[add6c9fd911342e9]::ty::context::tls::with_context_opt::<rustc_middle[add6c9fd911342e9]::ty::context::tls::with_opt<rustc_middle[add6c9fd911342e9]::util::bug::opt_span_bug_fmt<rustc_span[50cd62b67dc70a93]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7f2a5ad91486 - rustc_middle[add6c9fd911342e9]::util::bug::opt_span_bug_fmt::<rustc_span[50cd62b67dc70a93]::span_encoding::Span>
  20:     0x7f2a5ad91444 - rustc_middle[add6c9fd911342e9]::util::bug::span_bug_fmt::<rustc_span[50cd62b67dc70a93]::span_encoding::Span>
  21:     0x7f2a5ad21cb8 - <rustc_mir_transform[3470d32207b6ec65]::generator::StateTransform as rustc_middle[add6c9fd911342e9]::mir::MirPass>::run_pass
  22:     0x7f2a59a783ea - rustc_mir_transform[3470d32207b6ec65]::pass_manager::run_passes
  23:     0x7f2a59a776f8 - rustc_mir_transform[3470d32207b6ec65]::optimized_mir
  24:     0x7f2a59f08d49 - rustc_query_system[75687cb75a2aeeea]::query::plumbing::try_execute_query::<rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt, rustc_query_system[75687cb75a2aeeea]::query::caches::DefaultCache<rustc_span[50cd62b67dc70a93]::def_id::DefId, &rustc_middle[add6c9fd911342e9]::mir::Body>>
  25:     0x7f2a5a9ecd01 - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::optimized_mir
  26:     0x7f2a5ba9649c - <rustc_middle[add6c9fd911342e9]::ty::context::TyCtxt>::generator_layout
  27:     0x7f2a5a1e5a85 - <rustc_middle[add6c9fd911342e9]::ty::layout::LayoutCx<rustc_middle[add6c9fd911342e9]::ty::context::TyCtxt>>::layout_of_uncached
  28:     0x7f2a5a1e061c - rustc_middle[add6c9fd911342e9]::ty::layout::layout_of
  29:     0x7f2a59ddd63c - rustc_query_system[75687cb75a2aeeea]::query::plumbing::get_query::<rustc_query_impl[97dc23318a222c55]::queries::layout_of, rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt>
  30:     0x7f2a59ddd22e - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::layout_of
  31:     0x7f2a59ba2cdb - <core[11ae8b9faed64a6a]::iter::adapters::GenericShunt<core[11ae8b9faed64a6a]::iter::adapters::map::Map<core[11ae8b9faed64a6a]::slice::iter::Iter<rustc_middle[add6c9fd911342e9]::ty::FieldDef>, <rustc_middle[add6c9fd911342e9]::ty::layout::LayoutCx<rustc_middle[add6c9fd911342e9]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[11ae8b9faed64a6a]::result::Result<core[11ae8b9faed64a6a]::convert::Infallible, rustc_middle[add6c9fd911342e9]::ty::layout::LayoutError>> as core[11ae8b9faed64a6a]::iter::traits::iterator::Iterator>::next
  32:     0x7f2a59ba1e85 - <alloc[4886e805f51c44d9]::vec::Vec<alloc[4886e805f51c44d9]::vec::Vec<rustc_target[c88c38f15033a39e]::abi::TyAndLayout<rustc_middle[add6c9fd911342e9]::ty::Ty>>> as alloc[4886e805f51c44d9]::vec::spec_from_iter::SpecFromIter<alloc[4886e805f51c44d9]::vec::Vec<rustc_target[c88c38f15033a39e]::abi::TyAndLayout<rustc_middle[add6c9fd911342e9]::ty::Ty>>, core[11ae8b9faed64a6a]::iter::adapters::GenericShunt<core[11ae8b9faed64a6a]::iter::adapters::map::Map<core[11ae8b9faed64a6a]::slice::iter::Iter<rustc_middle[add6c9fd911342e9]::ty::VariantDef>, <rustc_middle[add6c9fd911342e9]::ty::layout::LayoutCx<rustc_middle[add6c9fd911342e9]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[11ae8b9faed64a6a]::result::Result<core[11ae8b9faed64a6a]::convert::Infallible, rustc_middle[add6c9fd911342e9]::ty::layout::LayoutError>>>>::from_iter
  33:     0x7f2a5a1e1543 - <rustc_middle[add6c9fd911342e9]::ty::layout::LayoutCx<rustc_middle[add6c9fd911342e9]::ty::context::TyCtxt>>::layout_of_uncached
  34:     0x7f2a5a1e061c - rustc_middle[add6c9fd911342e9]::ty::layout::layout_of
  35:     0x7f2a59ddd63c - rustc_query_system[75687cb75a2aeeea]::query::plumbing::get_query::<rustc_query_impl[97dc23318a222c55]::queries::layout_of, rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt>
  36:     0x7f2a59ddd22e - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::layout_of
  37:     0x7f2a5a1e0c9e - rustc_middle[add6c9fd911342e9]::ty::layout::layout_of
  38:     0x7f2a59ddd63c - rustc_query_system[75687cb75a2aeeea]::query::plumbing::get_query::<rustc_query_impl[97dc23318a222c55]::queries::layout_of, rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt>
  39:     0x7f2a59ddd22e - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::layout_of
  40:     0x7f2a5a052410 - <rustc_mir_transform[3470d32207b6ec65]::const_prop::CanConstProp>::check
  41:     0x7f2a5a049413 - <rustc_mir_transform[3470d32207b6ec65]::const_prop_lint::ConstProp as rustc_mir_transform[3470d32207b6ec65]::pass_manager::MirLint>::run_lint
  42:     0x7f2a59a783ea - rustc_mir_transform[3470d32207b6ec65]::pass_manager::run_passes
  43:     0x7f2a59f57bfd - rustc_mir_transform[3470d32207b6ec65]::mir_drops_elaborated_and_const_checked
  44:     0x7f2a59f3109a - rustc_query_system[75687cb75a2aeeea]::query::plumbing::try_execute_query::<rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt, rustc_query_system[75687cb75a2aeeea]::query::caches::DefaultCache<rustc_middle[add6c9fd911342e9]::ty::WithOptConstParam<rustc_span[50cd62b67dc70a93]::def_id::LocalDefId>, &rustc_data_structures[c9379b3b210c0309]::steal::Steal<rustc_middle[add6c9fd911342e9]::mir::Body>>>
  45:     0x7f2a5a9eca3c - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::mir_drops_elaborated_and_const_checked
  46:     0x7f2a59a77557 - rustc_mir_transform[3470d32207b6ec65]::optimized_mir
  47:     0x7f2a59f08d49 - rustc_query_system[75687cb75a2aeeea]::query::plumbing::try_execute_query::<rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt, rustc_query_system[75687cb75a2aeeea]::query::caches::DefaultCache<rustc_span[50cd62b67dc70a93]::def_id::DefId, &rustc_middle[add6c9fd911342e9]::mir::Body>>
  48:     0x7f2a5a9ecd01 - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::optimized_mir
  49:     0x7f2a59726e4b - <rustc_middle[add6c9fd911342e9]::ty::context::TyCtxt>::instance_mir
  50:     0x7f2a5971b9fc - rustc_monomorphize[b4deb07e5884565e]::collector::collect_neighbours
  51:     0x7f2a5971959f - rustc_monomorphize[b4deb07e5884565e]::collector::collect_items_rec
  52:     0x7f2a5a166f96 - rustc_data_structures[c9379b3b210c0309]::sync::par_for_each_in::<alloc[4886e805f51c44d9]::vec::Vec<rustc_middle[add6c9fd911342e9]::mir::mono::MonoItem>, rustc_monomorphize[b4deb07e5884565e]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
  53:     0x7f2a5a166e2c - <rustc_session[248254b91735aa9a]::session::Session>::time::<(), rustc_monomorphize[b4deb07e5884565e]::collector::collect_crate_mono_items::{closure#1}>
  54:     0x7f2a5a166a99 - rustc_monomorphize[b4deb07e5884565e]::collector::collect_crate_mono_items
  55:     0x7f2a5a1659d5 - rustc_monomorphize[b4deb07e5884565e]::partitioning::collect_and_partition_mono_items
  56:     0x7f2a5a84c3b1 - rustc_query_system[75687cb75a2aeeea]::query::plumbing::try_execute_query::<rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt, rustc_query_system[75687cb75a2aeeea]::query::caches::DefaultCache<(), (&std[f534759d154ebe3c]::collections::hash::set::HashSet<rustc_span[50cd62b67dc70a93]::def_id::DefId, core[11ae8b9faed64a6a]::hash::BuildHasherDefault<rustc_hash[ed04fe45a9817582]::FxHasher>>, &[rustc_middle[add6c9fd911342e9]::mir::mono::CodegenUnit])>>
  57:     0x7f2a5a84c087 - rustc_query_system[75687cb75a2aeeea]::query::plumbing::get_query::<rustc_query_impl[97dc23318a222c55]::queries::collect_and_partition_mono_items, rustc_query_impl[97dc23318a222c55]::plumbing::QueryCtxt>
  58:     0x7f2a5a84bfd2 - <rustc_query_impl[97dc23318a222c55]::Queries as rustc_middle[add6c9fd911342e9]::ty::query::QueryEngine>::collect_and_partition_mono_items
  59:     0x7f2a5a587f22 - rustc_codegen_ssa[1a32b33bb5079770]::base::codegen_crate::<rustc_codegen_llvm[e3b0dc38ac611ef6]::LlvmCodegenBackend>
  60:     0x7f2a5a587cee - <rustc_codegen_llvm[e3b0dc38ac611ef6]::LlvmCodegenBackend as rustc_codegen_ssa[1a32b33bb5079770]::traits::backend::CodegenBackend>::codegen_crate
  61:     0x7f2a5a3b2716 - <rustc_interface[72ffc69696572c14]::passes::QueryContext>::enter::<<rustc_interface[72ffc69696572c14]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[11ae8b9faed64a6a]::result::Result<alloc[4886e805f51c44d9]::boxed::Box<dyn core[11ae8b9faed64a6a]::any::Any>, rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  62:     0x7f2a5a3ac113 - <rustc_interface[72ffc69696572c14]::queries::Queries>::ongoing_codegen
  63:     0x7f2a5a3ab1c1 - <rustc_interface[72ffc69696572c14]::interface::Compiler>::enter::<rustc_driver[5c6f06715f70ec5d]::run_compiler::{closure#1}::{closure#2}, core[11ae8b9faed64a6a]::result::Result<core[11ae8b9faed64a6a]::option::Option<rustc_interface[72ffc69696572c14]::queries::Linker>, rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  64:     0x7f2a5a3a64ac - rustc_span[50cd62b67dc70a93]::with_source_map::<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_interface[72ffc69696572c14]::interface::create_compiler_and_run<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_driver[5c6f06715f70ec5d]::run_compiler::{closure#1}>::{closure#1}>
  65:     0x7f2a5a3a5f32 - rustc_interface[72ffc69696572c14]::interface::create_compiler_and_run::<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_driver[5c6f06715f70ec5d]::run_compiler::{closure#1}>
  66:     0x7f2a5a3a4ad1 - <scoped_tls[35f9cd4d9e5ad004]::ScopedKey<rustc_span[50cd62b67dc70a93]::SessionGlobals>>::set::<rustc_interface[72ffc69696572c14]::interface::run_compiler<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_driver[5c6f06715f70ec5d]::run_compiler::{closure#1}>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  67:     0x7f2a5a3a47bf - std[f534759d154ebe3c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[72ffc69696572c14]::util::run_in_thread_pool_with_globals<rustc_interface[72ffc69696572c14]::interface::run_compiler<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_driver[5c6f06715f70ec5d]::run_compiler::{closure#1}>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  68:     0x7f2a5a917299 - <<std[f534759d154ebe3c]::thread::Builder>::spawn_unchecked_<rustc_interface[72ffc69696572c14]::util::run_in_thread_pool_with_globals<rustc_interface[72ffc69696572c14]::interface::run_compiler<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_driver[5c6f06715f70ec5d]::run_compiler::{closure#1}>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>::{closure#1} as core[11ae8b9faed64a6a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7f2a582cd643 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4ef6136079acdd61
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/alloc/src/boxed.rs:1940:9
  70:     0x7f2a582cd643 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc9c7585f1bc6dc48
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/alloc/src/boxed.rs:1940:9
  71:     0x7f2a582cd643 - std::sys::unix::thread::Thread::new::thread_start::h42bde6fadc2c36dd
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys/unix/thread.rs:108:17
  72:     0x7f2a5802778d - <unknown>
  73:     0x7f2a580a88e4 - clone
  74:                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.65.0-nightly (c07a8b4e0 2022-08-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z validate-mir -Z drop-tracking

query stack during panic:
#0 [optimized_mir] optimizing MIR for `main::{closure#0}`
#1 [layout_of] computing layout of `[static generator@./issue-73137.rs:25:34: 37:6]`
#2 [layout_of] computing layout of `core::future::from_generator::GenFuture<[static generator@./issue-73137.rs:25:34: 37:6]>`
#3 [layout_of] computing layout of `impl core::future::future::Future<Output = ()>`
#4 [mir_drops_elaborated_and_const_checked] elaborating drops for `main`
#5 [optimized_mir] optimizing MIR for `main`
#6 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: aborting due to previous error

@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 Aug 31, 2022
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Aug 31, 2022

reduced:

struct Foo {
    a: usize,
    b: &'static u32,
}

fn main() {
    Box::pin(async {
        Foo {
            b: &42,
            a: async { 0 }.await,
        };
    });
}

@matthiaskrgr matthiaskrgr added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Sep 1, 2022
matthiaskrgr added a commit to matthiaskrgr/glacier that referenced this issue Sep 1, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Sep 2, 2022
@Alexendoo
Copy link
Member

Fixed by #101217

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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants