Skip to content

ICE: panicked at 'called Result::unwrap() on an Err value: MoveData...compiler/rustc_mir/src/transform/rustc_peek.rs:37:70 #83539

Closed as not planned
@chengniansun

Description

@chengniansun

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-rustc_attrsInternal rustc attributes gated on the `#[rustc_attrs]` feature gate.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-internal-featuresThis issue requires the use of internal features.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions