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: failed while formatting fluent string #109327

Closed
antilankin opened this issue Mar 18, 2023 · 4 comments
Closed

ICE: failed while formatting fluent string #109327

antilankin opened this issue Mar 18, 2023 · 4 comments
Labels
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) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@antilankin
Copy link

antilankin commented Mar 18, 2023

I ran into this error while working on a rust bevy app. I boiled it down to this minimal example.

Code

use bevy::prelude::*;

#[derive(Component)]
pub struct Animations<'a> {
    current_animation: &'a str,
}

pub fn animation_system(mut animation_query: Query<(&mut Animations, &mut Handle<Image>)>) {}

fn main() {
    App::new()
        .add_startup_system(setup)
        .add_system(animation_system)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2dBundle::default());
}

Meta

rustc --version --verbose:

rustc 1.68.0 (2c8cc3432 2023-03-06)
binary: rustc
commit-hash: 2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74
commit-date: 2023-03-06
host: x86_64-pc-windows-msvc
release: 1.68.0
LLVM version: 15.0.6

Error output

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `infer_but_needs_to_satisfy`:
the fluent string has an argument `has_param_name` that was not found.
help: the arguments `has_lifetime`, `lifetime` and `spans_empty` are available
', compiler\rustc_errors\src\emitter.rs:1391:84
stack backtrace:
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.68.0 (2c8cc3432 2023-03-06) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [check_well_formed] checking that `animation_system` is well-formed
#1 [check_mod_type_wf] checking that types are well-formed in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: no warnings or errors encountered even though `delayed_good_path_bugs` issued

error: internal compiler error: trimmed_def_paths constructed but no error emitted; use `DelayDm` for lints or `with_no_trimmed_paths` for debugging
  |
  = note: delayed at    0: std::backtrace::Backtrace::disabled
             1: std::backtrace::Backtrace::force_capture
             2: <rustc_middle::ty::context::DeducedParamAttrs as core::fmt::Debug>::fmt
             3: <rustc_middle::ty::print::pretty::TraitPredPrintModifiersAndPath as core::fmt::Debug>::fmt
             4: <rustc_privacy::errors::PrivateInPublicLint as rustc_errors::diagnostic::DecorateLint<()>>::msg
             5: <rustc_query_impl::on_disk_cache::CacheEncoder as rustc_serialize::serialize::Encoder>::emit_raw_bytes
             6: <rustc_privacy::errors::PrivateInPublicLint as rustc_errors::diagnostic::DecorateLint<()>>::msg
             7: <rustc_privacy::errors::PrivateInPublicLint as rustc_errors::diagnostic::DecorateLint<()>>::msg
             8: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
             9: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
            10: <rustc_middle::ty::adt::AdtDef>::has_non_const_dtor
            11: <rustc_middle::ty::Ty as core::fmt::Display>::fmt
            12: <rustc_infer::infer::error_reporting::nice_region_error::NiceRegionError>::try_report
            13: <rustc_infer::infer::error_reporting::TypeErrCtxt>::try_report_nice_region_error
            14: <rustc_infer::infer::error_reporting::TypeErrCtxt>::check_region_obligations_and_report_errors
            15: rustc_hir_analysis::check::intrinsic::check_platform_intrinsic_type
            16: <rustc_hir_analysis::collect::lifetimes::LifetimeContext as rustc_hir::intravisit::Visitor>::visit_lifetime
            17: <rustc_query_impl::on_disk_cache::CacheEncoder as rustc_type_ir::codec::TyEncoder>::encode_alloc_id
            18: <rustc_middle::ty::Visibility as rustc_privacy::VisibilityLike>::new_min
            19: <rustc_hir::lang_items::LanguageItems>::pointer_sized
            20: rustc_hir_analysis::check::intrinsic::check_platform_intrinsic_type
            21: <rustc_query_impl::on_disk_cache::CacheEncoder as rustc_type_ir::codec::TyEncoder>::encode_alloc_id
            22: <core::option::Option<rustc_middle::middle::privacy::Level> as rustc_privacy::VisibilityLike>::new_min
            23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green
            24: <rustc_hir_analysis::variance::variance_of_opaque::{closure#0}::OpaqueTypeLifetimeCollector as rustc_middle::ty::visit::TypeVisitor>::visit_ty
            25: <rustc_hir_analysis::collect::type_of::find_opaque_ty_constraints_for_rpit::ConstraintChecker as rustc_hir::intravisit::Visitor>::visit_expr
            26: rustc_hir_analysis::hir_wf_check::provide
            27: rustc_hir_analysis::check_crate
            28: rustc_interface::passes::analysis
            29: <rustc_query_impl::on_disk_cache::CacheEncoder as rustc_type_ir::codec::TyEncoder>::encode_alloc_id
            30: <core::option::Option<rustc_middle::middle::privacy::Level> as rustc_privacy::VisibilityLike>::new_min
            31: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green
            32: <rustc_data_structures::temp_dir::MaybeTempDir>::new
            33: rustc_driver::args::arg_expand_all
            34: <rustc_data_structures::temp_dir::MaybeTempDir>::new
            35: <rustc_data_structures::temp_dir::MaybeTempDir>::new
            36: <rustc_data_structures::temp_dir::MaybeTempDir>::new
            37: <rustc_data_structures::temp_dir::MaybeTempDir>::new
            38: std::sys::windows::thread::Thread::new
            39: BaseThreadInitThunk
            40: RtlUserThreadStart


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.68.0 (2c8cc3432 2023-03-06) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
error: could not compile 
Backtrace

<backtrace>

@antilankin antilankin 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 18, 2023
@clubby789
Copy link
Contributor

clubby789 commented Mar 18, 2023

I think #107111 fixed this. Does nightly compile/error without ICEing?

@jyn514 jyn514 added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Mar 21, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Mar 21, 2023
@jyn514 jyn514 changed the title Internal compiler error using bevy ICE: failed while formatting fluent string Mar 21, 2023
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Mar 22, 2023
@antilankin
Copy link
Author

antilankin commented Mar 22, 2023

@clubby789 , indeed, compiling with nightly gives an error:

$ rustup install nightly
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2023-03-22, rust version 1.70.0-nightly (1db9c061d 2023-03-21)
...
error[E0759]: `animation_query` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
   --> src\main.rs:8:46
    |
8   | pub fn animation_system(mut animation_query: Query<(&mut Animations, &mut Handle<Image>)>) {}
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                              |
    |                                              this data with an anonymous lifetime `'_`...
    |                                              ...is used and required to live as long as `'static` here
    |
note: `'static` lifetime requirement introduced by this bound

@clubby789
Copy link
Contributor

I'm going to close this now since the fix is on stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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