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: async fn coroutine return type not an inference variable #119890

Closed
matthiaskrgr opened this issue Jan 12, 2024 · 4 comments · Fixed by #120057
Closed

ice: async fn coroutine return type not an inference variable #119890

matthiaskrgr opened this issue Jan 12, 2024 · 4 comments · Fixed by #120057
Assignees
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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

auto-reduced (treereduce-rust):

mod first {
    trait Foo {
        async fn foo<'b>(self: &'b Foo<'a>) -> &() {
            self.0
        }
    }
}

original:

// run-rustfix
#![allow(dead_code)]
mod first {
    trait Foo {
    async fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
}
    fn foo<T: Foo>(a: T) {
        a.m(); //~ ERROR no method named `m` found
    }
}
mod second {
    use std::{
    rc::Rc,
    sync::Arc,
    pin::Pin,
};
    trait Bar { fn m(self: Arc<Self>); }
    fn bar(self: Box<Struct<'a>>, f: &u32) {
        b.m(); //~ ERROR no method named `m` found
    }
}

pub fn main() {
    let x: Box<_> = Box::new(X { a: 32 });
    let new_x = x.change();
    assert_eq!(new_x.a, 55);
}

Version information

rustc 1.77.0-nightly (bfd799f1a 2024-01-12)
binary: rustc
commit-hash: bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174
commit-date: 2024-01-12
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:3:9
  |
3 |         async fn foo<'b>(self: &'b Foo<'a>) -> &() {
  |         ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: pass `--edition 2021` to `rustc`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error[E0261]: use of undeclared lifetime name `'a`
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:3:40
  |
3 |         async fn foo<'b>(self: &'b Foo<'a>) -> &() {
  |                                        ^^ undeclared lifetime
  |
  = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
help: consider making the bound lifetime-generic with a new `'a` lifetime
  |
