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: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path with staged_api #108697

Closed
matthiaskrgr opened this issue Mar 3, 2023 · 0 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Mar 3, 2023

Code

#![feature(staged_api)]
#[path = "lol"]
mod foo;

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (13471d3b2 2023-03-02)
binary: rustc
commit-hash: 13471d3b2046cce78181dde6cfc146c09f55e29e
commit-date: 2023-03-02
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

rustc input.rs -Zunpretty=mir


Backtrace

error: couldn't read lol: No such file or directory (os error 2)
 --> c4f21587457c1555591e125fe0184bf8aa7092ab.rs:3:1
  |
3 | mod foo;
  | ^^^^^^^^

error: internal compiler error: compiler/rustc_middle/src/ty/query.rs:442:1: `tcx.resolutions(())` is not supported for local crate;
                                hint: Queries can be either made to the local crate, or the external crate. This error means you tried to use it for one that's not supported.
                                If that's not the case, resolutions was likely never assigned to a provider function.

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/compiler/rustc_errors/src/lib.rs:1644:9
stack backtrace:
   0:     0x7f1187166afa - std::backtrace_rs::backtrace::libunwind::trace::h637e47b9909fae47
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f1187166afa - std::backtrace_rs::backtrace::trace_unsynchronized::h725f8fbf201ae939
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1187166afa - std::sys_common::backtrace::_print_fmt::hfd2cb77b12075aea
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f1187166afa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h181c2029f72603b7
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f11871ca27e - core::fmt::write::h48806d3c55cbdf53
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f1187159b65 - std::io::Write::write_fmt::h951b1cdca2a5246b
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/io/mod.rs:1684:15
   6:     0x7f11871668c5 - std::sys_common::backtrace::_print::hdef9582e7c66ea95
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f11871668c5 - std::sys_common::backtrace::print::h9388e8bbfc613a19
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f118716963f - std::panicking::default_hook::{{closure}}::hedc5ba3a57eb4819
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/panicking.rs:271:22
   9:     0x7f118716937b - std::panicking::default_hook::hf39c0463b6419742
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/panicking.rs:290:9
  10:     0x7f118a3d8505 - <rustc_driver_impl[a13de5c36671b58c]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[46c15247431b7881]::ops::function::FnOnce<(&core[46c15247431b7881]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f1187169e7d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h8d25106cd317952a
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/alloc/src/boxed.rs:2001:9
  12:     0x7f1187169e7d - std::panicking::rust_panic_with_hook::h8e4a64188288f65b
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/panicking.rs:696:13
  13:     0x7f118a935b61 - std[376c807fe342e932]::panicking::begin_panic::<rustc_errors[33e55714e5cb0dc1]::ExplicitBug>::{closure#0}
  14:     0x7f118a92e2e6 - std[376c807fe342e932]::sys_common::backtrace::__rust_end_short_backtrace::<std[376c807fe342e932]::panicking::begin_panic<rustc_errors[33e55714e5cb0dc1]::ExplicitBug>::{closure#0}, !>
  15:     0x7f118a9a36b6 - std[376c807fe342e932]::panicking::begin_panic::<rustc_errors[33e55714e5cb0dc1]::ExplicitBug>
  16:     0x7f118a9820a6 - std[376c807fe342e932]::panic::panic_any::<rustc_errors[33e55714e5cb0dc1]::ExplicitBug>
  17:     0x7f118a97e9d6 - <rustc_errors[33e55714e5cb0dc1]::HandlerInner>::bug::<&alloc[47a59a72c138ea16]::string::String>
  18:     0x7f118a97e6a0 - <rustc_errors[33e55714e5cb0dc1]::Handler>::bug::<&alloc[47a59a72c138ea16]::string::String>
  19:     0x7f118a95534b - rustc_middle[98a7f7ed7c0bfadc]::util::bug::opt_span_bug_fmt::<rustc_span[437fddf2f9d22ddd]::span_encoding::Span>::{closure#0}
  20:     0x7f118a9525ca - rustc_middle[98a7f7ed7c0bfadc]::ty::context::tls::with_opt::<rustc_middle[98a7f7ed7c0bfadc]::util::bug::opt_span_bug_fmt<rustc_span[437fddf2f9d22ddd]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f118a952596 - rustc_middle[98a7f7ed7c0bfadc]::ty::context::tls::with_context_opt::<rustc_middle[98a7f7ed7c0bfadc]::ty::context::tls::with_opt<rustc_middle[98a7f7ed7c0bfadc]::util::bug::opt_span_bug_fmt<rustc_span[437fddf2f9d22ddd]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f118a955296 - rustc_middle[98a7f7ed7c0bfadc]::util::bug::opt_span_bug_fmt::<rustc_span[437fddf2f9d22ddd]::span_encoding::Span>
  23:     0x7f1188aa7813 - rustc_middle[98a7f7ed7c0bfadc]::util::bug::bug_fmt
  24:     0x7f118a9b36d0 - <<rustc_middle[98a7f7ed7c0bfadc]::ty::query::Providers as core[46c15247431b7881]::default::Default>::default::{closure#1} as core[46c15247431b7881]::ops::function::FnOnce<(rustc_middle[98a7f7ed7c0bfadc]::ty::context::TyCtxt, ())>>::call_once
  25:     0x7f118aca0cba - rustc_query_system[cb38010b79291b30]::query::plumbing::try_execute_query::<rustc_query_impl[6f0ac54305a53c1d]::queries::resolutions, rustc_query_impl[6f0ac54305a53c1d]::plumbing::QueryCtxt>
  26:     0x7f118ad2e528 - <rustc_query_impl[6f0ac54305a53c1d]::Queries as rustc_middle[98a7f7ed7c0bfadc]::ty::query::QueryEngine>::resolutions
  27:     0x7f11889dee50 - rustc_privacy[d41e0d190c9d4824]::effective_visibilities
  28:     0x7f1189c2bce5 - rustc_query_system[cb38010b79291b30]::query::plumbing::try_execute_query::<rustc_query_impl[6f0ac54305a53c1d]::queries::effective_visibilities, rustc_query_impl[6f0ac54305a53c1d]::plumbing::QueryCtxt>
  29:     0x7f1189c2ba2f - <rustc_query_impl[6f0ac54305a53c1d]::Queries as rustc_middle[98a7f7ed7c0bfadc]::ty::query::QueryEngine>::effective_visibilities
  30:     0x7f118985dae2 - rustc_passes[c0a29cd11c85c75c]::stability::check_unused_or_stable_features
  31:     0x7f118985cf88 - <rustc_session[8a59d1677d18b6aa]::session::Session>::time::<(), rustc_interface[6d9307a77dbaf07b]::passes::analysis::{closure#0}::{closure#2}::{closure#0}>
  32:     0x7f118884b58c - <rustc_session[8a59d1677d18b6aa]::session::Session>::time::<(), rustc_interface[6d9307a77dbaf07b]::passes::analysis::{closure#0}>
  33:     0x7f118884a578 - rustc_interface[6d9307a77dbaf07b]::passes::analysis
  34:     0x7f1189c32dfd - rustc_query_system[cb38010b79291b30]::query::plumbing::try_execute_query::<rustc_query_impl[6f0ac54305a53c1d]::queries::analysis, rustc_query_impl[6f0ac54305a53c1d]::plumbing::QueryCtxt>
  35:     0x7f1189c32aff - <rustc_query_impl[6f0ac54305a53c1d]::Queries as rustc_middle[98a7f7ed7c0bfadc]::ty::query::QueryEngine>::analysis
  36:     0x7f118a3fe4df - rustc_driver_impl[a13de5c36671b58c]::pretty::print_after_hir_lowering
  37:     0x7f118a4002ab - <rustc_middle[98a7f7ed7c0bfadc]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[a13de5c36671b58c]::run_compiler::{closure#1}::{closure#2}::{closure#1}, core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>>
  38:     0x7f118963bc80 - rustc_span[437fddf2f9d22ddd]::with_source_map::<core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>, rustc_interface[6d9307a77dbaf07b]::interface::run_compiler<core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>, rustc_driver_impl[a13de5c36671b58c]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  39:     0x7f1189632c6c - std[376c807fe342e932]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6d9307a77dbaf07b]::util::run_in_thread_pool_with_globals<rustc_interface[6d9307a77dbaf07b]::interface::run_compiler<core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>, rustc_driver_impl[a13de5c36671b58c]::run_compiler::{closure#1}>::{closure#0}, core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>>
  40:     0x7f118963269a - <<std[376c807fe342e932]::thread::Builder>::spawn_unchecked_<rustc_interface[6d9307a77dbaf07b]::util::run_in_thread_pool_with_globals<rustc_interface[6d9307a77dbaf07b]::interface::run_compiler<core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>, rustc_driver_impl[a13de5c36671b58c]::run_compiler::{closure#1}>::{closure#0}, core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[46c15247431b7881]::result::Result<(), rustc_span[437fddf2f9d22ddd]::ErrorGuaranteed>>::{closure#1} as core[46c15247431b7881]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7f1187173cb3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8af2b0e7ccbdd87d
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/alloc/src/boxed.rs:1987:9
  42:     0x7f1187173cb3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8c0f3591e5655093
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/alloc/src/boxed.rs:1987:9
  43:     0x7f1187173cb3 - std::sys::unix::thread::Thread::new::thread_start::h1760c99e52d00196
                               at /rustc/13471d3b2046cce78181dde6cfc146c09f55e29e/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7f1186f06bb5 - <unknown>
  45:     0x7f1186f88d90 - <unknown>
  46:                0x0 - <unknown>

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.69.0-nightly (13471d3b2 2023-03-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unpretty=mir

query stack during panic:
#0 [resolutions] getting the resolver outputs
#1 [effective_visibilities] checking effective visibilities
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Mar 3, 2023
@Noratrieb Noratrieb changed the title ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir, staged_api ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path Mar 3, 2023
@Noratrieb Noratrieb changed the title ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path with staged_api Mar 3, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 27, 2024
…e -Zunpretty=mir on invalid module path with staged_ap

Fixes rust-lang#108697
@bors bors closed this as completed in c968b8b Apr 28, 2024
blyxyas pushed a commit to blyxyas/rust that referenced this issue Apr 28, 2024
…e -Zunpretty=mir on invalid module path with staged_ap

Fixes rust-lang#108697
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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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

1 participant