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

ICE: unexpected res Err in variant_of_res -Zsave-analysis #78441

Closed
matthiaskrgr opened this issue Oct 27, 2020 · 1 comment
Closed

ICE: unexpected res Err in variant_of_res -Zsave-analysis #78441

matthiaskrgr opened this issue Oct 27, 2020 · 1 comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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.

Comments

@matthiaskrgr
Copy link
Member

Code

reduced from ./src/test/compile-fail/issue-52443.rs

fn main() {
    [(); { for _ in 0usize.. {}; 0}];
}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (20b1e05a8 2020-10-27)
binary: rustc
commit-hash: 20b1e05a8d0e1773dc840a3286aa37916e87d84b
commit-date: 2020-10-27
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly

Error output

  |
4 |     [(); { for _ in 0usize.. {}; 0}];
  |                     ^^^^^^^^ calling non-const function `<RangeFrom<usize> as IntoIterator>::into_iter`

error: internal compiler error: compiler/rustc_middle/src/ty/mod.rs:2499:18: unexpected res Err in variant_of_res

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: 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: rustc 1.49.0-nightly (20b1e05a8 2020-10-27) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
end of query stack
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0015, E0080, E0744, E0764.
For more information about an error, try `rustc --explain E0015`.
Backtrace

error[E0744]: `for` is not allowed in a `const`
 --> ./src/test/compile-fail/issue-52443.rs:4:12
  |
4 |     [(); { for _ in 0usize.. {}; 0}];
  |            ^^^^^^^^^^^^^^^^^^^^

error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
 --> ./src/test/compile-fail/issue-52443.rs:4:21
  |
4 |     [(); { for _ in 0usize.. {}; 0}];
  |                     ^^^^^^^^

error[E0764]: mutable references are not allowed in constants
 --> ./src/test/compile-fail/issue-52443.rs:4:21
  |
4 |     [(); { for _ in 0usize.. {}; 0}];
  |                     ^^^^^^^^ `&mut` is only allowed in `const fn`

error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
 --> ./src/test/compile-fail/issue-52443.rs:4:21
  |
4 |     [(); { for _ in 0usize.. {}; 0}];
  |                     ^^^^^^^^

error[E0080]: evaluation of constant value failed
 --> ./src/test/compile-fail/issue-52443.rs:4:21
  |
4 |     [(); { for _ in 0usize.. {}; 0}];
  |                     ^^^^^^^^ calling non-const function `<RangeFrom<usize> as IntoIterator>::into_iter`

error: internal compiler error: compiler/rustc_middle/src/ty/mod.rs:2499:18: unexpected res Err in variant_of_res

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
   0:     0x7f99a38e5b70 - std::backtrace_rs::backtrace::libunwind::trace::h448c56741b6011d3
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:     0x7f99a38e5b70 - std::backtrace_rs::backtrace::trace_unsynchronized::h881b9d30a8a89a0c
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f99a38e5b70 - std::sys_common::backtrace::_print_fmt::h720a2f61f75b9f58
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f99a38e5b70 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d62bbfda6d5c836
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f99a3955aac - core::fmt::write::h1857a60b204f1b6a
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/core/src/fmt/mod.rs:1076:17
   5:     0x7f99a38d77d2 - std::io::Write::write_fmt::h16a9fe7680ac245c
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/io/mod.rs:1516:15
   6:     0x7f99a38eab25 - std::sys_common::backtrace::_print::h9ba51a6db618de7d
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f99a38eab25 - std::sys_common::backtrace::print::h5f20e41c85e91716
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f99a38eab25 - std::panicking::default_hook::{{closure}}::h8d48653392f3b04c
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/panicking.rs:208:50
   9:     0x7f99a38ea7c8 - std::panicking::default_hook::hb3948d1f74b6ff4c
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/panicking.rs:227:9
  10:     0x7f99a41b2818 - rustc_driver::report_ice::h1ddbc5609a6e1f37
  11:     0x7f99a38eb426 - std::panicking::rust_panic_with_hook::h55d23fef0ad751bc
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/panicking.rs:597:17
  12:     0x7f99a71afedd - std::panicking::begin_panic::{{closure}}::h4b123e1d8e3ae463
  13:     0x7f99a71afe16 - std::sys_common::backtrace::__rust_end_short_backtrace::ha21fec08f03d728b
  14:     0x7f99a71afeaf - std::panicking::begin_panic::hc0c81fab1e0acd00
  15:     0x7f99a71c1e10 - rustc_errors::HandlerInner::bug::h26f9bc1a7147687e
  16:     0x7f99a71c0960 - rustc_errors::Handler::bug::h2149bffe74600666
  17:     0x7f99a6c1e524 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::hb4ddd0d3902006f3
  18:     0x7f99a6c1804b - rustc_middle::ty::context::tls::with_opt::{{closure}}::ha7f81bc36cab3c9f
  19:     0x7f99a6c17a02 - rustc_middle::ty::context::tls::with_opt::hf0c2c2aff96e53ba
  20:     0x7f99a6c1e449 - rustc_middle::util::bug::opt_span_bug_fmt::hc7cbb029c2646db9
  21:     0x7f99a6c1e3be - rustc_middle::util::bug::bug_fmt::hb51c412c48cda8bb
  22:     0x7f99a6d44a5d - rustc_middle::ty::AdtDef::variant_of_res::h259763dd211c8955
  23:     0x7f99a428de55 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_pat::h396f8a14b519e84b
  24:     0x7f99a4282208 - rustc_save_analysis::dump_visitor::DumpVisitor::process_var_decl::hf3b485ed4161a3a9
  25:     0x7f99a427a575 - rustc_hir::intravisit::walk_expr::h29ec3071e7090d2a
  26:     0x7f99a427a50c - rustc_hir::intravisit::walk_expr::h29ec3071e7090d2a
  27:     0x7f99a427a55b - rustc_hir::intravisit::walk_expr::h29ec3071e7090d2a
  28:     0x7f99a427a5cc - rustc_hir::intravisit::walk_expr::h29ec3071e7090d2a
  29:     0x7f99a428d627 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h163167f860c5f921
  30:     0x7f99a427a5cc - rustc_hir::intravisit::walk_expr::h29ec3071e7090d2a
  31:     0x7f99a4289977 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_item::h4731934b9cd5939e
  32:     0x7f99a42835d1 - rustc_save_analysis::dump_visitor::DumpVisitor::process_crate::h51daa9a55197960f
  33:     0x7f99a4137352 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h9c13a3484429d101
  34:     0x7f99a41f6571 - std::thread::local::LocalKey<T>::with::h1cf4c836994c87d8
  35:     0x7f99a41479ce - rustc_session::utils::<impl rustc_session::session::Session>::time::he9ff6f3455ac3386
  36:     0x7f99a41f44a9 - rustc_interface::passes::QueryContext::enter::h72869665c9dfb2e6
  37:     0x7f99a41cf5fd - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h25b522245624a405
  38:     0x7f99a4192d5f - rustc_span::with_source_map::h7455fffe3cd153a4
  39:     0x7f99a41ca851 - scoped_tls::ScopedKey<T>::set::h8ae8151712a551fd
  40:     0x7f99a41d4f85 - std::sys_common::backtrace::__rust_begin_short_backtrace::h26de371bc27662fc
  41:     0x7f99a41542de - core::ops::function::FnOnce::call_once{{vtable.shim}}::h674a38f3420d24cb
  42:     0x7f99a38fa42a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9e7afb7a0a438236
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/alloc/src/boxed.rs:1312:9
  43:     0x7f99a38fa42a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h70c646c4271337a1
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/alloc/src/boxed.rs:1312:9
  44:     0x7f99a38fa42a - std::sys::unix::thread::Thread::new::thread_start::h35d2b8d36f210d02
                               at /rustc/20b1e05a8d0e1773dc840a3286aa37916e87d84b/library/std/src/sys/unix/thread.rs:89:17
  45:     0x7f99a37f93e9 - start_thread
  46:     0x7f99a3716293 - __GI___clone
  47:                0x0 - <unknown>

note: 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: rustc 1.49.0-nightly (20b1e05a8 2020-10-27) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
end of query stack
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0015, E0080, E0744, E0764.
For more information about an error, try `rustc --explain E0015`.

@matthiaskrgr matthiaskrgr 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 Oct 27, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 28, 2020
@jyn514 jyn514 added the A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. label Feb 19, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 19, 2023

Save-analysis has been removed from the compiler.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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.
Projects
None yet
Development

No branches or pull requests

3 participants