Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination of const generics, extra braces around a const generic parameter, and cross-crate use causes stack overflow #73120

Closed
yvt opened this issue Jun 8, 2020 · 1 comment · Fixed by #74392
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@yvt
Copy link
Contributor

yvt commented Jun 8, 2020

Code

All files packaged in a single Gist: https://gist.github.com/yvt/2fec54f8012d512c59216b5d2ef82d63

lib1/src/lib.rs:

fn unused_function(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}

lib2/src/lib.rs:

#![feature(const_generics)]

// All of these three items must be in `lib2` to reproduce the error

pub trait TypeFn {
    type Output;
}

pub struct GenericType<const B: i8>;

// Removing the braces around `42` resolves the crash
impl TypeFn for GenericType<{ 42 }> {
    type Output = ();
}

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.46.0-nightly (0262de554 2020-06-07)
binary: rustc
commit-hash: 0262de554b4c4c5af346137bbb1664a3f6cf4df2
commit-date: 2020-06-07
host: x86_64-apple-darwin
release: 1.46.0-nightly
LLVM version: 10.0

Error output

$ cargo build -p lib1
   Compiling lib2 v0.1.0 (WORKSPACE_DIRECTORY/lib2)
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
 --> lib2/src/lib.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

warning: unnecessary braces around const expression
  --> lib2/src/lib.rs:10:29
   |