3 |         async fn foo<'b>(self: &'b for<'a> Foo<'a>) -> &() {
  |                                    +++++++
help: consider introducing lifetime `'a` here
  |
3 |         async fn foo<'a, 'b>(self: &'b Foo<'a>) -> &() {
  |                      +++
help: consider introducing lifetime `'a` here
  |
2 |     trait Foo<'a> {
  |              ++++

error[E0106]: missing lifetime specifier
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:3:48
  |
3 |         async fn foo<'b>(self: &'b Foo<'a>) -> &() {
  |                                -----------     ^ expected named lifetime parameter
  |
  = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
help: consider using the `'b` lifetime
  |
3 |         async fn foo<'b>(self: &'b Foo<'a>) -> &'b () {
  |                                                 ++

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:7:2
  |
7 | }
  |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs`

warning: trait objects without an explicit `dyn` are deprecated
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:3:36
  |
3 |         async fn foo<'b>(self: &'b Foo<'a>) -> &() {
  |                                    ^^^^^^^
  |
  = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
  = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
  = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
  |
3 |         async fn foo<'b>(self: &'b dyn Foo<'a>) -> &() {
  |                                    +++

error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:3:36
  |
3 |         async fn foo<'b>(self: &'b Foo<'a>) -> &() {
  |                                    ^^^---- help: remove these generics
  |                                    |
  |                                    expected 0 lifetime arguments
  |
note: trait defined here, with 0 lifetime parameters
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:2:11
  |
2 |     trait Foo {
  |           ^^^

error: internal compiler error: compiler/rustc_hir_typeck/src/closure.rs:806:18: async fn coroutine return type not an inference variable: impl Future<Output = &'b ()>
 --> /tmp/icemaker_global_tempdir.PQIGPyZRffct/rustc_testrunner_tmpdir_reporting.a6Tk4AGEOF1i/mvce.rs:3:52
  |
3 |           async fn foo<'b>(self: &'b Foo<'a>) -> &() {
  |  ____________________________________________________^
4 | |             self.0
5 | |         }
  | |_________^

thread 'rustc' panicked at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/compiler/rustc_errors/src/lib.rs:850:41:
Box<dyn Any>
stack backtrace:
   0:     0x7f1e657af7e6 - std::backtrace_rs::backtrace::libunwind::trace::h1bcd2ce8a0b49e2b
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f1e657af7e6 - std::backtrace_rs::backtrace::trace_unsynchronized::hec545b0bca077b29
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1e657af7e6 - std::sys_common::backtrace::_print_fmt::hb1dc0973745fe00f
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f1e657af7e6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc0965f21650fbdf2
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f1e65801ec0 - core::fmt::rt::Argument::fmt::h0c3fb88d931991e7
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/core/src/fmt/rt.rs:142:9
   5:     0x7f1e65801ec0 - core::fmt::write::h92f7f8a7341f441f
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f1e657a314f - std::io::Write::write_fmt::h107b5956b3204fe7
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/io/mod.rs:1810:15
   7:     0x7f1e657af5c4 - std::sys_common::backtrace::_print::haa043cdd6fa0fe1b
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f1e657af5c4 - std::sys_common::backtrace::print::h47b083459941ac2d
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f1e657b2357 - std::panicking::default_hook::{{closure}}::h474e4c3474397153
  10:     0x7f1e657b20b9 - std::panicking::default_hook::h3bc7fb22936a8edd
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/panicking.rs:292:9
  11:     0x7f1e62553b0c - std[f8082c656c94fd2d]::panicking::update_hook::<alloc[ef2fed1484295005]::boxed::Box<rustc_driver_impl[24914691d489c447]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f1e657b2aa6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h98798404485c082c
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/alloc/src/boxed.rs:2030:9
  13:     0x7f1e657b2aa6 - std::panicking::rust_panic_with_hook::hbfa459da89788d0f
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/panicking.rs:785:13
  14:     0x7f1e62585a34 - std[f8082c656c94fd2d]::panicking::begin_panic::<rustc_errors[70acbb675511353e]::ExplicitBug>::{closure#0}
  15:     0x7f1e62582336 - std[f8082c656c94fd2d]::sys_common::backtrace::__rust_end_short_backtrace::<std[f8082c656c94fd2d]::panicking::begin_panic<rustc_errors[70acbb675511353e]::ExplicitBug>::{closure#0}, !>
  16:     0x7f1e62581fa6 - std[f8082c656c94fd2d]::panicking::begin_panic::<rustc_errors[70acbb675511353e]::ExplicitBug>
  17:     0x7f1e625909e1 - <rustc_errors[70acbb675511353e]::diagnostic_builder::BugAbort as rustc_errors[70acbb675511353e]::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7f1e626db65d - rustc_middle[4be5b913d7bf3685]::util::bug::opt_span_bug_fmt::<rustc_span[e31def1030f5178]::span_encoding::Span>::{closure#0}
  19:     0x7f1e626dbb0a - rustc_middle[4be5b913d7bf3685]::ty::context::tls::with_opt::<rustc_middle[4be5b913d7bf3685]::util::bug::opt_span_bug_fmt<rustc_span[e31def1030f5178]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7f1e626ccd58 - rustc_middle[4be5b913d7bf3685]::ty::context::tls::with_context_opt::<rustc_middle[4be5b913d7bf3685]::ty::context::tls::with_opt<rustc_middle[4be5b913d7bf3685]::util::bug::opt_span_bug_fmt<rustc_span[e31def1030f5178]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7f1e618cc9b4 - rustc_middle[4be5b913d7bf3685]::util::bug::span_bug_fmt::<rustc_span[e31def1030f5178]::span_encoding::Span>
  22:     0x7f1e646ddafa - <rustc_hir_typeck[4037b9c3a0b702b2]::fn_ctxt::FnCtxt>::supplied_sig_of_closure
  23:     0x7f1e63edaa56 - <rustc_hir_typeck[4037b9c3a0b702b2]::fn_ctxt::FnCtxt>::check_expr_closure
  24:     0x7f1e642e0299 - <rustc_hir_typeck[4037b9c3a0b702b2]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:     0x7f1e63e67b08 - rustc_hir_typeck[4037b9c3a0b702b2]::check::check_fn
  26:     0x7f1e63ad21b6 - rustc_hir_typeck[4037b9c3a0b702b2]::typeck
  27:     0x7f1e63ad1535 - rustc_query_impl[5a6eb46947cbd595]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5a6eb46947cbd595]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>
  28:     0x7f1e63ceaab9 - rustc_query_system[8201af163ac5a48f]::query::plumbing::try_execute_query::<rustc_query_impl[5a6eb46947cbd595]::DynamicConfig<rustc_query_system[8201af163ac5a48f]::query::caches::VecCache<rustc_span[e31def1030f5178]::def_id::LocalDefId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5a6eb46947cbd595]::plumbing::QueryCtxt, false>
  29:     0x7f1e63cea750 - rustc_query_impl[5a6eb46947cbd595]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7f1e6481030b - rustc_hir_analysis[a63d9bfdcc7a8c2c]::collect::type_of::type_of_opaque
  31:     0x7f1e6481011b - rustc_query_impl[5a6eb46947cbd595]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5a6eb46947cbd595]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>
  32:     0x7f1e6385f4d4 - rustc_query_system[8201af163ac5a48f]::query::plumbing::try_execute_query::<rustc_query_impl[5a6eb46947cbd595]::DynamicConfig<rustc_query_system[8201af163ac5a48f]::query::caches::DefaultCache<rustc_span[e31def1030f5178]::def_id::DefId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5a6eb46947cbd595]::plumbing::QueryCtxt, false>
  33:     0x7f1e648487a2 - rustc_query_impl[5a6eb46947cbd595]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7f1e6385e06e - rustc_middle[4be5b913d7bf3685]::query::plumbing::query_get_at::<rustc_query_system[8201af163ac5a48f]::query::caches::DefaultCache<rustc_span[e31def1030f5178]::def_id::DefId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>>
  35:     0x7f1e61ac6f48 - rustc_hir_analysis[a63d9bfdcc7a8c2c]::collect::type_of::type_of
  36:     0x7f1e63860666 - rustc_query_impl[5a6eb46947cbd595]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5a6eb46947cbd595]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>
  37:     0x7f1e6385f4d4 - rustc_query_system[8201af163ac5a48f]::query::plumbing::try_execute_query::<rustc_query_impl[5a6eb46947cbd595]::DynamicConfig<rustc_query_system[8201af163ac5a48f]::query::caches::DefaultCache<rustc_span[e31def1030f5178]::def_id::DefId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5a6eb46947cbd595]::plumbing::QueryCtxt, false>
  38:     0x7f1e6385f09d - rustc_query_impl[5a6eb46947cbd595]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  39:     0x7f1e6385e06e - rustc_middle[4be5b913d7bf3685]::query::plumbing::query_get_at::<rustc_query_system[8201af163ac5a48f]::query::caches::DefaultCache<rustc_span[e31def1030f5178]::def_id::DefId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 8usize]>>>
  40:     0x7f1e643ac0a9 - rustc_hir_analysis[a63d9bfdcc7a8c2c]::check::check::check_item_type
  41:     0x7f1e63f79cd9 - rustc_hir_analysis[a63d9bfdcc7a8c2c]::check::wfcheck::check_well_formed
  42:     0x7f1e63f78b73 - rustc_query_impl[5a6eb46947cbd595]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5a6eb46947cbd595]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 1usize]>>
  43:     0x7f1e63f78271 - rustc_query_system[8201af163ac5a48f]::query::plumbing::try_execute_query::<rustc_query_impl[5a6eb46947cbd595]::DynamicConfig<rustc_query_system[8201af163ac5a48f]::query::caches::VecCache<rustc_hir[fbff31adfa839dea]::hir_id::OwnerId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[5a6eb46947cbd595]::plumbing::QueryCtxt, false>
  44:     0x7f1e63f77fdb - rustc_query_impl[5a6eb46947cbd595]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  45:     0x7f1e63f75977 - rustc_hir_analysis[a63d9bfdcc7a8c2c]::check::wfcheck::check_mod_type_wf
  46:     0x7f1e63f758bb - rustc_query_impl[5a6eb46947cbd595]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5a6eb46947cbd595]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 1usize]>>
  47:     0x7f1e63f74a7b - rustc_query_system[8201af163ac5a48f]::query::plumbing::try_execute_query::<rustc_query_impl[5a6eb46947cbd595]::DynamicConfig<rustc_query_system[8201af163ac5a48f]::query::caches::DefaultCache<rustc_span[e31def1030f5178]::def_id::LocalModDefId, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[5a6eb46947cbd595]::plumbing::QueryCtxt, false>
  48:     0x7f1e63f74813 - rustc_query_impl[5a6eb46947cbd595]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  49:     0x7f1e63ce7f5a - <rustc_middle[4be5b913d7bf3685]::hir::map::Map>::try_par_for_each_module::<rustc_hir_analysis[a63d9bfdcc7a8c2c]::check_crate::{closure#4}::{closure#0}>::{closure#0}
  50:     0x7f1e63ce8790 - rustc_hir_analysis[a63d9bfdcc7a8c2c]::check_crate
  51:     0x7f1e64419499 - rustc_interface[e8d89524f3b9ea3d]::passes::analysis
  52:     0x7f1e644190df - rustc_query_impl[5a6eb46947cbd595]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5a6eb46947cbd595]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 1usize]>>
  53:     0x7f1e647d52e4 - rustc_query_system[8201af163ac5a48f]::query::plumbing::try_execute_query::<rustc_query_impl[5a6eb46947cbd595]::DynamicConfig<rustc_query_system[8201af163ac5a48f]::query::caches::SingleCache<rustc_middle[4be5b913d7bf3685]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[5a6eb46947cbd595]::plumbing::QueryCtxt, false>
  54:     0x7f1e647d50d5 - rustc_query_impl[5a6eb46947cbd595]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  55:     0x7f1e64542808 - rustc_interface[e8d89524f3b9ea3d]::interface::run_compiler::<core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>, rustc_driver_impl[24914691d489c447]::run_compiler::{closure#0}>::{closure#0}
  56:     0x7f1e647ef8c6 - std[f8082c656c94fd2d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e8d89524f3b9ea3d]::util::run_in_thread_with_globals<rustc_interface[e8d89524f3b9ea3d]::util::run_in_thread_pool_with_globals<rustc_interface[e8d89524f3b9ea3d]::interface::run_compiler<core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>, rustc_driver_impl[24914691d489c447]::run_compiler::{closure#0}>::{closure#0}, core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>>::{closure#0}, core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>>
  57:     0x7f1e647ef6f3 - <<std[f8082c656c94fd2d]::thread::Builder>::spawn_unchecked_<rustc_interface[e8d89524f3b9ea3d]::util::run_in_thread_with_globals<rustc_interface[e8d89524f3b9ea3d]::util::run_in_thread_pool_with_globals<rustc_interface[e8d89524f3b9ea3d]::interface::run_compiler<core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>, rustc_driver_impl[24914691d489c447]::run_compiler::{closure#0}>::{closure#0}, core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>>::{closure#0}, core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1ed11a116379b956]::result::Result<(), rustc_span[e31def1030f5178]::ErrorGuaranteed>>::{closure#1} as core[1ed11a116379b956]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  58:     0x7f1e657bc9d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3db22e8983525486
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/alloc/src/boxed.rs:2016:9
  59:     0x7f1e657bc9d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h663b592a11904d0d
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/alloc/src/boxed.rs:2016:9
  60:     0x7f1e657bc9d5 - std::sys::unix::thread::Thread::new::thread_start::h3ab1fb11620916ea
                               at /rustc/bfd799f1a5a86d16e6b8caa2857bcb4aac6e0174/library/std/src/sys/unix/thread.rs:108:17
  61:     0x7f1e5f6749eb - <unknown>
  62:     0x7f1e5f6f87cc - <unknown>
  63:                0x0 - <unknown>

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.77.0-nightly (bfd799f1a 2024-01-12) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `first::Foo::foo`
#1 [type_of_opaque] computing type of opaque `first::Foo::foo::{opaque#0}`
#2 [type_of] computing type of `first::Foo::foo::{opaque#0}`
#3 [check_well_formed] checking that `first::Foo::foo::{opaque#0}` is well-formed
#4 [check_mod_type_wf] checking that types are well-formed in module `first`
#5 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 6 previous errors; 1 warning emitted

Some errors have detailed explanations: E0106, E0107, E0261, E0601, E0670.
For more information about an error, try `rustc --explain E0106`.

@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 Jan 12, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 12, 2024
@fmease fmease added A-async-await Area: Async & Await and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 12, 2024
@fmease
Copy link
Member

fmease commented Jan 12, 2024

Also ices in Rust 2021 in case anybody was wondering. Further reduced:

trait Foo {
    async fn foo<'a>(self: &'a Foo) -> &'a () {
        self.0
    }
}

@fmease fmease added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jan 12, 2024
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 12, 2024
@fmease fmease added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 12, 2024
@fmease
Copy link
Member

fmease commented Jan 12, 2024

I don't have time to do a bisection but I presume that it regressed in #119148. (see below)

@matthiaskrgr
Copy link
Member Author

It's #117449 of course 🙃

@matthiaskrgr matthiaskrgr removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Jan 12, 2024
@matthiaskrgr
Copy link
Member Author

@oli-obk fyi

@oli-obk oli-obk self-assigned this Jan 16, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 18, 2024
…r=compiler-errors

Don't ICE when deducing future output if other errors already occurred

The situation can't really happen outside of erroneous code. What was interesting is that it ICEd before emitting any other diagnostics. This was because the other errors were silenced due to cycle_delay_bug cycle errors.

r? `@compiler-errors`

fixes rust-lang#119890
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 18, 2024
…r=compiler-errors

Don't ICE when deducing future output if other errors already occurred

The situation can't really happen outside of erroneous code. What was interesting is that it ICEd before emitting any other diagnostics. This was because the other errors were silenced due to cycle_delay_bug cycle errors.

r? ``@compiler-errors``

fixes rust-lang#119890
@bors bors closed this as completed in 34362b8 Jan 18, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 18, 2024
Rollup merge of rust-lang#120057 - oli-obk:not_sure_wtf_is_going_on, r=compiler-errors

Don't ICE when deducing future output if other errors already occurred

The situation can't really happen outside of erroneous code. What was interesting is that it ICEd before emitting any other diagnostics. This was because the other errors were silenced due to cycle_delay_bug cycle errors.

r? ```@compiler-errors```

fixes rust-lang#119890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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

Successfully merging a pull request may close this issue.

4 participants