Open
Description
I tried this code:
https://github.com/Sydnie-Shea/rust-bug @elefthei
use ark_std::test_rng;
use ark_bls12_381::Bls12_381 as ArkBls12_381;
fn main() {
let mut rng = test_rng();
let a_coeffs = (0..1)
.map(|_| ArkBls12_381::G1Projective::prime_subgroup_generator() * ArkBls12_381::F::rand(&mut rng))
.collect::<Vec<_>>();
println!("Hello, world!");
}
When I ran this code, I got a message informing that the Compiler had panicked, unexpectedly, and I should file a bug report.
Meta
rustc --version --verbose
:
rustc 1.88.0-nightly (a15cce269 2025-04-17)
Backtrace
thread 'rustc' panicked at compiler/rustc_middle/src/ty/assoc.rs:43:25:
name of non-Rpitit assoc item
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: core::option::expect_failed
3: <rustc_middle::ty::assoc::AssocItem>::ident
4: <core::iter::adapters::flatten::FlattenCompat<_, _> as core::iter::traits::iterator::Iterator>::try_fold::flatten::<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::DefId>>, (), core::ops::control_flow::ControlFlow<rustc_span::def_id::DefId>, core::iter::traits::iterator::Iterator::find::check<rustc_span::def_id::DefId, &mut <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}>::{closure#0}>::{closure#0}
5: <core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::flatten::FlatMap<core::iter::adapters::chain::Chain<core::iter::sources::once::Once<rustc_span::def_id::CrateNum>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::CrateNum>>>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::DefId>>, <rustc_middle::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}>, <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#1}> as core::iter::traits::iterator::Iterator>::next
6: <core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::flatten::FlatMap<core::iter::adapters::chain::Chain<core::iter::sources::once::Once<rustc_span::def_id::CrateNum>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::CrateNum>>>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::DefId>>, <rustc_middle::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#0}>, <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::probe_traits_that_match_assoc_ty::{closure#1}> as core::iter::traits::iterator::Iterator>::collect::<alloc::vec::Vec<alloc::string::String>>
7: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_assoc_path_shared::{closure#0}
8: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_assoc_path_ty
9: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty
10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::resolve_ty_and_res_fully_qualified_call
11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_path
12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_overloaded_binop
16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
18: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_or_body_tail
19: rustc_hir_typeck::check::check_fn
20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_method_argument_types
24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
27: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_block
30: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_or_body_tail
32: rustc_hir_typeck::check::check_fn
33: rustc_hir_typeck::typeck_with_inspect::{closure#0}
34: rustc_hir_typeck::typeck
[... omitted 1 frame ...]
35: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis::check_crate::{closure#3}>::{closure#0}
36: rustc_hir_analysis::check_crate
37: rustc_interface::passes::run_required_analyses
38: rustc_interface::passes::analysis
[... omitted 1 frame ...]
39: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
40: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.