Skip to content

thread 'rustc' panicked at 'Ok(impl std::future::Future<Output = ()>) is not fully resolved', /rustc/53e4b9dd74c29cc9308b8d0f10facac70bb101a7\compiler\rustc_infer\src\infer\mod.rs:1438:9 #105290

Closed
@Rageking8

Description

@Rageking8

Code

#![feature(async_fn_in_trait)]
#![allow(incomplete_features)]

trait MyTrait {
async fn bar(& abc self);
}

impl MyTrait for () {
async fn bar(&self) {}
}

fn main() {}

The 'abc' can be changed to any keyword or any arbitrary identifier and the ICE still repros.
Found by mutating #105154.
Seemingly different ICE msg to the in the fixed issue.

Meta

rustc --version --verbose:

rustc 1.67.0-nightly (53e4b9dd7 2022-12-04)
binary: rustc
commit-hash: 53e4b9dd74c29cc9308b8d0f10facac70bb101a7
commit-date: 2022-12-04
host: x86_64-pc-windows-msvc
release: 1.67.0-nightly
LLVM version: 15.0.4

Error output

error: expected identifier, found keyword `self`

error: expected one of `:`, `@`, or `|`, found keyword `self`

thread 'rustc' panicked at '`Ok(impl std::future::Future<Output = ()>)` is not fully resolved', /rustc/53e4b9dd74c29cc9308b8d0f10facac70bb101a7\compiler\rustc_infer\src\infer\mod.rs:1438:9
Backtrace

error: expected identifier, found keyword `self`
 --> src\main.rs:5:20
  |
5 | async fn bar(& abc self);
  |                    ^^^^ expected identifier, found keyword

error: expected one of `:`, `@`, or `|`, found keyword `self`
 --> src\main.rs:5:20
  |
5 | async fn bar(& abc self);
  |              ------^^^^
  |              |     |
  |              |     expected one of `:`, `@`, or `|`
  |              help: declare the type after the parameter binding: `<identifier>: <type>`

