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 when compiling time::macros::format_description #9188

Closed
rossmacarthur opened this issue Jul 16, 2022 · 2 comments
Closed

ICE when compiling time::macros::format_description #9188

rossmacarthur opened this issue Jul 16, 2022 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@rossmacarthur
Copy link

rossmacarthur commented Jul 16, 2022

Summary

I haven't delved deeper as to what about this macro triggers the ICE but I am consistently able to replicate using the following.

Using the time crate version 0.3.11.

time::macros::format_description!("[day] [month repr:long] [year]");

Error

thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 2', compiler/rustc_builtin_macros/src/format.rs:1001:28

Version

rustc 1.64.0-nightly (23e21bdd2 2022-07-15)
binary: rustc
commit-hash: 23e21bdd25026e2839ebe946c2a937c1904887d2
commit-date: 2022-07-15
host: aarch64-apple-darwin
release: 1.64.0-nightly
LLVM version: 14.0.6

Error output

Backtrace

  Checking time v0.3.11
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 2', compiler/rustc_builtin_macros/src/format.rs:1001:28
stack backtrace:
 0: _rust_begin_unwind
 1: core::panicking::panic_fmt
 2: core::panicking::panic_bounds_check
 3: rustc_builtin_macros::format::expand_preparsed_format_args
 4: rustc_builtin_macros::format::expand_format_args_impl
 5: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
 6: <rustc_expand::expand::MacroExpander>::expand_crate
 7: <rustc_session::session::Session>::time::<core::result::Result<rustc_ast::ast::Crate, rustc_errors::ErrorGuaranteed>, rustc_interface::passes::configure_and_expand::{closure#1}>
 8: <rustc_interface::passes::boxed_resolver::BoxedResolver>::access::<<rustc_interface::queries::Queries>::expansion::{closure#0}::{closure#0}, core::result::Result<rustc_ast::ast::Crate, rustc_errors::ErrorGuaranteed>>
 9: <rustc_interface::queries::Queries>::expansion
10: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
11: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
12: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
13: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.64.0-nightly (23e21bdd2 2022-07-15) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2

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

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

@rossmacarthur rossmacarthur added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jul 16, 2022
@rossmacarthur
Copy link
Author

Nvm just realized this isn't just clippy will move to the Rust repository

@rossmacarthur
Copy link
Author

See rust-lang/rust#99261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

1 participant