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

Entered unreachable code in rustc_resolve::::Resolver::resolve_rustdoc_path #108762

Open
12101111 opened this issue Mar 5, 2023 · 3 comments
Open
Assignees
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-resolve Area: Name resolution C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@12101111
Copy link
Contributor

12101111 commented Mar 5, 2023

Maybe related: #96012

Code

git clone https://github.com/DelSkayn/rquickjs.git
cd rquickjs
git submodule update --init --recursive

Remove this line:

diff --git a/sys/build.rs b/sys/build.rs
index 4c1ca1c..e27fe20 100644
--- a/sys/build.rs
+++ b/sys/build.rs
@@ -116,7 +116,7 @@ fn main() {
         builder.file(out_dir.join(src));
     }

-    builder.compile("libquickjs.a");
+    // builder.compile("libquickjs.a");
 }

 fn feature_to_cargo(name: impl AsRef<str>) -> String {
cargo build --features="macro"

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (44cfafe2f 2023-03-03)
binary: rustc
commit-hash: 44cfafe2fafe816395d3acc434663a45d5178c41
commit-date: 2023-03-03
host: x86_64-unknown-linux-musl
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

error: Error relocating /var/tmp/rust/debug/deps/librquickjs_macro-efe9159a12e70037.so: JS_Eval: symbol not found
  --> src/lib.rs:96:9
   |
96 | pub use rquickjs_macro::{bind, embed, FromJs, HasRefs, IntoJs, IntoJsByRef};
   |         ^^^^^^^^^^^^^^

thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_resolve/src/lib.rs:1883:67
Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/44cfafe2fafe816395d3acc434663a45d5178c41/library/std/src/panicking.rs:579:5
   1: core::panicking::panic_fmt
             at /rustc/44cfafe2fafe816395d3acc434663a45d5178c41/library/core/src/panicking.rs:64:14
   2: core::panicking::panic
             at /rustc/44cfafe2fafe816395d3acc434663a45d5178c41/library/core/src/panicking.rs:114:5
   3: <rustc_resolve::Resolver>::resolve_rustdoc_path
   4: <rustc_resolve::late::LateResolutionVisitor>::resolve_and_cache_rustdoc_path
   5: <rustc_resolve::late::LateResolutionVisitor>::resolve_doc_links
   6: <rustc_resolve::Resolver>::late_resolve_crate
   7: <rustc_session::session::Session>::time::<(), <rustc_resolve::Resolver>::resolve_crate::{closure#0}>
   8: <rustc_resolve::Resolver>::resolve_crate
   9: rustc_interface::passes::resolver_for_lowering
  10: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task_impl<rustc_query_impl::plumbing::QueryCtxt, (), &rustc_data_structures::steal::Steal<(rustc_middle::ty::ResolverAstLowering, alloc::rc::Rc<rustc_ast::ast::Crate>)>>::{closure#0}, &rustc_data_structures::steal::Steal<(rustc_middle::ty::ResolverAstLowering, alloc::rc::Rc<rustc_ast::ast::Crate>)>>
  11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::resolver_for_lowering, rustc_query_impl::plumbing::QueryCtxt>
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::resolver_for_lowering
  13: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#2}, &rustc_data_structures::steal::Steal<(rustc_middle::ty::ResolverAstLowering, alloc::rc::Rc<rustc_ast::ast::Crate>)>>
  14: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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.69.0-nightly (44cfafe2f 2023-03-03) running on x86_64-unknown-linux-musl

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -C target-cpu=skylake -C linker=clang -C link-arg=-fuse-ld=lld -C target-feature=-crt-static

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

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
error: could not compile `rquickjs` due to previous error

@12101111 12101111 added C-bug Category: This is a bug. 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. labels Mar 5, 2023
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 5, 2023
@jyn514
Copy link
Member

jyn514 commented Mar 5, 2023

cc @petrochenkov

@jyn514 jyn514 added the A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name label Mar 5, 2023
@petrochenkov petrochenkov self-assigned this Mar 5, 2023
@workingjubilee workingjubilee added the A-resolve Area: Name resolution label Mar 6, 2023
@langston-barrett
Copy link

@rustbot label +E-needs-mcve

@rustbot rustbot added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Mar 18, 2023
@cormac-ainc
Copy link

I had this issue but it went away after cargo clean. I have a suspicion it's just cargo getting bad file mtimes after a git checkout or whatever and not rebuilding stuff correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-resolve Area: Name resolution C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants