Skip to content

-Ztranslate-additional-ftl for a broken fluent bundle with stray interpolation argument unexpectedly ICEs #135817

Open
@jieyouxu

Description

@jieyouxu

https://github.com/rust-lang/rust/blob/ebbe63891f1fae21734cb97f2f863b08b1d44bf8/tests/run-make/translation/Makefile has a test comment and test case:

# Check that a primary bundle with a broken message (e.g. a interpolated
# variable is missing) will use the fallback bundle.
missing: test.rs missing.ftl
$(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/missing.ftl 2>&1 | $(CGREP) "struct literal body without path"

Ignoring that this is using the wrong .ftl file (it should be using broken.ftl to correspond to the test comment, where broken.ftl contains a slug that has a stray fluent interpolation argument), this must have regressed over the years because

rustc test.rs -Ztranslate-additional-ftl=broken.ftl

actually ICEs locally due to

thread 'rustc' panicked at compiler/rustc_errors/src/emitter.rs:1465:84:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `parse_struct_literal_body_without_path`:
the fluent string has an argument `foo` that was not found.
help: no arguments are available

Pinging back to #132181.

I assume this is not the intended behavor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-run-makeArea: port run-make Makefiles to rmake.rsA-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) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions