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

#![no_std] build fails if lib.rs exists #101669

Closed
flippette opened this issue Sep 11, 2022 · 2 comments
Closed

#![no_std] build fails if lib.rs exists #101669

flippette opened this issue Sep 11, 2022 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@flippette
Copy link

Code

ice.tar.gz

Meta

rustc --version --verbose:

rustc 1.65.0-nightly (228710758 2022-09-10)
binary: rustc
commit-hash: 2287107588d92889d282e6cd3c1ca5df34cd34a5
commit-date: 2022-09-10
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

thread 'rustc' panicked at 'identifier: "metadata_std_required", attr: None, args: FluentArgs([("add_info", String("")), ("crate_name", String("std")), ("locator_triple", String("x86_64-flos"))]), errors: [ResolverError(Reference(Variable { id: "current_crate" }))]', compiler/rustc_errors/src/translation.rs:91:17
stack backtrace:
   0:     0x7fcf2de43eb0 - std::backtrace_rs::backtrace::libunwind::trace::h1c0da60f68cd52d0
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7fcf2de43eb0 - std::backtrace_rs::backtrace::trace_unsynchronized::he45e10f3230d4a33
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fcf2de43eb0 - std::sys_common::backtrace::_print_fmt::hb7277fb151a2024e
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7fcf2de43eb0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb354ed7aeb9d4ccd
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7fcf2de9ef0e - core::fmt::write::hec67a20123752277
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/core/src/fmt/mod.rs:1202:17
   5:     0x7fcf2de34595 - std::io::Write::write_fmt::h86bc6ecfe8b97adf
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/io/mod.rs:1679:15
   6:     0x7fcf2de46b63 - std::sys_common::backtrace::_print::he9b60e75426b4e2c
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7fcf2de46b63 - std::sys_common::backtrace::print::h0094cd5e7dc5d2a3
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7fcf2de46b63 - std::panicking::default_hook::{{closure}}::he873f51ceb39b7ab
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/panicking.rs:295:22
   9:     0x7fcf2de4684f - std::panicking::default_hook::hbd7e8dfbbdcbdd8d
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/panicking.rs:314:9
  10:     0x7fcf306b2561 - rustc_driver[45772c003865a0c4]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fcf2de4739d - std::panicking::rust_panic_with_hook::h440e574bebabd5f6
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/panicking.rs:702:17
  12:     0x7fcf2de471f7 - std::panicking::begin_panic_handler::{{closure}}::hf702db29496c8f6a
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/panicking.rs:588:13
  13:     0x7fcf2de4435c - std::sys_common::backtrace::__rust_end_short_backtrace::h4097c6961f4e3bab
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7fcf2de46f12 - rust_begin_unwind
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/panicking.rs:584:5
  15:     0x7fcf2de9bae3 - core::panicking::panic_fmt::hd4f28c73cc2dd5f9
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/core/src/panicking.rs:142:14
  16:     0x7fcf3040f7a7 - <rustc_errors[4c251b6c70f47263]::emitter::EmitterWriter as rustc_errors[4c251b6c70f47263]::translation::Translate>::translate_message
  17:     0x7fcf30404112 - <rustc_errors[4c251b6c70f47263]::emitter::EmitterWriter>::msg_to_buffer
  18:     0x7fcf3040c9c0 - <rustc_errors[4c251b6c70f47263]::emitter::EmitterWriter>::emit_message_default
  19:     0x7fcf303fb534 - <rustc_errors[4c251b6c70f47263]::emitter::EmitterWriter as rustc_errors[4c251b6c70f47263]::emitter::Emitter>::emit_diagnostic
  20:     0x7fcf303f8b1d - <rustc_errors[4c251b6c70f47263]::json::Diagnostic>::from_errors_diagnostic
  21:     0x7fcf303f6cfe - <rustc_errors[4c251b6c70f47263]::json::JsonEmitter as rustc_errors[4c251b6c70f47263]::emitter::Emitter>::emit_diagnostic
  22:     0x7fcf2f5047bd - <rustc_errors[4c251b6c70f47263]::HandlerInner>::emit_diagnostic
  23:     0x7fcf2f02b701 - <rustc_errors[4c251b6c70f47263]::Handler>::emit_diagnostic
  24:     0x7fcf2fa5f4fd - <rustc_errors[4c251b6c70f47263]::ErrorGuaranteed as rustc_errors[4c251b6c70f47263]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  25:     0x7fcf31319029 - <rustc_session[3a147eccae9de049]::session::Session>::emit_err::<rustc_metadata[de639d5be0974727]::errors::CannotFindCrate>
  26:     0x7fcf312dde33 - <rustc_metadata[de639d5be0974727]::locator::CrateError>::report
  27:     0x7fcf2f574645 - <rustc_metadata[de639d5be0974727]::creader::CrateLoader>::resolve_crate
  28:     0x7fcf2fed275c - <rustc_metadata[de639d5be0974727]::creader::CrateLoader>::process_extern_crate
  29:     0x7fcf2fec82ef - <rustc_resolve[77d4da380b7c964d]::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast[7d9557efc5128161]::visit::Visitor>::visit_item
  30:     0x7fcf2fed49e1 - <rustc_resolve[77d4da380b7c964d]::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast[7d9557efc5128161]::visit::Visitor>::visit_crate
  31:     0x7fcf2f9b4efe - <rustc_resolve[77d4da380b7c964d]::Resolver as rustc_expand[4f2caab2d2ba981a]::base::ResolverExpand>::visit_ast_fragment_with_placeholders
  32:     0x7fcf2fa75090 - <rustc_expand[4f2caab2d2ba981a]::expand::MacroExpander>::fully_expand_fragment
  33:     0x7fcf2f4a16b3 - <rustc_expand[4f2caab2d2ba981a]::expand::MacroExpander>::expand_crate
  34:     0x7fcf2f4a08c3 - <rustc_session[3a147eccae9de049]::session::Session>::time::<core[5a729203526575bf]::result::Result<rustc_ast[7d9557efc5128161]::ast::Crate, rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>, rustc_interface[2e430490b24d666b]::passes::configure_and_expand::{closure#1}>
  35:     0x7fcf2f468ed3 - rustc_interface[2e430490b24d666b]::passes::configure_and_expand
  36:     0x7fcf2f45f7f5 - <rustc_interface[2e430490b24d666b]::queries::Queries>::expansion
  37:     0x7fcf2f45c18c - rustc_interface[2e430490b24d666b]::interface::create_compiler_and_run::<core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>, rustc_driver[45772c003865a0c4]::run_compiler::{closure#1}>
  38:     0x7fcf2f45abc1 - <scoped_tls[18b9aee780902605]::ScopedKey<rustc_span[df2b32850c624801]::SessionGlobals>>::set::<rustc_interface[2e430490b24d666b]::interface::run_compiler<core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>, rustc_driver[45772c003865a0c4]::run_compiler::{closure#1}>::{closure#0}, core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>>
  39:     0x7fcf2f45a8af - std[2c47335e2f8b42a0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2e430490b24d666b]::util::run_in_thread_pool_with_globals<rustc_interface[2e430490b24d666b]::interface::run_compiler<core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>, rustc_driver[45772c003865a0c4]::run_compiler::{closure#1}>::{closure#0}, core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>>::{closure#0}, core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>>
  40:     0x7fcf3051ecc0 - <<std[2c47335e2f8b42a0]::thread::Builder>::spawn_unchecked_<rustc_interface[2e430490b24d666b]::util::run_in_thread_pool_with_globals<rustc_interface[2e430490b24d666b]::interface::run_compiler<core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>, rustc_driver[45772c003865a0c4]::run_compiler::{closure#1}>::{closure#0}, core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>>::{closure#0}, core[5a729203526575bf]::result::Result<(), rustc_errors[4c251b6c70f47263]::ErrorGuaranteed>>::{closure#1} as core[5a729203526575bf]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7fcf2de51173 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h86a4b020a74606cb
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/alloc/src/boxed.rs:1940:9
  42:     0x7fcf2de51173 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he22d4ad283374c0d
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/alloc/src/boxed.rs:1940:9
  43:     0x7fcf2de51173 - std::sys::unix::thread::Thread::new::thread_start::ha509852e7590b369
                               at /rustc/2287107588d92889d282e6cd3c1ca5df34cd34a5/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7fcf2dba678d - <unknown>
  45:     0x7fcf2dc278e4 - clone
  46:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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.65.0-nightly (228710758 2022-09-10) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C panic=abort -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z unstable-options

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

query stack during panic:
end of query stack
error: could not compile `flos`
Backtrace

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
   1: cargo_bootimage::main
   2: std::sys_common::backtrace::__rust_begin_short_backtrace
   3: std::rt::lang_start::{{closure}}
   4: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/core/src/ops/function.rs:280:13
   5: std::panicking::try::do_call
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/panicking.rs:492:40
   6: std::panicking::try
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/panicking.rs:456:19
   7: std::panic::catch_unwind
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/panic.rs:137:14
   8: std::rt::lang_start_internal::{{closure}}
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/rt.rs:148:48
   9: std::panicking::try::do_call
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/panicking.rs:492:40
  10: std::panicking::try
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/panicking.rs:456:19
  11: std::panic::catch_unwind
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/panic.rs:137:14
  12: std::rt::lang_start_internal
             at /rustc/c2804e6ec2c29a5c7368600ea173b890e2655c3d/library/std/src/rt.rs:148:20
  13: main
  14: <unknown>
  15: __libc_start_main
  16: _start
             at /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115

@flippette flippette 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 Sep 11, 2022
@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Sep 11, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 11, 2022
@jyn514 jyn514 added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Sep 11, 2022
@jyn514
Copy link
Member

jyn514 commented Sep 11, 2022

Looks like one of the fluent templates has a typo in the variable name, cc @davidtwco

@fmease
Copy link
Member

fmease commented Sep 11, 2022

Potentially a duplicate of #101640.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2022
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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

5 participants