Skip to content

ICE: failed while formatting fluent string #109327

Closed
@antilankin

Description

@antilankin

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-translationArea: Translation infrastructure, and migrating existing diagnostics to SessionDiagnosticC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions