Skip to content

Incremental compilation error with evaluate_obligation: Ok(EvaluatedToOkModuloRegions) #85360

@Imberflur

Description

@Imberflur

I was hoping this would be fixed by #85186 but we are still experiencing this issue on the 2021-05-15 nightly

Code

Original case:
https://gitlab.com/veloren/veloren/-/tree/imbris/update-toolchain

Reduced case:
https://github.com/Imberflur/incremental-ice-with-specs

// lib.rs

use specs::{
    shred::ResourceId, Component, ParJoin, ReadStorage, System, SystemData, World,
};

pub struct Pos;

impl Component for Pos {
    type Storage = specs::VecStorage<Self>;
}

pub struct InterpBuffer<T> {
    _t: T,
}

impl<T: 'static + Send + Sync> Component for InterpBuffer<T> {
    type Storage = specs::VecStorage<Self>;
}

#[derive(SystemData)]
pub struct ReadData<'a> {
    pos_interpdata: ReadStorage<'a, InterpBuffer<Pos>>,
}

#[derive(Default)]
pub struct Sys;

impl<'a> System<'a> for Sys {
    type SystemData = (ReadData<'a>, ReadStorage<'a, Pos>);

    fn run(&mut self, (data, pos): Self::SystemData) {
        (&pos, &data.pos_interpdata).par_join();
    }
}
# Cargo.toml

[dependencies.specs]
version = "0.16.1"
git = "https://github.com/amethyst/specs"
rev = "1a113a85fb6283d23294a58c2ef749d41cad5deb"
features = ["derive"]

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (8cf990c9b 2021-05-15)
binary: rustc
commit-hash: 8cf990c9b5c59f25c806fad9f4466f9d6509bbea
commit-date: 2021-05-15
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output (original case)

   Compiling veloren-common-systems v0.9.0 (/home/projects/veloren2/common/systems)
   Compiling veloren-world v0.9.0 (/home/projects/veloren2/world)
   Compiling veloren-client v0.9.0 (/home/projects/veloren2/client)
error: internal compiler error: encountered incremental compilation error with evaluate_obligation(d2f6f8c07ccd5d49-bd504c819d17ce51)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p veloren_common_systems` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information

thread 'rustc' panicked at 'Found unstable fingerprints for evaluate_obligation(d2f6f8c07ccd5d49-bd504c819d17ce51): Ok(EvaluatedToOkModuloRegions)', /rustc/8cf990c9b5c59f25c806fad9f4466f9d6509bbea/compiler/rustc_query_system/src/query/plumbing.rs:619:9


note: compiler flags: -C opt-level=2 -C panic=abort -C embed-bitcode=no -C codegen-units=8 -C debug-assertions=on -C incremental -C link-arg=-fuse-ld=gold --crate-type lib

note: some of the compiler flags provided by cargo are hidden
Backtrace

   0: rust_begin_unwind
             at /rustc/8cf990c9b5c59f25c806fad9f4466f9d6509bbea/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/8cf990c9b5c59f25c806fad9f4466f9d6509bbea/library/std/src/panicking.rs:435:5
   2: rustc_query_system::query::plumbing::incremental_verify_ich
   3: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
   4: rustc_data_structures::stack::ensure_sufficient_stack
   5: rustc_query_system::query::plumbing::get_query_impl
   6: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::evaluate_obligation
   7: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
   8: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
   9: rustc_trait_selection::traits::fulfill::FulfillProcessor::process_trait_obligation
  10: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
  11: rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations
  12: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
  13: <rustc_infer::infer::InferCtxtBuilder as rustc_trait_selection::infer::InferCtxtBuilderExt>::enter_canonical_trait_query
  14: rustc_traits::normalize_projection_ty::normalize_projection_ty
  15: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::normalize_projection_ty>::compute
  16: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  17: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::get_query_impl
  20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::normalize_projection_ty
  21: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty
  22: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
  23: rustc_middle::ty::fold::TypeFoldable::fold_with
  24: rustc_middle::ty::structural_impls::<impl rustc_middle::ty::fold::TypeFoldable for &rustc_middle::ty::TyS>::super_fold_with
  25: <rustc_trait_selection::traits::query::normalize::QueryNormalizer as rustc_middle::ty::fold::TypeFolder>::fold_ty
  26: <rustc_infer::infer::at::At as rustc_trait_selection::traits::query::normalize::AtExt>::normalize
  27: rustc_infer::infer::InferCtxtBuilder::enter
  28: core::ops::function::FnOnce::call_once
  29: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  30: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
  31: rustc_data_structures::stack::ensure_sufficient_stack
  32: rustc_query_system::query::plumbing::get_query_impl
  33: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::normalize_generic_arg_after_erasing_regions
  34: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle::ty::fold::TypeFolder>::fold_ty
  35: <rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor>::visit_terminator
  36: rustc_mir::monomorphize::collector::collect_neighbours
  37: rustc_mir::monomorphize::collector::collect_items_rec
  38: rustc_mir::monomorphize::collector::collect_items_rec
  39: rustc_mir::monomorphize::collector::collect_items_rec
  40: rustc_mir::monomorphize::collector::collect_items_rec
  41: rustc_mir::monomorphize::collector::collect_items_rec
  42: rustc_mir::monomorphize::collector::collect_items_rec
  43: rustc_mir::monomorphize::collector::collect_items_rec
  44: rustc_mir::monomorphize::collector::collect_items_rec
  45: rustc_mir::monomorphize::collector::collect_items_rec
  46: rustc_session::utils::<impl rustc_session::session::Session>::time
  47: rustc_mir::monomorphize::collector::collect_crate_mono_items
  48: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  49: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::collect_and_partition_mono_items>::compute
  50: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  51: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  52: rustc_data_structures::stack::ensure_sufficient_stack
  53: rustc_query_system::query::plumbing::force_query_with_job
  54: rustc_query_system::query::plumbing::get_query_impl
  55: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_and_partition_mono_items
  56: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  57: rustc_interface::passes::QueryContext::enter
  58: rustc_interface::queries::Queries::ongoing_codegen
  59: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  60: rustc_span::with_source_map
  61: rustc_interface::interface::create_compiler_and_run
  62: scoped_tls::ScopedKey<T>::set

query stack during panic

#0 [evaluate_obligation] evaluating trait selection obligation `specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>>: std::marker::Sized`
#1 [normalize_projection_ty] normalizing `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: ProjectionTy { substs: [rayon::iter::MapInit<rayon::iter::Filter<specs::join::JoinParIter<(&specs::Read<specs::world::EntitiesRes>, &mut specs::Storage<veloren_common::comp::Pos, specs::shred::FetchMut<specs::storage::MaskedStorage<veloren_common::comp::Pos>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>>>>)>, [closure@common/systems/src/interpolation.rs:49:21: 49:62]>, [closure@common/systems/src/interpolation.rs:51:17: 54:18], [closure@common/systems/src/interpolation.rs:55:17: 57:18]>], item_def_id: DefId(83:4492 ~ rayon[db88]::iter::ParallelIterator::Item) } } }`
#2 [normalize_generic_arg_after_erasing_regions] normalizing `fn(rayon::iter::MapInit<rayon::iter::Filter<specs::join::JoinParIter<(&specs::Read<specs::world::EntitiesRes>, &mut specs::Storage<veloren_common::comp::Pos, specs::shred::FetchMut<specs::storage::MaskedStorage<veloren_common::comp::Pos>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>>>>)>, [closure@common/systems/src/interpolation.rs:49:21: 49:62]>, [closure@common/systems/src/interpolation.rs:51:17: 54:18], [closure@common/systems/src/interpolation.rs:55:17: 57:18]>) {<() as rayon::iter::FromParallelIterator<<rayon::iter::MapInit<rayon::iter::Filter<specs::join::JoinParIter<(&specs::Read<specs::world::EntitiesRes>, &mut specs::Storage<veloren_common::comp::Pos, specs::shred::FetchMut<specs::storage::MaskedStorage<veloren_common::comp::Pos>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>>>>)>, [closure@common/systems/src/interpolation.rs:49:21: 49:62]>, [closure@common/systems/src/interpolation.rs:51:17: 54:18], [closure@common/systems/src/interpolation.rs:55:17: 57:18]> as rayon::iter::ParallelIterator>::Item>>::from_par_iter::<rayon::iter::MapInit<rayon::iter::Filter<specs::join::JoinParIter<(&specs::Read<specs::world::EntitiesRes>, &mut specs::Storage<veloren_common::comp::Pos, specs::shred::FetchMut<specs::storage::MaskedStorage<veloren_common::comp::Pos>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Pos>>>>, &specs::Storage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>, specs::shred::Fetch<specs::storage::MaskedStorage<veloren_common_net::sync::interpolation::InterpBuffer<veloren_common::comp::Vel>>>>)>, [closure@common/systems/src/interpolation.rs:49:21: 49:62]>, [closure@common/systems/src/interpolation.rs:51:17: 54:18], [closure@common/systems/src/interpolation.rs:55:17: 57:18]>>}`
#3 [collect_and_partition_mono_items] collect_and_partition_mono_items

Error output (reduced case)

error: internal compiler error: encountered incremental compilation error with evaluate_obligation(cf1bd6537d51543b-849a581f5e8ac13b)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p ice_test` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information

thread 'rustc' panicked at 'Found unstable fingerprints for evaluate_obligation(cf1bd6537d51543b-849a581f5e8ac13b): Ok(EvaluatedToOkModuloRegions)', /rustc/8cf990c9b5c59f25c806fad9f4466f9d6509bbea/compiler/rustc_query_system/src/query/plumbing.rs:619:9
Backtrace

   0: rust_begin_unwind
             at /rustc/8cf990c9b5c59f25c806fad9f4466f9d6509bbea/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/8cf990c9b5c59f25c806fad9f4466f9d6509bbea/library/std/src/panicking.rs:435:5
   2: rustc_query_system::query::plumbing::incremental_verify_ich
   3: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
   4: rustc_data_structures::stack::ensure_sufficient_stack
   5: rustc_query_system::query::plumbing::get_query_impl
   6: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::evaluate_obligation
   7: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation
   8: <rustc_infer::infer::InferCtxt as rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt>::evaluate_obligation_no_overflow
   9: rustc_trait_selection::traits::fulfill::FulfillProcessor::process_trait_obligation
  10: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
  11: rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations
  12: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
  13: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_all_or_error
  14: rustc_trait_selection::traits::codegen::drain_fulfillment_cx_or_panic
  15: rustc_infer::infer::InferCtxtBuilder::enter
  16: rustc_trait_selection::traits::codegen::codegen_fulfill_obligation
  17: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::codegen_fulfill_obligation>::compute
  18: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  19: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  20: rustc_data_structures::stack::ensure_sufficient_stack
  21: rustc_query_system::query::plumbing::force_query_with_job
  22: rustc_query_system::query::plumbing::get_query_impl
  23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::codegen_fulfill_obligation
  24: rustc_ty_utils::instance::inner_resolve_instance
  25: rustc_ty_utils::instance::resolve_instance
  26: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::resolve_instance>::compute
  27: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  28: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  29: rustc_data_structures::stack::ensure_sufficient_stack
  30: rustc_query_system::query::plumbing::force_query_with_job
  31: rustc_query_system::query::plumbing::get_query_impl
  32: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::resolve_instance
  33: rustc_middle::ty::instance::Instance::resolve_opt_const_arg
  34: rustc_middle::ty::instance::Instance::resolve
  35: <rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor>::visit_terminator
  36: rustc_mir::monomorphize::collector::collect_neighbours
  37: rustc_mir::monomorphize::collector::collect_items_rec
  38: rustc_mir::monomorphize::collector::collect_items_rec
  39: rustc_session::utils::<impl rustc_session::session::Session>::time
  40: rustc_mir::monomorphize::collector::collect_crate_mono_items
  41: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  42: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::collect_and_partition_mono_items>::compute
  43: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  44: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  45: rustc_data_structures::stack::ensure_sufficient_stack
  46: rustc_query_system::query::plumbing::force_query_with_job
  47: rustc_query_system::query::plumbing::get_query_impl
  48: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_and_partition_mono_items
  49: rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local
  50: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  51: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  52: rustc_data_structures::stack::ensure_sufficient_stack
  53: rustc_query_system::query::plumbing::force_query_with_job
  54: rustc_query_system::query::plumbing::get_query_impl
  55: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::exported_symbols
  56: rustc_metadata::rmeta::encoder::EncodeContext::encode_crate_root
  57: rustc_metadata::rmeta::encoder::encode_metadata_impl
  58: rustc_data_structures::sync::join
  59: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::encode_metadata
  60: rustc_middle::ty::context::TyCtxt::encode_metadata
  61: rustc_interface::passes::QueryContext::enter
  62: rustc_interface::queries::Queries::ongoing_codegen
  63: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  64: rustc_span::with_source_map
  65: rustc_interface::interface::create_compiler_and_run
  66: scoped_tls::ScopedKey<T>::set

query stack during panic

#0 [evaluate_obligation] evaluating trait selection obligation `specs::storage::MaskedStorage<InterpBuffer<Pos>>: std::marker::Sized`
#1 [codegen_fulfill_obligation] checking if `std::ops::Deref` fulfills its obligations
#2 [resolve_instance] resolving instance `<specs::shred::Fetch<specs::storage::MaskedStorage<InterpBuffer<Pos>>> as std::ops::Deref>::deref`
#3 [collect_and_partition_mono_items] collect_and_partition_mono_items
#4 [exported_symbols] exported_symbols

Metadata

Metadata

Assignees

Labels

A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions