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

Error while building with main being extern (a separately compiled C module) #86110

Closed
eliotmoss opened this issue Jun 7, 2021 · 7 comments · Fixed by #86190
Closed

Error while building with main being extern (a separately compiled C module) #86110

eliotmoss opened this issue Jun 7, 2021 · 7 comments · Fixed by #86190
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eliotmoss
Copy link

eliotmoss commented Jun 7, 2021

Code

Not minimal, but possibly helpful, from src/lib.rs:

extern {
    #[link(name = "libtestline", kind = "static", link_name = "main")]
    fn main() -> isize;
}

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (6c2dd251b 2021-06-05)
binary: rustc
commit-hash: 6c2dd251bbff03c7a3092d43fb5b637eca0810e3
commit-date: 2021-06-05
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output

error: internal compiler error: compiler/rustc_ty_utils/src/ty.rs:461:9: asyncness: expected fn-like node but got `DefId(0:4296 ~ pmu[7eea]::::main)`

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:1007:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: 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.54.0-nightly (6c2dd251b 2021-06-05) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C embed-bitcode=no -C opt-level=2 -C linker-plugin-lto=/usr/local/llvm-12.0.1-rc1/lib/LLVMgold.so -C linker=clang -C link-arg=-flto=full -C link-arg=-fuse-ld=/usr/local/llvm-12.0.1-rc1/bin/ld.lld -C target-cpu=x86-64 --crate-type bin

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

query stack during panic:
#0 [asyncness] checking if the function is async: `main`
#1 [analysis] running analysis passes on this crate
end of query stack
Backtrace

stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_ty_utils::ty::asyncness
   8: rustc_query_system::query::plumbing::get_query_impl
   9: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::asyncness
  10: rustc_typeck::check_for_entry_fn
  11: rustc_typeck::check_crate
  12: rustc_interface::passes::analysis
  13: rustc_query_system::query::plumbing::get_query_impl
  14: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  15: rustc_interface::passes::QueryContext::enter
  16: rustc_span::with_session_globals

@eliotmoss eliotmoss 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 Jun 7, 2021
@jonas-schievink jonas-schievink added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 7, 2021
@apiraino
Copy link
Contributor

apiraino commented Jun 8, 2021

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-low

@rustbot rustbot added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 8, 2021
@asquared31415
Copy link
Contributor

This appears to have been caused by #84401

@asquared31415
Copy link
Contributor

@rustbot claim

@Cancelll
Copy link

Cancelll commented Jun 10, 2021

A potential duplicate

union Foo {
    a: isize,
    b: &T,
}
enum Bar {
    Boo = [Foo { b: () }.a][3],
}

@asquared31415
Copy link
Contributor

No that's a completely different error

@Cancelll
Copy link

Cancelll commented Jun 10, 2021

No that's a completely different error

Sorry I misread the error message, It is probably a duplicate of #83531

@asquared31415
Copy link
Contributor

Yep, that looks very similar

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) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants