Closed
Description
Code
The following code compiles just fine but when trying to run cargo doc
on it I get the error described below
#![feature(min_const_generics)]
pub type CellIndex<const D:usize> = [i64;D];
fn main() {
let index : CellIndex<2> = [0,1];
}
Meta
rustc --version --verbose
:
rustc 1.47.0-nightly (de521cbb3 2020-08-21)
binary: rustc
commit-hash: de521cbb303c08febd9fa3755caccd4f3e491ea3
commit-date: 2020-08-21
host: x86_64-pc-windows-msvc
release: 1.47.0-nightly
LLVM version: 10.0
Error output
Documenting bug_repl v0.1.0 (C:\Users\ivado\Desktop\github_projects\bug_repl)
error: internal compiler error: src\librustc_middle\ty\subst.rs:568:17: const parameter `D/#0` (Const { ty: usize, val: Param(D/#0) }/0) out of range when substituting substs=[]
thread 'rustc' panicked at 'Box<Any>', /rustc/de521cbb303c08febd9fa3755caccd4f3e491ea3\src\librustc_errors\lib.rs:873:9
error: aborting due to previous error
error: Could not document `bug_repl`.
Caused by:
process didn't exit successfully: `rustdoc --edition=2018 --crate-type bin --crate-name bug_repl src\main.rs -o C:\Users\ivado\Desktop\github_projects\bug_repl\target\doc --error-format=json --json=diagnostic-rendered-ansi --document-private-items -L dependency=C:\Users\ivado\Desktop\github_projects\bug_repl\target\debug\deps --crate-version 0.1.0` (exit code: 1)
Backtrace
stack backtrace:
0: 0x7ff9924fa419 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfae6a97726d8b736
1: 0x7ff9925275cc - core::fmt::write::hce2ddfec834877b8
2: 0x7ff9924ebcd4 - <std::io::IoSlice as core::fmt::Debug>::fmt::h57a15d9f0ff2a3bc
3: 0x7ff9924ffb5b - std::panicking::take_hook::h1925373a96008b93
4: 0x7ff9924ff7a8 - std::panicking::take_hook::h1925373a96008b93
5: 0x7ff97e88cf8a - rustc_driver::report_ice::h691a614479cbf5f9
6: 0x7ff992500500 - std::panicking::rust_panic_with_hook::h7f7de81d557f54d3
7: 0x7ff982a25e70 - ZN12rustc_middle2ty111_DERIVE_rustc_data_structures_stable_hasher_HashStable_rustc_middle_ich_StableHashingContext_ctx_FOR_SymbolName159_$LT$impl$u20$rustc_data_structures..stable_hasher..HashStable$LT$rustc_middle..ich..hcx..StableHashingContext$GT$$u20$
8: 0x7ff982a25de9 - ZN12rustc_middle2ty111_DERIVE_rustc_data_structures_stable_hasher_HashStable_rustc_middle_ich_StableHashingContext_ctx_FOR_SymbolName159_$LT$impl$u20$rustc_data_structures..stable_hasher..HashStable$LT$rustc_middle..ich..hcx..StableHashingContext$GT$$u20$
9: 0x7ff982837e61 - ZN12rustc_middle2ty5print6pretty66_DERIVE_rustc_middle_ty_Lift_lifted_FOR_TraitRefPrintOnlyTraitPath121_$LT$impl$u20$rustc_middle..ty..context..Lift$u20$for$u20$rustc_middle..ty..print..pretty..TraitRefPrintOnlyTraitPath$GT$11lift_to_tcx17hd76463984e41ae2
10: 0x7ff982a1a099 - ZN12rustc_middle2ty111_DERIVE_rustc_data_structures_stable_hasher_HashStable_rustc_middle_ich_StableHashingContext_ctx_FOR_SymbolName159_$LT$impl$u20$rustc_data_structures..stable_hasher..HashStable$LT$rustc_middle..ich..hcx..StableHashingContext$GT$$u20$
11: 0x7ff982a1ae52 - ZN12rustc_middle2ty111_DERIVE_rustc_data_structures_stable_hasher_HashStable_rustc_middle_ich_StableHashingContext_ctx_FOR_SymbolName159_$LT$impl$u20$rustc_data_structures..stable_hasher..HashStable$LT$rustc_middle..ich..hcx..StableHashingContext$GT$$u20$
12: 0x7ff9828849be - rustc_middle::util::bug::bug_fmt::h582d9a3024b38eb2
13: 0x7ff98287a730 - rustc_middle::ty::context::tls::ImplicitCtxt::new::hee3ec7f9c2036613
14: 0x7ff98287a668 - rustc_middle::ty::context::tls::ImplicitCtxt::new::hee3ec7f9c2036613
15: 0x7ff9828848cc - rustc_middle::util::bug::bug_fmt::h582d9a3024b38eb2
16: 0x7ff982884885 - rustc_middle::util::bug::bug_fmt::h582d9a3024b38eb2
17: 0x7ff982877c58 - <rustc_middle::ty::subst::SubstFolder as rustc_middle::ty::fold::TypeFolder>::fold_const::ha8c888812b2c4f15
18: 0x7ff9817bd49b - rustc_mir::interpret::memory::Memory<M>::check_ptr_access_align::check_offset_align::h322ffaeebc9cba06
19: 0x7ff9817dfd12 - rustc_mir::interpret::memory::Memory<M>::check_ptr_access_align::check_offset_align::h322ffaeebc9cba06
20: 0x7ff9817dbdaa - rustc_mir::interpret::memory::Memory<M>::check_ptr_access_align::check_offset_align::h322ffaeebc9cba06
21: 0x7ff9818d34e4 - rustc_mir::const_eval::eval_queries::const_eval_raw_provider::h651410244f0e96fc
22: 0x7ff981888a1c - <rustc_mir::transform::validate::EdgeKind as core::fmt::Debug>::fmt::ha919b339641781e4
23: 0x7ff98173c1b9 - <rustc_mir::interpret::machine::StackPopJump as core::fmt::Debug>::fmt::h666d775e581f4d45
24: 0x7ff981787ab6 - <rustc_mir::transform::inline::CallSite as core::fmt::Debug>::fmt::hdd493ea1fcabadf1
25: 0x7ff9815ca01c - <rustc_mir::shim::CallKind as core::fmt::Debug>::fmt::h605f0ad005b88cfc
26: 0x7ff9818d138d - rustc_mir::const_eval::eval_queries::const_eval_validated_provider::hb2fbe61a076b869f
27: 0x7ff98188937c - <rustc_mir::transform::validate::EdgeKind as core::fmt::Debug>::fmt::ha919b339641781e4
28: 0x7ff981742bc7 - <rustc_mir::interpret::machine::StackPopJump as core::fmt::Debug>::fmt::h666d775e581f4d45
29: 0x7ff98178a7c6 - <rustc_mir::transform::inline::CallSite as core::fmt::Debug>::fmt::hdd493ea1fcabadf1
30: 0x7ff981598f2e - <rustc_mir::shim::CallKind as core::fmt::Debug>::fmt::h605f0ad005b88cfc
31: 0x7ff9818d1135 - rustc_mir::const_eval::eval_queries::const_eval_validated_provider::hb2fbe61a076b869f
32: 0x7ff98294c5fc - <rustc_middle::ty::cast::CastKind as core::fmt::Debug>::fmt::hd88d5cab8ffba004
33: 0x7ff98278c44b - rustc_middle::ty::structural_impls::<impl rustc_middle::ty::context::Lift for rustc_ast::ast::Mutability>::lift_to_tcx::h477c6cc9462869f3
34: 0x7ff982834738 - ZN12rustc_middle2ty5print6pretty66_DERIVE_rustc_middle_ty_Lift_lifted_FOR_TraitRefPrintOnlyTraitPath121_$LT$impl$u20$rustc_middle..ty..context..Lift$u20$for$u20$rustc_middle..ty..print..pretty..TraitRefPrintOnlyTraitPath$GT$11lift_to_tcx17hd76463984e41ae2
35: 0x7ff9826bd267 - rustc_middle::ty::structural_impls::<impl rustc_middle::ty::context::Lift for rustc_ast::ast::Mutability>::lift_to_tcx::h477c6cc9462869f3
36: 0x7ff982907f1c - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id::h4e1fda7798274bbd
37: 0x7ff982907aff - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_poly::h5026915202dd971a
38: 0x7ff657798fba - <unknown>
39: 0x7ff6577a1bfe - <unknown>
40: 0x7ff65778f379 - <unknown>
41: 0x7ff6578a489e - <unknown>
42: 0x7ff657af24d9 - <unknown>
43: 0x7ff6579c6183 - <unknown>
44: 0x7ff65787d3b5 - <unknown>
45: 0x7ff6579c7ea0 - <unknown>
46: 0x7ff65787a603 - <unknown>
47: 0x7ff6577aee1a - <unknown>
48: 0x7ff657800ddc - <unknown>
49: 0x7ff6577bc4d5 - <unknown>
50: 0x7ff657893c93 - <unknown>
51: 0x7ff9925104ea - std::sys::windows::thread::Thread::new::h84550e08827b3a3a
52: 0x7ff9ddaf7bd4 - BaseThreadInitThunk
53: 0x7ff9ddc4ce51 - RtlUserThreadStart
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.
Activity
jyn514 commentedon Aug 27, 2020
Making this even more strange, this does not panic with
#![feature(const_generics)]
instead.jyn514 commentedon Aug 27, 2020
Backtrace
Rustdoc code:
rust/src/librustdoc/clean/mod.rs
Lines 1366 to 1367 in 668ef72
jyn514 commentedon Aug 27, 2020
The main function is not necessary, it also crashes on
jyn514 commentedon Aug 27, 2020
Yeah this one is beyond me, I have no idea why this is breaking.
jyn514 commentedon Aug 27, 2020
This never worked with
#![min_const_generics]
; on2020-08-08
it says the feature isn't recognized and on09
it crashes.camelid commentedon Aug 27, 2020
jyn514 commentedon Aug 27, 2020
12 remaining items