Skip to content

attempted to read from stolen value: rustc_middle::mir::Body #8516

Closed
@zhiburt

Description

@zhiburt

Hi there,

Happy 8 march (for all women reading it)

I just encounter this issue.
I am not sure if it is a duplicate or fixed already.

cargo clean resolved it.

[mzhiburt@fedora tabled]$ RUST_BACKTRACE=1 cargo clippy
    Checking papergrid v0.2.1 (/home/mzhiburt/projects/tabled/papergrid)
thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:445:36
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
   2: rustc_mir_transform::check_unsafety::unsafety_check_result
   3: core::ops::function::FnOnce::call_once
   4: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   5: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory
   6: rustc_query_system::query::plumbing::try_execute_query
   7: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::unsafety_check_result
   8: rustc_mir_transform::check_unsafety::check_unsafety
   9: rustc_session::utils::<impl rustc_session::session::Session>::time
  10: rustc_interface::passes::analysis
  11: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  12: rustc_data_structures::stack::ensure_sufficient_stack
  13: rustc_query_system::query::plumbing::try_execute_query
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  15: rustc_interface::passes::QueryContext::enter
  16: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  17: rustc_span::with_source_map
  18: 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-clippy/issues/new

note: Clippy version: clippy 0.1.57 (f1edd04 2021-11-29)

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `<impl at papergrid/src/lib.rs:56:1: 536:2>::get_settings`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `papergrid`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions