Skip to content

incremental compilation error with rustc patches that change predicate order #86013

Closed

Description

@tlyu

I'm not sure this counts as minimized. I'm running into #84970 while working on #86011. When either applying or reverting those changes, I get the relevant ICE while running UI tests, if the incremental compilation caches for the tests haven't been cleared. I guess I should expect this sort of thing to happen, but I figured you might want to know some details.

Meta

rustc --version --verbose:

rustc 1.54.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-apple-darwin
release: 1.54.0-dev
LLVM version: 12.0.1

Error output

(without -Z treat-err-as-bug; shows an additional error)

---- [ui] ui/async-await/issues/issue-64964.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: "/Users/tlyu/src/rust-lang/rust/build/x86_64-apple-darwin/stage1/bin/rustc" "/Users/tlyu/src/rust-lang/rust/src/test/ui/async-await/issues/issue-64964.rs" "-Zthreads=1" "--target=x86_64-apple-darwin" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/tlyu/src/rust-lang/rust/build/x86_64-apple-darwin/test/ui/async-await/issues/issue-64964" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/tlyu/src/rust-lang/rust/build/x86_64-apple-darwin/native/rust-test-helpers" "-Z" "query-dep-graph" "-C" "incremental=tmp/issue-64964" "--edition=2018" "-L" "/Users/tlyu/src/rust-lang/rust/build/x86_64-apple-darwin/test/ui/async-await/issues/issue-64964/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: internal compiler error: encountered incremental compilation error with explicit_item_bounds(core[d1d7]::future::from_generator::{opaque#0})
   |
   = help: This is a known issue with the compiler. Run `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

error[E0391]: cycle detected when finding item bounds for `std::future::from_generator::{opaque#0}`
  --> /Users/tlyu/src/rust-lang/rust/library/core/src/future/mod.rs:61:43
   |
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
   |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: ...which again requires finding item bounds for `std::future::from_generator::{opaque#0}`, completing the cycle
   = note: cycle used when privacy access levels

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0391`.

------------------------------------------
Backtrace

thread 'rustc' panicked at 'aborting due to `-Z treat-err-as-bug=1`', compiler/rustc_errors/src/lib.rs:1039:27
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::emit_diagnostic
   2: rustc_errors::Handler::emit_diagnostic
   3: rustc_errors::diagnostic_builder::DiagnosticBuilder::emit
   4: rustc_query_system::query::plumbing::incremental_verify_ich
   5: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
   6: rustc_data_structures::stack::ensure_sufficient_stack
   7: rustc_query_system::query::plumbing::get_query_impl
   8: rustc_query_system::query::plumbing::get_query
   9: <rustc_privacy::DefIdVisitorSkeleton<V> as rustc_middle::ty::fold::TypeVisitor>::visit_ty
  10: rustc_privacy::DefIdVisitor::visit
  11: rustc_privacy::ReachEverythingInTheInterfaceVisitor::ty
  12: <rustc_privacy::EmbargoVisitor as rustc_hir::intravisit::Visitor>::visit_item
  13: rustc_hir::intravisit::Visitor::visit_nested_item
  14: rustc_hir::intravisit::walk_ty
  15: rustc_hir::intravisit::walk_impl_item
  16: rustc_hir::intravisit::Visitor::visit_nested_impl_item
  17: rustc_hir::intravisit::walk_item
  18: <rustc_privacy::EmbargoVisitor as rustc_hir::intravisit::Visitor>::visit_item
  19: rustc_hir::intravisit::Visitor::visit_nested_item
  20: rustc_hir::intravisit::walk_mod
  21: <rustc_privacy::EmbargoVisitor as rustc_hir::intravisit::Visitor>::visit_mod
  22: rustc_hir::intravisit::walk_crate
  23: rustc_privacy::privacy_access_levels
  24: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  26: rustc_data_structures::stack::ensure_sufficient_stack
  27: rustc_query_system::query::plumbing::force_query_with_job
  28: rustc_query_system::query::plumbing::get_query_impl
  29: rustc_query_system::query::plumbing::get_query
  30: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  31: std::panicking::try
  32: rustc_session::utils::<impl rustc_session::session::Session>::time
  33: rustc_interface::passes::analysis
  34: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  35: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  36: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  37: rustc_data_structures::stack::ensure_sufficient_stack
  38: rustc_query_system::query::plumbing::force_query_with_job
  39: rustc_query_system::query::plumbing::get_query_impl
  40: rustc_query_system::query::plumbing::get_query
  41: rustc_middle::ty::query::TyCtxtAt::analysis
             at ./compiler/rustc_middle/src/ty/query/mod.rs:205:17
  42: rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::analysis
             at ./compiler/rustc_middle/src/ty/query/mod.rs:186:17
  43: rustc_driver::run_compiler::{{closure}}::{{closure}}::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:391:30
  44: rustc_interface::passes::QueryContext::enter::{{closure}}
             at ./compiler/rustc_interface/src/passes.rs:754:42
  45: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./compiler/rustc_middle/src/ty/context.rs:1723:50
  46: rustc_middle::ty::context::tls::set_tlv
             at ./compiler/rustc_middle/src/ty/context.rs:1707:9
  47: rustc_middle::ty::context::tls::enter_context
             at ./compiler/rustc_middle/src/ty/context.rs:1723:9
  48: rustc_interface::passes::QueryContext::enter
             at ./compiler/rustc_interface/src/passes.rs:754:9
  49: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:390:13
  50: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at ./compiler/rustc_interface/src/queries.rs:428:19
  51: rustc_driver::run_compiler::{{closure}}
             at ./compiler/rustc_driver/src/lib.rs:313:22
  52: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at ./compiler/rustc_interface/src/interface.rs:208:13
  53: rustc_span::with_source_map
             at ./compiler/rustc_span/src/lib.rs:870:5
  54: rustc_interface::interface::create_compiler_and_run
             at ./compiler/rustc_interface/src/interface.rs:202:5
  55: rustc_interface::interface::run_compiler::{{closure}}
             at ./compiler/rustc_interface/src/interface.rs:224:12
  56: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:152:13
  57: scoped_tls::ScopedKey<T>::set
             at /Users/tlyu/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  58: rustc_span::with_session_globals
             at ./compiler/rustc_span/src/lib.rs:104:5
  59: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:150:9
  60: rustc_interface::util::scoped_thread::{{closure}}
             at ./compiler/rustc_interface/src/util.rs:125:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Activity

  1. added
    C-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.
    on Jun 4, 2021
  2. tlyu commented on Jun 4, 2021

    @tlyu
    ContributorAuthor

    @rustbot label +A-incr-comp

  3. tlyu commented on Jun 13, 2021

    @tlyu
    ContributorAuthor

    It looks like this won't be a problem in practice, if commit hash tracking is enabled. I set ignore-git = false in config.toml and could no longer reproduce the ICE with that config. So I'm guessing that invalidation of incremental caches accounts for commit hashes, and it's probably sufficient to prevent this from happening in releases. And probably only people who are building the dev channel will be affected by the ICE, because that defaults to ignoring commit hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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