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: panicked at 'called Result::unwrap() on an Err value: MoveData...compiler/rustc_mir/src/transform/rustc_peek.rs:37:70 #83539

Closed
chengniansun opened this issue Mar 26, 2021 · 3 comments
Labels
C-bug Category: This is a bug. F-rustc_attrs Internal rustc attributes gated on the `#[rustc_attrs]` feature gate. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-internal-features This issue requires the use of internal features. 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

@chengniansun
Copy link

Code

#![feature(rustc_attrs)]
struct S;
#[rustc_mir()]
fn foo(x: &S) {
    let ret;
    *x;
    ret
}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (52e3dffa5 2021-03-25)
binary: rustc
commit-hash: 52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07
commit-date: 2021-03-25
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: (MoveData { move_paths: [MovePath { place: _0 }, MovePath { place: _1 }, MovePath { place: _2 }, MovePath { place: _3 }], moves: [mp3@bb0[3], mp2@bb0[5]], loc_map: LocationMap { map: [[[], [], [], [mo0], [], [mo1], []]] }, path_map: [[], [], [mo1], [mo0]], rev_lookup: MovePathLookup { locals: [mp0, mp1, mp2, mp3], projections: {} }, inits: [mp1@Argument(_1) (Deep), mp3@Statement(bb0[2]) (Deep), mp0@Statement(bb0[4]) (Deep)], init_loc_map: LocationMap { map: [[[], [], [in1], [], [in2], [], []]] }, init_path_map: [[in2], [in0], [], [in1]] }, [((*_1), IllegalMove { cannot_move_out_of: IllegalMoveOrigin { location: bb0[2], kind: BorrowedContent { target_place: (*_1) } } })])', compiler/rustc_mir/src/transform/rustc_peek.rs:37:70
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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.53.0-nightly (52e3dffa5 2021-03-25) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

query stack during panic:
#0 [mir_const] processing MIR for `foo`
#1 [mir_promoted] processing `foo`
end of query stack
Backtrace

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: (MoveData { move_paths: [MovePath { place: _0 }, MovePath { place: _1 }, MovePath { place: _2 }, MovePath { place: _3 }], moves: [mp3@bb0[3], mp2@bb0[5]], loc_map: LocationMap { map: [[[], [], [], [mo0], [], [mo1], []]] }, path_map: [[], [], [mo1], [mo0]], rev_lookup: MovePathLookup { locals: [mp0, mp1, mp2, mp3], projections: {} }, inits: [mp1@Argument(_1) (Deep), mp3@Statement(bb0[2]) (Deep), mp0@Statement(bb0[4]) (Deep)], init_loc_map: LocationMap { map: [[[], [], [in1], [], [in2], [], []]] }, init_path_map: [[in2], [in0], [], [in1]] }, [((*_1), IllegalMove { cannot_move_out_of: IllegalMoveOrigin { location: bb0[2], kind: BorrowedContent { target_place: (*_1) } } })])', compiler/rustc_mir/src/transform/rustc_peek.rs:37:70
stack backtrace:
   0: rust_begin_unwind
             at /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/core/src/panicking.rs:92:14
   2: core::result::unwrap_failed
             at /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/core/src/result.rs:1355:5
   3: <rustc_mir::transform::rustc_peek::SanityCheck as rustc_mir::transform::MirPass>::run_pass
   4: rustc_mir::transform::run_passes
   5: rustc_mir::transform::mir_const
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_query_system::query::plumbing::force_query_with_job
   8: rustc_query_system::query::plumbing::get_query_impl
   9: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_const
  10: rustc_mir::transform::mir_promoted
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  12: rustc_query_system::query::plumbing::force_query_with_job
  13: rustc_query_system::query::plumbing::get_query_impl
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_promoted
  15: rustc_mir::borrow_check::mir_borrowck
  16: core::ops::function::FnOnce::call_once
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  18: rustc_query_system::query::plumbing::force_query_with_job
  19: rustc_query_system::query::plumbing::get_query_impl
  20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  21: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  22: rustc_interface::passes::analysis
  23: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  24: rustc_data_structures::stack::ensure_sufficient_stack
  25: rustc_query_system::query::plumbing::force_query_with_job
  26: rustc_query_system::query::plumbing::get_query_impl
  27: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  28: rustc_interface::passes::QueryContext::enter
  29: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  30: rustc_span::with_source_map
  31: rustc_interface::interface::create_compiler_and_run
  32: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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.53.0-nightly (52e3dffa5 2021-03-25) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type staticlib

query stack during panic:
#0 [mir_const] processing MIR for `foo`
#1 [mir_promoted] processing `foo`
#2 [mir_borrowck] borrow-checking `foo`
#3 [analysis] running analysis passes on this crate
end of query stack

@chengniansun chengniansun 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 Mar 26, 2021
@camelid camelid added F-rustc_attrs Internal rustc attributes gated on the `#[rustc_attrs]` feature gate. requires-nightly This issue requires a nightly compiler in some way. labels Mar 26, 2021
@camelid
Copy link
Member

camelid commented Mar 26, 2021

The code has borrowck errors, so this is probably a case of the attribute implementation assuming that the code is valid.

fanninpm added a commit to fanninpm/glacier that referenced this issue Apr 2, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 2, 2021
@workingjubilee
Copy link
Member

If that is true, that's such a strong and incorrect presumption that despite this only triggering on internal-only features, it's still worth fixing this.

@Noratrieb Noratrieb added the requires-internal-features This issue requires the use of internal features. label Apr 5, 2023
@Noratrieb
Copy link
Member

wontfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-rustc_attrs Internal rustc attributes gated on the `#[rustc_attrs]` feature gate. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-internal-features This issue requires the use of internal features. 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

No branches or pull requests

5 participants