10 | impl TypeFn for GenericType<{ 42 }> {
   |                             ^^^^^^ help: remove these braces
   |
   = note: `#[warn(unused_braces)]` on by default

   Compiling lib1 v0.1.0 (WORKSPACE_DIRECTORY/lib1)
warning: 2 warnings emitted


thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `lib1`.

Caused by:
  process didn't exit successfully: `rustc --crate-name lib1 --edition=2018 lib1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=ebc5fd98cbffda2d -C extra-filename=-ebc5fd98cbffda2d --out-dir WORKSPACE_DIRECTORY/target/debug/deps -C incremental=WORKSPACE_DIRECTORY/target/debug/incremental -L dependency=WORKSPACE_DIRECTORY/target/debug/deps --extern lib2=WORKSPACE_DIRECTORY/target/debug/deps/liblib2-493874d8e8624eee.rmeta -Ctarget-cpu=native` (signal: 6, SIGABRT: process abort signal)
Backtrace

* thread #3, name = 'rustc', stop reason = EXC_BAD_ACCESS (code=2, address=0x70000bf08fd8)
    frame #0: 0x0000000104012a45 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::hd3f2c958d4983325 + 117
librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::hd3f2c958d4983325:
->  0x104012a45 <+117>: callq  0x1043d7c40               ; hashbrown::map::RawEntryBuilder$LT$K$C$V$C$S$GT$::from_key_hashed_nocheck::h1882771ccd1e27ac
    0x104012a4a <+122>: testq  %rax, %rax
    0x104012a4d <+125>: je     0x104012a9a               ; <+202>
    0x104012a4f <+127>: movq   (%rdx), %r13
Target 0: (rustc) stopped.
(lldb) bt
   ⋮
    frame #33112: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33113: 0x0000000103ed9710 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_const::hf809661716f1acc1 + 624
    frame #33114: 0x0000000103ee3741 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 3585
    frame #33115: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33116: 0x0000000103ecc85e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type::h4387524258b381af + 3246
    frame #33117: 0x0000000103ee0014 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..pretty..PrettyPrinter$GT$::generic_delimiters::h6c7ec83bbc6cadbd + 196
    frame #33118: 0x0000000103ee334e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 2574
    frame #33119: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33120: 0x0000000103ee2dc2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 1154
    frame #33121: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33122: 0x0000000103ed9710 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_const::hf809661716f1acc1 + 624
    frame #33123: 0x0000000103ee3741 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 3585
    frame #33124: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33125: 0x0000000103ecc85e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type::h4387524258b381af + 3246
    frame #33126: 0x0000000103ee0014 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..pretty..PrettyPrinter$GT$::generic_delimiters::h6c7ec83bbc6cadbd + 196
    frame #33127: 0x0000000103ee334e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 2574
    frame #33128: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33129: 0x0000000103ee2dc2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 1154
    frame #33130: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33131: 0x0000000103ed9710 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_const::hf809661716f1acc1 + 624
    frame #33132: 0x0000000103ee3741 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 3585
    frame #33133: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33134: 0x0000000103ecc85e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type::h4387524258b381af + 3246
    frame #33135: 0x0000000103ee0014 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..pretty..PrettyPrinter$GT$::generic_delimiters::h6c7ec83bbc6cadbd + 196
    frame #33136: 0x0000000103ee334e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 2574
    frame #33137: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33138: 0x0000000103ee2dc2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 1154
    frame #33139: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33140: 0x0000000103ed9710 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_const::hf809661716f1acc1 + 624
    frame #33141: 0x0000000103ee3741 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 3585
    frame #33142: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33143: 0x0000000103ecc85e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type::h4387524258b381af + 3246
    frame #33144: 0x0000000103ee0014 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..pretty..PrettyPrinter$GT$::generic_delimiters::h6c7ec83bbc6cadbd + 196
    frame #33145: 0x0000000103ee334e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 2574
    frame #33146: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33147: 0x0000000103ee2dc2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 1154
    frame #33148: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33149: 0x0000000103ed9710 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_const::hf809661716f1acc1 + 624
    frame #33150: 0x0000000103ee3741 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 3585
    frame #33151: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33152: 0x0000000103ecc85e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type::h4387524258b381af + 3246
    frame #33153: 0x0000000103ee0014 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..pretty..PrettyPrinter$GT$::generic_delimiters::h6c7ec83bbc6cadbd + 196
    frame #33154: 0x0000000103ee334e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 2574
    frame #33155: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33156: 0x0000000103ee2dc2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 1154
    frame #33157: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33158: 0x0000000103ed9710 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_const::hf809661716f1acc1 + 624
    frame #33159: 0x0000000103ee3741 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 3585
    frame #33160: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33161: 0x0000000103ecc85e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type::h4387524258b381af + 3246
    frame #33162: 0x0000000103ee0014 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..pretty..PrettyPrinter$GT$::generic_delimiters::h6c7ec83bbc6cadbd + 196
    frame #33163: 0x0000000103ee334e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 2574
    frame #33164: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33165: 0x0000000103ee2dc2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::Printer::default_print_def_path::hb1c921ff5df1618c + 1154
    frame #33166: 0x0000000103ed5f93 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_middle..ty..print..pretty..FmtPrinter$LT$F$GT$$u20$as$u20$rustc_middle..ty..print..Printer$GT$::print_def_path::h07a91b6275da5c3d + 307
    frame #33167: 0x000000010410fd4d librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::_$LT$impl$u20$rustc_middle..ty..context..TyCtxt$GT$::def_path_str_with_substs::hd9da408d11c00698 + 589
    frame #33168: 0x000000010410fae8 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::print::pretty::_$LT$impl$u20$rustc_middle..ty..context..TyCtxt$GT$::def_path_str::h1e77f3fb6d824890 + 24
    frame #33169: 0x0000000102f9f49d librustc_driver-554a90bb8f5bbcd2.dylib`rustc_mir::const_eval::eval_queries::const_eval_raw_provider::hcd83e0720d37c0c6 + 2237
    frame #33170: 0x0000000102f7aeae librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::query::_$LT$impl$u20$rustc_query_system..query..config..QueryAccessors$LT$rustc_middle..ty..context..TyCtxt$GT$$u20$for$u20$rustc_middle..ty..query..queries..const_eval_raw$GT$::compute::hc88fde68ba46a62f + 174
    frame #33171: 0x0000000102ee6b18 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::dep_graph::_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$::with_deps::h3a7ac76932452edb + 552
    frame #33172: 0x00000001032480c3 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::dep_graph::graph::DepGraph$LT$K$GT$::with_task_impl::hfecd1af9d903c833 + 499
    frame #33173: 0x00000001031f94dc librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::_$u7b$$u7b$closure$u7d$$u7d$::hf71191fc0e0563d7 + 13020
    frame #33174: 0x0000000103160eda librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::h1bbfc7052d5badd0 + 666
    frame #33175: 0x0000000102f9df96 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_mir::const_eval::eval_queries::const_eval_validated_provider::ha8eebe66fdaa78eb + 1078
    frame #33176: 0x0000000102f7b3ae librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::query::_$LT$impl$u20$rustc_query_system..query..config..QueryAccessors$LT$rustc_middle..ty..context..TyCtxt$GT$$u20$for$u20$rustc_middle..ty..query..queries..const_eval_validated$GT$::compute::hb081941be75f1b63 + 174
    frame #33177: 0x0000000102ee9fc8 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::dep_graph::_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$::with_deps::h9443e5bf6be539f9 + 552
    frame #33178: 0x000000010324241c librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::dep_graph::graph::DepGraph$LT$K$GT$::with_task_impl::ha234a93081be042a + 524
    frame #33179: 0x00000001031c0625 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::_$u7b$$u7b$closure$u7d$$u7d$::haac0ae58ccd86eca + 14677
    frame #33180: 0x000000010316179a librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::h262f148abf020033 + 666
    frame #33181: 0x0000000102f9dc5c librustc_driver-554a90bb8f5bbcd2.dylib`rustc_mir::const_eval::eval_queries::const_eval_validated_provider::ha8eebe66fdaa78eb + 252
    frame #33182: 0x0000000104131d35 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::query::_$LT$impl$u20$rustc_query_system..query..config..QueryAccessors$LT$rustc_middle..ty..context..TyCtxt$GT$$u20$for$u20$rustc_middle..ty..query..queries..const_eval_validated$GT$::compute::hb081941be75f1b63 + 117
    frame #33183: 0x0000000104357a98 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::dep_graph::_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$::with_deps::h372f271f52ec2e29 + 552
    frame #33184: 0x0000000103f88bda librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::dep_graph::graph::DepGraph$LT$K$GT$::with_task_impl::hd92a2db015e9bded + 618
    frame #33185: 0x00000001040bfecb librustc_driver-554a90bb8f5bbcd2.dylib`rustc_data_structures::stack::ensure_sufficient_stack::h1d8564fe5a9966a7 + 747
    frame #33186: 0x0000000103fb1986 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::h38745a30039c0e7f + 9254
    frame #33187: 0x000000010410163a librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::mir::interpret::queries::_$LT$impl$u20$rustc_middle..ty..context..TyCtxt$GT$::const_eval_global_id::habfcc4865555b159 + 1034
    frame #33188: 0x00000001041011a2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::mir::interpret::queries::_$LT$impl$u20$rustc_middle..ty..context..TyCtxt$GT$::const_eval_resolve::hb33050651722da8c + 194
    frame #33189: 0x0000000103b6552e librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_trait_selection..traits..project..AssocTypeNormalizer$u20$as$u20$rustc_middle..ty..fold..TypeFolder$GT$::fold_const::h8607ca14d1b47372 + 1406
    frame #33190: 0x0000000103c0aff0 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::fold::TypeFoldable::fold_with::h0206cf932955fca5 + 144
    frame #33191: 0x0000000103b1f8c2 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::structural_impls::_$LT$impl$u20$rustc_middle..ty..fold..TypeFoldable$u20$for$u20$$RF$rustc_middle..ty..TyS$GT$::super_fold_with::h95f909faed7eadb2 + 66
    frame #33192: 0x0000000103b64cce librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_trait_selection..traits..project..AssocTypeNormalizer$u20$as$u20$rustc_middle..ty..fold..TypeFolder$GT$::fold_ty::h6f37b9bd049fc9fe + 78
    frame #33193: 0x0000000103c0b0cc librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::fold::TypeFoldable::fold_with::h0206cf932955fca5 + 364
    frame #33194: 0x0000000103b64566 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::project::AssocTypeNormalizer::fold::hb66cf8728de04af1 + 198
    frame #33195: 0x0000000103b63e68 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::project::normalize_with_depth::hc6f6f7004bda5348 + 184
    frame #33196: 0x0000000103c22da6 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::select::SelectionContext::match_impl::ha9aa8b5eac382fc5 + 1206
    frame #33197: 0x0000000103bd92bf librustc_driver-554a90bb8f5bbcd2.dylib`rustc_infer::infer::InferCtxt::probe::h85b60c58d28b53ce + 79
    frame #33198: 0x0000000103b5ba1e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::trait_def::_$LT$impl$u20$rustc_middle..ty..context..TyCtxt$GT$::for_each_relevant_impl::h221f5a2affcca579 + 686
    frame #33199: 0x0000000103c17940 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::select::candidate_assembly::_$LT$impl$u20$rustc_trait_selection..traits..select..SelectionContext$GT$::assemble_candidates_from_impls::h5ea707ea0302f74d + 144
    frame #33200: 0x0000000103c16d78 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::select::candidate_assembly::_$LT$impl$u20$rustc_trait_selection..traits..select..SelectionContext$GT$::assemble_candidates::h6ff91a5380fe9020 + 3416
    frame #33201: 0x0000000103c1fbf0 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::select::SelectionContext::candidate_from_obligation_no_cache::h1ae3377bcfa48f9d + 336
    frame #33202: 0x0000000103c98e82 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::dep_graph::_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$::with_deps::h7f11cf3fedd9d96a + 178
    frame #33203: 0x0000000103b3f582 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::dep_graph::graph::DepGraph$LT$K$GT$::with_anon_task::h592bfe2c8bff45f3 + 226
    frame #33204: 0x0000000103c153af librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::select::candidate_assembly::_$LT$impl$u20$rustc_trait_selection..traits..select..SelectionContext$GT$::candidate_from_obligation::h686543c10b9dec42 + 703
    frame #33205: 0x0000000103c1c739 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::select::SelectionContext::select::h2789c69fa71858c9 + 217
    frame #33206: 0x0000000103bd545c librustc_driver-554a90bb8f5bbcd2.dylib`rustc_infer::infer::InferCtxt::commit_if_ok::h3154fdc6ea3296b2 + 76
    frame #33207: 0x0000000103b66d6c librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::project::opt_normalize_projection_type::hc1aed362be4c51e1 + 4924
    frame #33208: 0x0000000103b656e0 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::project::normalize_projection_type::hd350697a271dce3b + 240
    frame #33209: 0x0000000103b64f0a librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_trait_selection..traits..project..AssocTypeNormalizer$u20$as$u20$rustc_middle..ty..fold..TypeFolder$GT$::fold_ty::h6f37b9bd049fc9fe + 650
    frame #33210: 0x0000000102ad5e72 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::structural_impls::fold_list::ha32fa601e6386ba5 + 114
    frame #33211: 0x0000000102a4b5f6 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_trait_selection::traits::project::AssocTypeNormalizer::fold::hd40c4e87885eac09 + 246
    frame #33212: 0x00000001029c885b librustc_driver-554a90bb8f5bbcd2.dylib`rustc_data_structures::stack::ensure_sufficient_stack::hdb233cea4b0ba7f0 + 59
    frame #33213: 0x000000010299612c librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$rustc_infer..infer..InferCtxt$u20$as$u20$rustc_trait_selection..infer..InferCtxtExt$GT$::partially_normalize_associated_types_in::h84117d372d543f85 + 252
    frame #33214: 0x0000000102a674bb librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::context::GlobalCtxt::enter_local::h9b0d077aaeab1fa9 + 1979
    frame #33215: 0x0000000102af65db librustc_driver-554a90bb8f5bbcd2.dylib`rustc_typeck::check::wfcheck::check_item_well_formed::h7c111456b40e32e4 + 763
    frame #33216: 0x0000000102adc0ed librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::query::_$LT$impl$u20$rustc_query_system..query..config..QueryAccessors$LT$rustc_middle..ty..context..TyCtxt$GT$$u20$for$u20$rustc_middle..ty..query..queries..check_item_well_formed$GT$::compute::hb5a0eca8fe4b37ab + 93
    frame #33217: 0x000000010298f03e librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::dep_graph::_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$::with_deps::hffec4be8151ec41c + 174
    frame #33218: 0x0000000102a86e74 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::dep_graph::graph::DepGraph$LT$K$GT$::with_task_impl::he3c6324a5b558f20 + 292
    frame #33219: 0x00000001029cad15 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_data_structures::stack::ensure_sufficient_stack::hf4b4e9087c6f706c + 709
    frame #33220: 0x0000000102a36865 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::hd8a12796b0afba81 + 3397
    frame #33221: 0x0000000102a42e78 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::ensure_query_impl::hdf8bac0cc5f4df4c + 152
    frame #33222: 0x0000000102acf770 librustc_driver-554a90bb8f5bbcd2.dylib`_$LT$std..panic..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hb1cb5ea46c8c4eac + 672
    frame #33223: 0x0000000102af5fee librustc_driver-554a90bb8f5bbcd2.dylib`rustc_hir::hir::Crate::par_visit_all_item_likes::hcb8e9037c7ac8d77 + 46
    frame #33224: 0x0000000102ac8832 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_typeck::check_crate::ha099f24a0111d0ff + 2114
    frame #33225: 0x000000010061cbbb librustc_driver-554a90bb8f5bbcd2.dylib`rustc_interface::passes::analysis::hbda38b9b64963f46 + 107
    frame #33226: 0x00000001004aae92 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::query::_$LT$impl$u20$rustc_query_system..query..config..QueryAccessors$LT$rustc_middle..ty..context..TyCtxt$GT$$u20$for$u20$rustc_middle..ty..query..queries..analysis$GT$::compute::h56ce88838dc55d25 + 98
    frame #33227: 0x000000010048cb04 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::dep_graph::_$LT$impl$u20$rustc_query_system..dep_graph..DepKind$u20$for$u20$rustc_middle..dep_graph..dep_node..DepKind$GT$::with_deps::h70717c887971b34b + 180
    frame #33228: 0x00000001005197a4 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::dep_graph::graph::DepGraph$LT$K$GT$::with_task_impl::h7356e90be014ecb8 + 292
    frame #33229: 0x0000000100514b9d librustc_driver-554a90bb8f5bbcd2.dylib`rustc_query_system::query::plumbing::get_query_impl::h86c1cafc480a95bc + 3981
    frame #33230: 0x00000001004ab685 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_middle::ty::context::tls::enter_global::h56481aaa85c872ae + 229
    frame #33231: 0x00000001004afe70 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_interface::queries::_$LT$impl$u20$rustc_interface..interface..Compiler$GT$::enter::hc21c8e95b073cabb + 1968
    frame #33232: 0x0000000100511121 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_span::with_source_map::hfe39b4a89c27343d + 353
    frame #33233: 0x00000001004b1b27 librustc_driver-554a90bb8f5bbcd2.dylib`rustc_interface::interface::run_compiler_in_existing_thread_pool::h8c3858433038e730 + 919
    frame #33234: 0x00000001004a8b89 librustc_driver-554a90bb8f5bbcd2.dylib`scoped_tls::ScopedKey$LT$T$GT$::set::ha6a4e0581178e78c + 393
    frame #33235: 0x00000001004b2e1d librustc_driver-554a90bb8f5bbcd2.dylib`std::sys_common::backtrace::__rust_begin_short_backtrace::hab16a3a82f3d18b4 + 397
    frame #33236: 0x00000001004939cc librustc_driver-554a90bb8f5bbcd2.dylib`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h802c2aec831bb138 + 76
    frame #33237: 0x00000001073bbb2d libstd-c02d19cc7543a27a.dylib`std::sys::unix::thread::Thread::new::thread_start::h738da1179b799992 + 45
    frame #33238: 0x00007fff71a74109 libsystem_pthread.dylib`_pthread_start + 148
    frame #33239: 0x00007fff71a6fb8b libsystem_pthread.dylib`thread_start + 15

@yvt yvt added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 8, 2020
@yvt yvt changed the title Combination of const generics, extra braces around parameters, and cross-crate use causes stack overflow Combination of const generics, extra braces around a const generic parameter, and cross-crate use causes stack overflow Jun 8, 2020
@jonas-schievink jonas-schievink added A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. requires-nightly This issue requires a nightly compiler in some way. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jun 8, 2020
yvt added a commit to r3-os/r3 that referenced this issue Jun 8, 2020
This commit implements a work-around for this issue:
<rust-lang/rust#73120>
@lcnr
Copy link
Contributor

lcnr commented Jun 9, 2020

This will probably get fixed by #72600

lcnr added a commit to lcnr/rust that referenced this issue Jul 16, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
const generics triage

I went through all const generics issues and closed all issues which are already fixed.

Some issues already have a regression test but were not closed. Also doing this as part of this PR.

uff r? @eddyb @varkor

closes rust-lang#61936
closes rust-lang#62878
closes rust-lang#63695
closes rust-lang#67144
closes rust-lang#68596
closes rust-lang#69816
closes rust-lang#70217
closes rust-lang#70507
closes rust-lang#70586
closes rust-lang#71348
closes rust-lang#71805
closes rust-lang#73120
closes rust-lang#73508
closes rust-lang#73730
closes rust-lang#74255
@bors bors closed this as completed in c354524 Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants