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: deref projection of non-dereferenceable ty with -Zchalk #80228

Closed
matthiaskrgr opened this issue Dec 20, 2020 · 2 comments
Closed

ICE: deref projection of non-dereferenceable ty with -Zchalk #80228

matthiaskrgr opened this issue Dec 20, 2020 · 2 comments
Labels
A-traits Area: Trait system 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

const FOO: &&&u32 = &&&42;

fn main() {
    match unimplemented!() {
        &&&42 => {},
        FOO => {},
        _ => {},
    }
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (29e32120c 2020-12-20)
binary: rustc
commit-hash: 29e32120c33d30ff526fc7f4d94ec9fce0dc10c9
commit-date: 2020-12-20
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

rustc ./59996.rs -Zchalk=yes

warning: unreachable arm
 --> ./59996.rs:5:18
  |
4 |     match unimplemented!() {
  |           ---------------- any code following this expression is unreachable
5 |         &&&42 => {},
  |                  ^^ unreachable arm
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable pattern
 --> ./59996.rs:6:9
  |
6 |         FOO => {},
  |         ^^^
  |
  = note: `#[warn(unreachable_patterns)]` on by default

error: internal compiler error: compiler/rustc_middle/src/mir/tcx.rs:84:25: deref projection of non-dereferenceable ty PlaceTy { ty: (), variant_index: None }

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958: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.50.0-nightly (29e32120c 2020-12-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z chalk=yes

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `main`
#1 [mir_const] processing MIR for `main`
end of query stack
error: aborting due to previous error; 2 warnings emitted

Backtrace

error: internal compiler error: compiler/rustc_middle/src/mir/tcx.rs:84:25: deref projection of non-dereferenceable ty PlaceTy { ty: (), variant_index: None }

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958:9
stack backtrace:
   0:     0x7fb51ecb06c7 - std::backtrace_rs::backtrace::libunwind::trace::h746c3e9529d524bc
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fb51ecb06c7 - std::backtrace_rs::backtrace::trace_unsynchronized::h84373278bfb39e0c
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fb51ecb06c7 - std::sys_common::backtrace::_print_fmt::h517324efde750597
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fb51ecb06c7 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf594ab77fac89284
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fb51ed2128c - core::fmt::write::h3868db8542c90941
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/core/src/fmt/mod.rs:1078:17
   5:     0x7fb51eca2592 - std::io::Write::write_fmt::h3f6656f045fa877f
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/io/mod.rs:1519:15
   6:     0x7fb51ecb43b5 - std::sys_common::backtrace::_print::hda7655c057c24dcc
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fb51ecb43b5 - std::sys_common::backtrace::print::h546a6c8431d46287
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fb51ecb43b5 - std::panicking::default_hook::{{closure}}::h006dd083853faf51
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/panicking.rs:208:50
   9:     0x7fb51ecb3f0a - std::panicking::default_hook::hf0f9afb1017317fc
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/panicking.rs:225:9
  10:     0x7fb51f555008 - rustc_driver::report_ice::h956234bae73e460f
  11:     0x7fb51ecb4cb6 - std::panicking::rust_panic_with_hook::hb7a19826c029b1d6
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/panicking.rs:595:17
  12:     0x7fb52273c32d - std::panicking::begin_panic::{{closure}}::he3ac55d11a883a10
  13:     0x7fb52273c1e6 - std::sys_common::backtrace::__rust_end_short_backtrace::h4402bc3ed558879b
  14:     0x7fb52273c2cf - std::panicking::begin_panic::hd2137c659c375844
  15:     0x7fb522777bac - rustc_errors::HandlerInner::bug::hbfb11e3c8ba1475f
  16:     0x7fb5227762c0 - rustc_errors::Handler::bug::ha00f48e1291906a1
  17:     0x7fb522034224 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h08c1bd52850a380c
  18:     0x7fb52202e24b - rustc_middle::ty::context::tls::with_opt::{{closure}}::h82c056b7e0ea907f
  19:     0x7fb52202e1f2 - rustc_middle::ty::context::tls::with_opt::h001ea91e9a6c9bc0
  20:     0x7fb522034143 - rustc_middle::util::bug::opt_span_bug_fmt::h033dd7c3ae8939b2
  21:     0x7fb5220340b5 - rustc_middle::util::bug::bug_fmt::hededfcfaf49f2715
  22:     0x7fb52237b058 - rustc_middle::mir::tcx::PlaceTy::projection_ty_core::{{closure}}::hac1075f1f0cd4047
  23:     0x7fb52237afe1 - rustc_middle::mir::tcx::PlaceTy::projection_ty::h87a1160b35cc7231
  24:     0x7fb520e6cc34 - <rustc_mir::transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_place::h2d15a4db23d70aa6
  25:     0x7fb520e6bc35 - <rustc_mir::transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_terminator::h4381967093695f68
  26:     0x7fb520e6e386 - rustc_mir::transform::check_unsafety::unsafety_check_result::h1ddc892dff422567
  27:     0x7fb520e2d827 - core::ops::function::FnOnce::call_once::ha8d8172d355466db
  28:     0x7fb520d4daee - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::unsafety_check_result>::compute::hb6fe82b2233d02cd
  29:     0x7fb520c0f598 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h0268cac6188a8e01
  30:     0x7fb520ad1b30 - rustc_query_system::query::plumbing::get_query_impl::hc584a3078278359f
  31:     0x7fb520af65fd - rustc_query_system::query::plumbing::ensure_query_impl::hec652927a136abc8
  32:     0x7fb520dd7e7c - rustc_mir::transform::mir_const::hc71de9a5543cad3e
  33:     0x7fb520d4cfb8 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_const>::compute::h5cc7a945118b6060
  34:     0x7fb520c433e7 - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::hba9971be539dc293
  35:     0x7fb520ac4e14 - rustc_query_system::query::plumbing::get_query_impl::ha55d44f1e62f8ef6
  36:     0x7fb520dd8349 - rustc_mir::transform::mir_promoted::ha74274350b32e48c
  37:     0x7fb520e22168 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_promoted>::compute::hac7ef20239caa560
  38:     0x7fb520c17a2b - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::h2cea77d31cb86f3f
  39:     0x7fb520ae23c9 - rustc_query_system::query::plumbing::get_query_impl::he14525912feb6126
  40:     0x7fb520e5ac66 - rustc_mir::borrow_check::mir_borrowck::h36a01cec74a149cb
  41:     0x7fb520e2d757 - core::ops::function::FnOnce::call_once::h3404bcb0fed919ad
  42:     0x7fb51f7b4dee - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute::h04e812456adfe4b0
  43:     0x7fb51f76dbf0 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h334ed6218328ffbc
  44:     0x7fb51f7b795b - rustc_data_structures::stack::ensure_sufficient_stack::h8775cd94ce51d4fd
  45:     0x7fb51f7600a7 - rustc_query_system::query::plumbing::get_query_impl::hee9a73cf3bb51533
  46:     0x7fb51f762149 - rustc_query_system::query::plumbing::ensure_query_impl::h5a10e70c7461c3bf
  47:     0x7fb51f78c979 - rustc_session::utils::<impl rustc_session::session::Session>::time::h307c9a8ae086a366
  48:     0x7fb51f7d0a32 - rustc_interface::passes::analysis::h1277a6a22a164c98
  49:     0x7fb51f5b02fb - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::he772285573dcf530
  50:     0x7fb51f5986ed - rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}::haf660f8b5fc0a8b6
  51:     0x7fb51f530531 - rustc_query_system::query::plumbing::get_query_impl::h9637293c1f2da416
  52:     0x7fb51f5b546f - rustc_interface::passes::QueryContext::enter::h33139460b088ed05
  53:     0x7fb51f5c2ef5 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h58cc75bad344bc3b
  54:     0x7fb51f57e6f7 - rustc_span::with_source_map::hb087a1c2bc75d8e9
  55:     0x7fb51f5c40eb - rustc_interface::interface::create_compiler_and_run::ha492945fb183c01e
  56:     0x7fb51f592690 - scoped_tls::ScopedKey<T>::set::hf41307147817b997
  57:     0x7fb51f5a3927 - std::sys_common::backtrace::__rust_begin_short_backtrace::h645f3b510f7fe2fd
  58:     0x7fb51f51894a - core::ops::function::FnOnce::call_once{{vtable.shim}}::h19b1a0a715ec4eae
  59:     0x7fb51ecc47ba - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hea1090dbdcecbf5a
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/alloc/src/boxed.rs:1328:9
  60:     0x7fb51ecc47ba - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8d5723d3912bd325
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/alloc/src/boxed.rs:1328:9
  61:     0x7fb51ecc47ba - std::sys::unix::thread::Thread::new::thread_start::hc17a425ca2995724
                               at /rustc/29e32120c33d30ff526fc7f4d94ec9fce0dc10c9/library/std/src/sys/unix/thread.rs:71:17
  62:     0x7fb51ebb53e9 - start_thread
  63:     0x7fb51ead2293 - __GI___clone
  64:                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.50.0-nightly (29e32120c 2020-12-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z chalk=yes

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `main`
#1 [mir_const] processing MIR for `main`
#2 [mir_promoted] processing `main`
#3 [mir_borrowck] borrow-checking `main`
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 2 warnings emitted

@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 Dec 20, 2020
fanninpm added a commit to fanninpm/glacier that referenced this issue Dec 20, 2020
@camelid camelid added the A-traits Area: Trait system label Dec 20, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 21, 2020
@camelid
Copy link
Member

camelid commented Jan 13, 2021

Closed by request of @jackh726.

@camelid camelid closed this as completed Jan 13, 2021
@jackh726
Copy link
Member

Just want to leave some reasoning behind closing this: We discussed this in our wg-traits meeting today. We basically agree that right now the chalk-integration is so experimental that things not working is basically expected. Most of the test suite doesn't even pass with compare-mode=chalk. Once we get to a point that nearly all of the test suite passes with -Z chalk, it'll make more sense to keep chalk-related issues around, particularly under the case that it's something we expect to work with Chalk, but not with the rustc trait solver. If it's a test case that doesn't seem to be covered by the test suite as is, I would expect it's better to just add it as a regular test. But that's sometimes hard to know.

(I'm going to post this to all these 4 closed issues)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system 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

5 participants