thread 'rustc' panicked at '`Ok(impl std::future::Future<Output = ()>)` is not fully resolved', /rustc/53e4b9dd74c29cc9308b8d0f10facac70bb101a7\compiler\rustc_infer\src\infer\mod.rs:1438:9
stack backtrace:
   0:     0x7ffd1a3d9e42 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7e70883c575183bf
   1:     0x7ffd1a41615b - core::fmt::write::h33a76bcc6f834c12
   2:     0x7ffd1a3cca6a - <std::io::IoSliceMut as core::fmt::Debug>::fmt::he6739634bf80651d
   3:     0x7ffd1a3d9b8b - std::sys::common::alloc::realloc_fallback::h79800d247b25f9cf
   4:     0x7ffd1a3dd4b9 - std::panicking::default_hook::hf73f2b3eda2ba841
   5:     0x7ffd1a3dd13b - std::panicking::default_hook::hf73f2b3eda2ba841
   6:     0x7ffca213c72d - rustc_driver[6fdaf07c6b144b62]::describe_lints
   7:     0x7ffd1a3dde20 - std::panicking::rust_panic_with_hook::h026ab977c6c77b06
   8:     0x7ffd1a3ddb7e - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::hb89c2f203710a373
   9:     0x7ffd1a3dab3f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7e70883c575183bf
  10:     0x7ffd1a3dd830 - rust_begin_unwind
  11:     0x7ffd1a44bcc5 - core::panicking::panic_fmt::h66cd6f87b18e0169
  12:     0x7ffca362695a - <core[d9f7351a480f3995]::option::Option<rustc_middle[d0f48cd9e4ec2207]::middle::privacy::Level> as rustc_privacy[46ed857b1c6903f4]::VisibilityLike>::new_min
  13:     0x7ffca36555db - <rustc_hir_analysis[e14abbd9f0df36ca]::variance::terms::VarianceTerm as core[d9f7351a480f3995]::fmt::Debug>::fmt
  14:     0x7ffca3cb40fd - <bool as rustc_mir_dataflow[d87990ffd791d352]::framework::lattice::MeetSemiLattice>::meet
  15:     0x7ffca3def4bb - <&[rustc_span[395f7c3a127106b9]::symbol::Ident] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  16:     0x7ffca3e3b172 - <&[rustc_span[395f7c3a127106b9]::symbol::Ident] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  17:     0x7ffca3e81ac4 - <&[rustc_span[395f7c3a127106b9]::symbol::Ident] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  18:     0x7ffca44e12f5 - <rustc_middle[d0f48cd9e4ec2207]::ty::context::TyCtxt>::bound_trait_impl_trait_tys
  19:     0x7ffca1eadfc4 - rustc_trait_selection[a45ef6f2a47a2aca]::traits::project::normalize_projection_type
  20:     0x7ffca1e9c741 - <rustc_trait_selection[a45ef6f2a47a2aca]::traits::project::AssocTypeNormalizer as rustc_middle[d0f48cd9e4ec2207]::ty::fold::TypeFolder>::fold_ty
  21:     0x7ffca0079e1d - <rustc_hir_analysis[e14abbd9f0df36ca]::check::intrinsicck::InlineAsmCtxt>::check_asm
  22:     0x7ffca13d1f69 - <dyn rustc_hir_analysis[e14abbd9f0df36ca]::astconv::AstConv>::ty_of_fn
  23:     0x7ffca14441ce - <rustc_hir_analysis[e14abbd9f0df36ca]::collect::lifetimes::LifetimeContext as rustc_hir[f1f8b5f3b9fa0ead]::intravisit::Visitor>::visit_lifetime
  24:     0x7ffca13decd0 - <dyn rustc_hir_analysis[e14abbd9f0df36ca]::astconv::AstConv>::ty_of_fn
  25:     0x7ffca140507a - rustc_hir_analysis[e14abbd9f0df36ca]::check::check::check_abi
  26:     0x7ffca140acbb - rustc_hir_analysis[e14abbd9f0df36ca]::check::check::check_abi
  27:     0x7ffca0309a89 - <rustc_const_eval[cb9b3011c5bf7f16]::transform::check_consts::resolver::State as core[d9f7351a480f3995]::clone::Clone>::clone_from
  28:     0x7ffca0393e75 - <&[(rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::ExportedSymbol, rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  29:     0x7ffca1b313fd - <rustc_span[395f7c3a127106b9]::symbol::Symbol as rustc_serialize[99e1dbb5522d458d]::serialize::Encodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheEncoder>>::encode
  30:     0x7ffca04e4212 - <&[(rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::ExportedSymbol, rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  31:     0x7ffca0088ef0 - <rustc_hir_analysis[e14abbd9f0df36ca]::check::check::check_opaque_for_inheriting_lifetimes::ProhibitOpaqueVisitor as rustc_middle[d0f48cd9e4ec2207]::ty::visit::TypeVisitor>::visit_ty
  32:     0x7ffca00567d8 - rustc_hir_analysis[e14abbd9f0df36ca]::check_crate
  33:     0x7ffc9f927f65 - rustc_interface[9a86922769a86bfa]::passes::analysis
  34:     0x7ffca030c45f - <rustc_const_eval[cb9b3011c5bf7f16]::transform::check_consts::resolver::State as core[d9f7351a480f3995]::clone::Clone>::clone_from
  35:     0x7ffca03b2139 - <&[(rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::ExportedSymbol, rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  36:     0x7ffca0461c52 - <&[(rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::ExportedSymbol, rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  37:     0x7ffca04eaf3f - <&[(rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::ExportedSymbol, rustc_middle[d0f48cd9e4ec2207]::middle::exported_symbols::SymbolExportInfo)] as rustc_serialize[99e1dbb5522d458d]::serialize::Decodable<rustc_query_impl[2fbc64f93e3032cd]::on_disk_cache::CacheDecoder>>::decode
  38:     0x7ffc9f8ebe44 - <unknown>
  39:     0x7ffc9f8fcb96 - <rustc_middle[d0f48cd9e4ec2207]::ty::SymbolName as core[d9f7351a480f3995]::fmt::Display>::fmt
  40:     0x7ffc9f8fbe98 - rustc_driver[6fdaf07c6b144b62]::args::arg_expand_all
  41:     0x7ffc9f8ecdb9 - <unknown>
  42:     0x7ffc9f8e3e9d - <unknown>
  43:     0x7ffd1a3f01ac - std::sys::windows::thread::Thread::new::hc3d1b043254b2748
  44:     0x7ffd9f2554e0 - BaseThreadInitThunk
  45:     0x7ffda0be485b - RtlUserThreadStart

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.67.0-nightly (53e4b9dd7 2022-12-04) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [collect_trait_impl_trait_tys] comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process
#1 [check_mod_item_types] checking item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rust_test` due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions