rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.18k stars 12.7k forks source link

VecMap([(OpaqueTypeKey { def_id: DefId(0:40 ~ actix01[ee95]::master::{opaque#0}), substs: [] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/main.rs:6:26: 6:62 (#42), ty: _ }, origin: FnReturn(DefId(0:39 ~ actix01[ee95]::master)) })]) delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:50:26 #96270

Closed Cassin01 closed 2 years ago

Cassin01 commented 2 years ago

Code

#![feature(async_closure)]
use std::future::Future;
use actix_web::{web, App, HttpResponse, HttpServer, Responder};
type FA<R> = dyn FnOnce() -> R + 'static;
fn master(s: &str) -> FA<impl Future<Output = impl Responder>> {
    async move || -> HttpResponse {
        HttpResponse::Ok().body(s)
    }
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .route("/hey", web::get().to(master("hai")))
    })
    .bind(("127.0.0.1", 8080))?
    .run()
    .await
}

Meta

rustc --version --verbose:

rustc 1.62.0-nightly (4ca19e09d 2022-04-19)
binary: rustc
commit-hash: 4ca19e09d302a4cbde14f9cb1bc109179dc824cd
commit-date: 2022-04-19
host: x86_64-apple-darwin
release: 1.62.0-nightly
LLVM version: 14.0.1

Error output

❯ cargo run
   Compiling actix01 v0.1.0 (/Users/NAME/all_year/web-site/actix01)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_infer/src/infer/opaque_typ
es.rs:428:47
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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-com
piler&template=ice.md

note: rustc 1.62.0-nightly (4ca19e09d 2022-04-19) running on x86_64-apple-darwin

note: compiler flags: --crate-type bin -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incrementa
l

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `<[closure@src/main.rs:7:5: 9:6] as core::ops::funct
ion::FnOnce<()>>::Output == impl core::future::future::Future<Output = impl actix_web::response::responder::Respond
er>`
#1 [typeck] type-checking `master`
end of query stack
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: VecMap([(OpaqueTypeKey { def_id: DefId(0:40 ~ actix01[6e3b]::master::{opaque#0}), s
ubsts: [] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/main.rs:6:26: 6:62 (#42), ty: _ }, origin:
FnReturn(DefId(0:39 ~ actix01[6e3b]::master)) })])
  |
  = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:50:26

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1346:13
stack backtrace:
   0:        0x10440d104 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7d1c
4e9dbb122fe4
   1:        0x10446755b - core::fmt::write::h1dd7703407456672
   2:        0x1043ff798 - std::io::Write::write_fmt::hd35189fe8d4c5666
   3:        0x1044104bd - std::panicking::default_hook::{{closure}}::hd40c7909795a526f
   4:        0x1044101a1 - std::panicking::default_hook::h81168ea2d25114b0
   5:        0x10feb515d - rustc_driver[3cbd82847cf296fb]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x104410c26 - std::panicking::rust_panic_with_hook::hd052369e2a2de97f
   7:        0x114626e27 - std[88d32b739ab0a2e9]::panicking::begin_panic::<rustc_errors[4f0dbc95d6bf05e9]::Explicit
Bug>::{closure#0}
   8:        0x114624cf9 - std[88d32b739ab0a2e9]::sys_common::backtrace::__rust_end_short_backtrace::<std[88d32b739
ab0a2e9]::panicking::begin_panic<rustc_errors[4f0dbc95d6bf05e9]::ExplicitBug>::{closure#0}, !>
   9:        0x1149a7151 - std[88d32b739ab0a2e9]::panicking::begin_panic::<rustc_errors[4f0dbc95d6bf05e9]::Explicit
Bug>
  10:        0x11465aa79 - std[88d32b739ab0a2e9]::panic::panic_any::<rustc_errors[4f0dbc95d6bf05e9]::ExplicitBug>
  11:        0x11465f927 - <rustc_errors[4f0dbc95d6bf05e9]::HandlerInner as core[976a65f03211a467]::ops::drop::Drop
>::drop
  12:        0x10fecca2a - core[976a65f03211a467]::ptr::drop_in_place::<rustc_session[f2311fd583c203e1]::parse::Par
seSess>
  13:        0x10fecfe3a - <alloc[a6462b316d143df9]::rc::Rc<rustc_session[f2311fd583c203e1]::session::Session> as c
ore[976a65f03211a467]::ops::drop::Drop>::drop
  14:        0x10febdb92 - core[976a65f03211a467]::ptr::drop_in_place::<rustc_interface[379c4e9a5969b218]::interfac
e::Compiler>
  15:        0x10febb963 - rustc_span[d307e707487d1bd]::with_source_map::<core[976a65f03211a467]::result::Result<()
, rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>, rustc_interface[379c4e9a5969b218]::interface::create_compiler_a
nd_run<core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>, rustc_driver[3c
bd82847cf296fb]::run_compiler::{closure#1}>::{closure#1}>
  16:        0x10fe58ada - rustc_interface[379c4e9a5969b218]::interface::create_compiler_and_run::<core[976a65f0321
1a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>, rustc_driver[3cbd82847cf296fb]::run_co
mpiler::{closure#1}>
  17:        0x10fe51fd5 - <scoped_tls[c16da450f8d16bb0]::ScopedKey<rustc_span[d307e707487d1bd]::SessionGlobals>>::
set::<rustc_interface[379c4e9a5969b218]::interface::run_compiler<core[976a65f03211a467]::result::Result<(), rustc_e
rrors[4f0dbc95d6bf05e9]::ErrorGuaranteed>, rustc_driver[3cbd82847cf296fb]::run_compiler::{closure#1}>::{closure#0},
 core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>>
  18:        0x10fe7cc79 - std[88d32b739ab0a2e9]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_inter
face[379c4e9a5969b218]::util::run_in_thread_pool_with_globals<rustc_interface[379c4e9a5969b218]::interface::run_com
piler<core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>, rustc_driver[3cb
d82847cf296fb]::run_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f
0dbc95d6bf05e9]::ErrorGuaranteed>>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6
bf05e9]::ErrorGuaranteed>>
  19:        0x10fe7d4a1 - <<std[88d32b739ab0a2e9]::thread::Builder>::spawn_unchecked_<rustc_interface[379c4e9a5969
b218]::util::run_in_thread_pool_with_globals<rustc_interface[379c4e9a5969b218]::interface::run_compiler<core[976a65
f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>, rustc_driver[3cbd82847cf296fb]::r
un_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::
ErrorGuaranteed>>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGua
ranteed>>::{closure#1} as core[976a65f03211a467]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  20:        0x104419e27 - std::sys::unix::thread::Thread::new::thread_start::hdb038b603eab1d5f
  21:     0x7ff81264a4f4 - __pthread_start

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-com
piler&template=ice.md

note: rustc 1.62.0-nightly (4ca19e09d 2022-04-19) running on x86_64-apple-darwin

note: compiler flags: --crate-type bin -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incrementa
l

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
error: could not compile `actix01`

Caused by:
  process didn't exit successfully: `rustc --crate-name actix01 --edition=2021 src/main.rs --error-format=json --js
on=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C
split-debuginfo=unpacked -C debuginfo=2 -C metadata=99b8526a3abea582 -C extra-filename=-99b8526a3abea582 --out-dir
/Users/NAME/all_year/web-site/actix01/target/debug/deps -C incremental=/Users/NAME/all_year/web-site/actix01/ta
rget/debug/incremental -L dependency=/Users/NAME/all_year/web-site/actix01/target/debug/deps --extern actix_web=/
Users/NAME/all_year/web-site/actix01/target/debug/deps/libactix_web-af6b5733de3209aa.rlib --extern pulldown_cmark
=/Users/NAME/all_year/web-site/actix01/target/debug/deps/libpulldown_cmark-d54d066777a5f5bb.rlib -L native=/Users
/NAME/all_year/web-site/actix01/target/debug/build/zstd-sys-1b673c0e4dd87ef9/out` (signal: 6, SIGABRT: process ab
ort signal)
Backtrace

``` ❯ cargo run Compiling actix01 v0.1.0 (/Users/NAME/all_year/web-site/actix01) thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_infer/src/infer/opaque_typ es.rs:428:47 stack backtrace: 0: 0x10bd86104 - ::fmt::h7d1c 4e9dbb122fe4 1: 0x10bde055b - core::fmt::write::h1dd7703407456672 2: 0x10bd78798 - std::io::Write::write_fmt::hd35189fe8d4c5666 3: 0x10bd894bd - std::panicking::default_hook::{{closure}}::hd40c7909795a526f 4: 0x10bd891a1 - std::panicking::default_hook::h81168ea2d25114b0 5: 0x11b4d615d - rustc_driver[3cbd82847cf296fb]::DEFAULT_HOOK::{closure#0}::{closure#0} 6: 0x10bd89c26 - std::panicking::rust_panic_with_hook::hd052369e2a2de97f 7: 0x10bd89a2a - std::panicking::begin_panic_handler::{{closure}}::h92e3b3cc0c31bfe6 8: 0x10bd86587 - std::sys_common::backtrace::__rust_end_short_backtrace::h2f15c15bd4f44f08 9: 0x10bd8973a - _rust_begin_unwind 10: 0x10be09c43 - core::panicking::panic_fmt::h4c5d9b17dced048f 11: 0x10be09b27 - core::panicking::panic::h0b65e708c1acc353 12: 0x11f864e03 - ::handle_opaque_type::{closure#0} 13: 0x11f864848 - ::handle_opaque_type 14: 0x11f8e8354 - ::tys 15: 0x11f7eeee2 - ::relate:: 16: 0x11f6ef66a - ::commit_if_ok::, rustc_middle[b15ac2f09a9de55b]::ty::error::TypeError, ::eq::{closure#0}> 17: 0x11f74a35c - rustc_trait_selection[a92e31b53c3de38f]::traits::project::project_and_unify_type 18: 0x11f6f1a25 - ::commit_if_ok:: 19: 0x11f73bb3a - ::evaluate_pr edicate_recursively 20: 0x11f6f6459 - ::probe::, ::evaluation_pr obe<::evaluate_root_obligation::{closure #0}>::{closure#0}> 21: 0x11f72dabf - ::evaluate_ro ot_obligation 22: 0x11e893334 - ::enter_with_canonical::, core[976a65f03211a467]::re sult::Result, rustc_traits[2edef877ef4cfff6]::evaluate_obligation::evaluate_obligation::{closure#0}> 23: 0x11e92e8a0 - rustc_traits[2edef877ef4cfff6]::evaluate_obligation::evaluate_obligation 24: 0x11ed8b77f - ::with_deps::<>::with_task_impl>, core[976a65f03211a467]::result::Result>::{c losure#0}, core[976a65f03211a467]::result::Result> 25: 0x11ee0284a - >::with_task::>, core[976a65f03211a467]::result::Result> 26: 0x11ecadcad - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 27: 0x11ef33069 - ::evaluate_obligation 28: 0x11f725b86 - ::evaluate_obligation 29: 0x11f725c8f - ::evaluate_obligation_no_overflow 30: 0x11f776eb6 - >> as core[976a65f03211a467]::iter::traits::iterator::Iterator>::try_fold::<(), core[976a65f03211a467]::iter:: traits::iterator::Iterator::all::check, ::suggest_impl_trait::{closure#5}::{closure#0}>::{ closure#0}, core[976a65f03211a467]::ops::control_flow::ControlFlow<()>> 31: 0x11f706070 - ::suggest_impl_trait 32: 0x11f71b45e - ::report_selection_error 33: 0x11f7263c8 - ::report_fulfillment_error 34: 0x11f716b22 - ::report_fulfillment_errors 35: 0x11e03ddcf - ::type_inference_fallback 36: 0x11e18efb0 - ::enter::<&rustc_middle[b15ac2f0 9a9de55b]::ty::context::TypeckResults, ::enter< rustc_typeck[ab8d13ddb4ec143f]::check::typeck_with_fallback::{closure#1}, &rustc_middle[b15ac2f09a9de55b]::ty::context::TypeckResults>::{closure#0}> 37: 0x11e12cc71 - rustc_typeck[ab8d13ddb4ec143f]::check::typeck 38: 0x11ee0ea5b - >::with_task:: 39: 0x11ebd8655 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::> 40: 0x11eccf8de - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 41: 0x11f9cf919 - ::typeck_opt_const_arg 42: 0x11e5ae51a - rustc_mir_build[4e3932fe37748ce5]::build::mir_built 43: 0x11ed8af09 - ::with_deps::<>::with_task_impl, &rustc_data_structures[16dd00d5237e3cef]::steal::Steal>::{closure#0 }, &rustc_data_structures[16dd00d5237e3cef]::steal::Steal> 44: 0x11edfe3cd - >::with_task::, &rustc_data_structu res[16dd00d5237e3cef]::steal::Steal> 45: 0x11ebb77e5 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::, &rustc_data_stru ctures[16dd00d5237e3cef]::steal::Steal>> 46: 0x11ecd207e - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 47: 0x11ef30c77 - ::mir_built 48: 0x11dec728b - rustc_mir_transform[29f25866498b7f99]::check_unsafety::unsafety_check_result 49: 0x11dec3c33 - >::call_once 50: 0x11ee0fb0b - >::with_task:: 51: 0x11ebda815 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::> 52: 0x11ecb689e - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 53: 0x11deacbd1 - rustc_mir_transform[29f25866498b7f99]::mir_const 54: 0x11ed8af09 - ::with_deps::<>::with_task_impl, &rustc_data_structures[16dd00d5237e3cef]::steal::Steal>::{closure#0 }, &rustc_data_structures[16dd00d5237e3cef]::steal::Steal> 55: 0x11edfe3cd - >::with_task::, &rustc_data_structu res[16dd00d5237e3cef]::steal::Steal> 56: 0x11ebb77e5 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::, &rustc_data_stru ctures[16dd00d5237e3cef]::steal::Steal>> 57: 0x11ecd21bb - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 58: 0x11ef30ca7 - ::mir_const 59: 0x11dead724 - rustc_mir_transform[29f25866498b7f99]::mir_promoted 60: 0x11ed8afc9 - ::with_deps::<>::with_task_impl, (&rustc_data_structures[16dd00d5237e3cef]::steal::Steal, &rustc_dat a_structures[16dd00d5237e3cef]::steal::Steal>)>::{closure#0}, (&rustc_data_structures[16dd00d52 37e3cef]::steal::Steal, &rustc_data_structures[16dd00d5237e3cef]::steal: :Steal>)> 61: 0x11edfe90a - >::with_task::, (&rustc_data_struct ures[16dd00d5237e3cef]::steal::Steal, &rustc_data_structures[16dd00d5237 e3cef]::steal::Steal>)> 62: 0x11ec9d4ac - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 63: 0x11ef30e27 - ::mir_promoted 64: 0x11e7a3883 - rustc_borrowck[96025d6d88d0c618]::mir_borrowck 65: 0x11e77b3d3 - >::call_once 66: 0x11ee0f57b - >::with_task:: 67: 0x11ebd9735 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::> 68: 0x11ec9c743 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 69: 0x11e2b4dab - rustc_typeck[ab8d13ddb4ec143f]::collect::type_of::type_of 70: 0x11ee1922b - >::with_task:: 71: 0x11ebf8a11 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::> 72: 0x11eccfb9d - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 73: 0x11e0c9812 - rustc_typeck[ab8d13ddb4ec143f]::check::check::check_item_type 74: 0x11e2921a8 - ::visit_item_likes_in_module:: 75: 0x11e0cece5 - rustc_typeck[ab8d13ddb4ec143f]::check::check::check_mod_item_types 76: 0x11ee10626 - >::with_task:: 77: 0x11ebdc984 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::> 78: 0x11ecb03bb - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 79: 0x11e291053 - ::for_each_module:: 80: 0x11e15eea0 - ::time::<(), rustc_typeck[ab8d13ddb4e c143f]::check_crate::{closure#6}> 81: 0x11e15c512 - rustc_typeck[ab8d13ddb4ec143f]::check_crate 82: 0x11b5b2bda - rustc_interface[379c4e9a5969b218]::passes::analysis 83: 0x11ee37a17 - >::with_task::> 84: 0x11ec34246 - rustc_query_system[15f37b9c69565f8a]::query::plumbing::try_execute_query::>> 85: 0x11eccfcbf - rustc_query_system[15f37b9c69565f8a]::query::plumbing::get_query:: 86: 0x11b4957ed - ::enter::> 87: 0x11b47901a - ::enter::, rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>> 88: 0x11b4dc2d8 - rustc_span[d307e707487d1bd]::with_source_map::, rustc_interface[379c4e9a5969b218]::interface::create_compiler_a nd_run, rustc_driver[3c bd82847cf296fb]::run_compiler::{closure#1}>::{closure#1}> 89: 0x11b479ada - rustc_interface[379c4e9a5969b218]::interface::create_compiler_and_run::, rustc_driver[3cbd82847cf296fb]::run_co mpiler::{closure#1}> 90: 0x11b472fd5 - >:: set::, rustc_driver[3cbd82847cf296fb]::run_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>> 91: 0x11b49dc79 - std[88d32b739ab0a2e9]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver[3cb d82847cf296fb]::run_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f 0dbc95d6bf05e9]::ErrorGuaranteed>>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6 bf05e9]::ErrorGuaranteed>> 92: 0x11b49e4a1 - <::spawn_unchecked_, rustc_driver[3cbd82847cf296fb]::r un_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]:: ErrorGuaranteed>>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGua ranteed>>::{closure#1} as core[976a65f03211a467]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 93: 0x10bd92e27 - std::sys::unix::thread::Thread::new::thread_start::hdb038b603eab1d5f 94: 0x7ff81264a4f4 - __pthread_start 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-com piler&template=ice.md note: rustc 1.62.0-nightly (4ca19e09d 2022-04-19) running on x86_64-apple-darwin note: compiler flags: --crate-type bin -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incrementa l note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [evaluate_obligation] evaluating trait selection obligation `<[closure@src/main.rs:7:5: 9:6] as core::ops::funct ion::FnOnce<()>>::Output == impl core::future::future::Future` #1 [typeck] type-checking `master` #2 [mir_built] building MIR for `master` #3 [unsafety_check_result] unsafety-checking `master` #4 [mir_const] processing MIR for `master` #5 [mir_promoted] processing `master` #6 [mir_borrowck] borrow-checking `master` #7 [type_of] computing type of `master::{opaque#0}` #8 [check_mod_item_types] checking item types in top-level module #9 [analysis] running analysis passes on this crate end of query stack error: internal compiler error: no errors encountered even though `delay_span_bug` issued error: internal compiler error: VecMap([(OpaqueTypeKey { def_id: DefId(0:40 ~ actix01[6e3b]::master::{opaque#0}), s ubsts: [] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/main.rs:6:26: 6:62 (#42), ty: _ }, origin: FnReturn(DefId(0:39 ~ actix01[6e3b]::master)) })]) | = note: delayed at compiler/rustc_infer/src/infer/opaque_types/table.rs:50:26 thread 'rustc' panicked at 'Box', compiler/rustc_errors/src/lib.rs:1346:13 stack backtrace: 0: 0x10bd86104 - ::fmt::h7d1c 4e9dbb122fe4 1: 0x10bde055b - core::fmt::write::h1dd7703407456672 2: 0x10bd78798 - std::io::Write::write_fmt::hd35189fe8d4c5666 3: 0x10bd894bd - std::panicking::default_hook::{{closure}}::hd40c7909795a526f 4: 0x10bd891a1 - std::panicking::default_hook::h81168ea2d25114b0 5: 0x11b4d615d - rustc_driver[3cbd82847cf296fb]::DEFAULT_HOOK::{closure#0}::{closure#0} 6: 0x10bd89c26 - std::panicking::rust_panic_with_hook::hd052369e2a2de97f 7: 0x11fc47e27 - std[88d32b739ab0a2e9]::panicking::begin_panic::::{closure#0} 8: 0x11fc45cf9 - std[88d32b739ab0a2e9]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 9: 0x11ffc8151 - std[88d32b739ab0a2e9]::panicking::begin_panic:: 10: 0x11fc7ba79 - std[88d32b739ab0a2e9]::panic::panic_any:: 11: 0x11fc80927 - ::drop 12: 0x11b4eda2a - core[976a65f03211a467]::ptr::drop_in_place:: 13: 0x11b4f0e3a - as c ore[976a65f03211a467]::ops::drop::Drop>::drop 14: 0x11b4deb92 - core[976a65f03211a467]::ptr::drop_in_place:: 15: 0x11b4dc963 - rustc_span[d307e707487d1bd]::with_source_map::, rustc_interface[379c4e9a5969b218]::interface::create_compiler_a nd_run, rustc_driver[3c bd82847cf296fb]::run_compiler::{closure#1}>::{closure#1}> 16: 0x11b479ada - rustc_interface[379c4e9a5969b218]::interface::create_compiler_and_run::, rustc_driver[3cbd82847cf296fb]::run_co mpiler::{closure#1}> 17: 0x11b472fd5 - >:: set::, rustc_driver[3cbd82847cf296fb]::run_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGuaranteed>> 18: 0x11b49dc79 - std[88d32b739ab0a2e9]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver[3cb d82847cf296fb]::run_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f 0dbc95d6bf05e9]::ErrorGuaranteed>>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6 bf05e9]::ErrorGuaranteed>> 19: 0x11b49e4a1 - <::spawn_unchecked_, rustc_driver[3cbd82847cf296fb]::r un_compiler::{closure#1}>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]:: ErrorGuaranteed>>::{closure#0}, core[976a65f03211a467]::result::Result<(), rustc_errors[4f0dbc95d6bf05e9]::ErrorGua ranteed>>::{closure#1} as core[976a65f03211a467]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 20: 0x10bd92e27 - std::sys::unix::thread::Thread::new::thread_start::hdb038b603eab1d5f 21: 0x7ff81264a4f4 - __pthread_start 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-com piler&template=ice.md note: rustc 1.62.0-nightly (4ca19e09d 2022-04-19) running on x86_64-apple-darwin note: compiler flags: --crate-type bin -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incrementa l note: some of the compiler flags provided by cargo are hidden query stack during panic: end of query stack thread panicked while panicking. aborting. error: could not compile `actix01` Caused by: process didn't exit successfully: `rustc --crate-name actix01 --edition=2021 src/main.rs --error-format=json --js on=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=99b8526a3abea582 -C extra-filename=-99b8526a3abea582 --out-dir /Users/NAME/all_year/web-site/actix01/target/debug/deps -C incremental=/Users/NAME/all_year/web-site/actix01/ta rget/debug/incremental -L dependency=/Users/NAME/all_year/web-site/actix01/target/debug/deps --extern actix_web=/ Users/NAME/all_year/web-site/actix01/target/debug/deps/libactix_web-af6b5733de3209aa.rlib --extern pulldown_cmark =/Users/NAME/all_year/web-site/actix01/target/debug/deps/libpulldown_cmark-d54d066777a5f5bb.rlib -L native=/Users /NAME/all_year/web-site/actix01/target/debug/build/zstd-sys-1b673c0e4dd87ef9/out` (signal: 6, SIGABRT: process ab ort signal) ```

TheNeikos commented 2 years ago

A test case without actix and the trait:

#![feature(async_closure)]
use std::future::Future;

type FA<R> = dyn FnOnce() -> R + 'static;

fn master() -> FA<impl Future<Output = ()>> {
    async move || -> () { () }
}

Error still is:

VecMap([(OpaqueTypeKey { def_id: DefId(0:9 ~ issue_96270[73e3]::master::{opaque#0}), substs: [] }, OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: src/lib.rs:6:19: 6:43 (#5), ty: _ }, origin: FnReturn(DefId(0:8 ~ issue_96270[73e3]::master)) })])

The issue seems to arise from the type alias and impl Trait as its return type. Since if you inline it, you get a good error message:

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
 --> src/lib.rs:4:33
  |
4 | fn master() -> dyn FnOnce() -> (impl Future<Output = ()> + 'static) {
  |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0562`.
error: could not compile `issue-96270` due to previous error