thread 'rustc' panicked at compiler/rustc_hir_typeck/src/writeback.rs:749:9:
assertion failed: !value.has_infer()
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: <rustc_hir_typeck::fn_ctxt::FnCtxt>::resolve_type_vars_in_body
4: rustc_hir_typeck::typeck
[... omitted 1 frame ...]
5: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>>
6: <rustc_hir_analysis::collect::type_of::opaque::TaitConstraintLocator>::check
7: rustc_hir_analysis::collect::type_of::type_of_opaque
[... omitted 1 frame ...]
8: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
9: rustc_hir_analysis::collect::type_of::type_of
[... omitted 1 frame ...]
10: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
11: rustc_hir_analysis::check::check::check_item_type
12: rustc_hir_analysis::check::wfcheck::check_well_formed
[... omitted 1 frame ...]
13: rustc_middle::query::plumbing::query_ensure_error_guaranteed::<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 1]>>, ()>
14: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
[... omitted 1 frame ...]
15: rustc_hir_analysis::check_crate
16: rustc_interface::passes::run_required_analyses
17: rustc_interface::passes::analysis
[... omitted 1 frame ...]
18: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#3}>
19: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: 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: please make sure that you have updated to the latest nightly
note: please attach the file at `/Volumes/T7/workspace/240529_100chaos_tree_combine_typ/icefiles/rustc-ice-2024-05-30T07_50_14-17949.txt` to your bug report
query stack during panic:
#0 [typeck] type-checking `test`
#1 [type_of_opaque] computing type of opaque `Bar::{opaque#0}`
#2 [type_of] computing type of `Bar::{opaque#0}`
#3 [check_well_formed] checking that `Bar::{opaque#0}` is well-formed
#4 [check_mod_type_wf] checking that types are well-formed in top-level module
#5 [analysis] running analysis passes on this crate
end of query stack
error: `Bar` is forbidden as the type of a const generic parameter
--> r_writeback_C9DEFA.rs:4:24
|
4 | async fn test<const N: crate::Bar>() {}
| ^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0283`.
Code
(hand-reduced)
(original)
Meta
rustc --version --verbose:Error output
Command:
rustc --edition=2018--editionoption is added to avoidasync fnerror message(there exists another error at the end of the backtrace)
Backtrace
Note
rustc_hir_typeck/src/writeback.rs L749rust/compiler/rustc_hir_typeck/src/writeback.rs
Lines 743 to 749 in debd22d
rustc_trait_selection/src/solve/canonicalize.rs L72rust/compiler/rustc_trait_selection/src/solve/canonicalize.rs
Lines 71 to 72 in e5fedce