Open
Description
auto-reduced (treereduce-rust):
//@compile-flags: --crate-type=lib
#![feature(min_generic_const_args)]
#![feature(inherent_associated_types)]
trait Trait {}
struct Struct<const N: usize>;
type Alias<T: Trait> = Struct<{ Struct::N }>;
original:
#![feature(generic_const_exprs)]
trait Trait {
const N: usize;
}
struct Struct<const N: usize>;
type Alias<T: Trait> = Struct<{Struct::N}>;
Version information
rustc 1.89.0-nightly (337c11e59 2025-06-01)
binary: rustc
commit-hash: 337c11e5932275e7d450c1f2e26f289f0ddfa717
commit-date: 2025-06-01
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(min_generic_const_args) -Zcrate-attr=feature(inherent_associated_types) --crate-type=lib
Program output
warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
--> <crate attribute>:1:12
|
1 | #![feature(min_generic_const_args)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
--> <crate attribute>:1:12
|
1 | #![feature(inherent_associated_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
warning: trait `Trait` is never used
--> /tmp/icemaker_global_tempdir.inzV6lR3JIFE/rustc_testrunner_tmpdir_reporting.nrWOaNXSC3go/mvce.rs:1:7
|
1 | trait Trait {}
| ^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: struct `Struct` is never constructed
--> /tmp/icemaker_global_tempdir.inzV6lR3JIFE/rustc_testrunner_tmpdir_reporting.nrWOaNXSC3go/mvce.rs:3:8
|
3 | struct Struct<const N: usize>;
| ^^^^^^
warning: type alias `Alias` is never used
--> /tmp/icemaker_global_tempdir.inzV6lR3JIFE/rustc_testrunner_tmpdir_reporting.nrWOaNXSC3go/mvce.rs:5:6
|
5 | type Alias<T: Trait> = Struct<{ Struct::N }>;
| ^^^^^
warning: bounds on generic parameters in type aliases are not enforced
--> /tmp/icemaker_global_tempdir.inzV6lR3JIFE/rustc_testrunner_tmpdir_reporting.nrWOaNXSC3go/mvce.rs:5:15
|
5 | type Alias<T: Trait> = Struct<{ Struct::N }>;
| --^^^^^
| | |
| | will not be checked at usage sites of the type alias
| help: remove this bound
|
= note: this is a known limitation of the type checker that may be lifted in a future edition.
see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
= help: add `#![feature(lazy_type_alias)]` to the crate attributes to enable the desired semantics
= note: `#[warn(type_alias_bounds)]` on by default
warning: 6 warnings emitted
note: no errors encountered even though delayed bugs were created
note: those delayed bugs will now be shown as internal compiler errors
error: internal compiler error: bad placeholder constant
--> /tmp/icemaker_global_tempdir.inzV6lR3JIFE/rustc_testrunner_tmpdir_reporting.nrWOaNXSC3go/mvce.rs:5:33
|
5 | type Alias<T: Trait> = Struct<{ Struct::N }>;
| ^^^^^^
|
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:426:9
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, &str>
4: <rustc_hir_analysis::collect::ItemCtxt as rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::ct_infer
5: <<dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path::{closure#0}::GenericArgsCtxt as rustc_hir_analysis::hir_ty_lowering::GenericArgsLowerer>::inferred_kind
6: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_resolved_ty_path
7: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty
8: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
9: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_resolved_ty_path
10: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty
11: rustc_hir_analysis::collect::type_of::type_of
12: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
13: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
14: rustc_query_impl::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
15: <rustc_hir_analysis::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_item
16: rustc_hir_analysis::check::wfcheck::check_well_formed
17: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
19: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
20: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
21: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
23: rustc_query_impl::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
24: rustc_hir_analysis::check_crate
25: rustc_interface::passes::run_required_analyses
26: rustc_interface::passes::analysis
27: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
29: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
30: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
31: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
32: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
33: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
34: std::sys::pal::unix::thread::Thread::new::thread_start
35: <unknown>
36: <unknown>
--> /tmp/icemaker_global_tempdir.inzV6lR3JIFE/rustc_testrunner_tmpdir_reporting.nrWOaNXSC3go/mvce.rs:5:33
|
5 | type Alias<T: Trait> = Struct<{ Struct::N }>;
| ^^^^^^
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: rustc 1.89.0-nightly (337c11e59 2025-06-01) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z crate-attr=feature(min_generic_const_args) -Z crate-attr=feature(inherent_associated_types) --crate-type lib -Z dump-mir-dir=dir
query stack during panic:
end of query stack
@rustbot label +F-generic_const_exprs +F-min_generic_const_args +F-inherent_associated_types
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Dont' Worry (mGCA)