]> git.lizzy.rs Git - rust.git/commit
errors: don't fail on broken primary translations
authorDavid Wood <david.wood@huawei.com>
Wed, 10 Aug 2022 10:48:25 +0000 (11:48 +0100)
committerDavid Wood <david.wood@huawei.com>
Wed, 10 Aug 2022 10:48:25 +0000 (11:48 +0100)
commit2eebd34cd50c1486024da06d24415781af3a0a54
tree3b12cadc0149ffd0206348f59bf6d2581865057b
parent1603a70f82240ba2d27f72f964e36614d7620ad3
errors: don't fail on broken primary translations

If a primary bundle doesn't contain a message then the fallback bundle
is used. However, if the primary bundle's message is broken (e.g. it
refers to a interpolated variable that the compiler isn't providing)
then this would just result in a compiler panic. While there aren't any
primary bundles right now, this is the type of issue that could come up
once translation is further along.

Signed-off-by: David Wood <david.wood@huawei.com>
compiler/rustc_errors/src/emitter.rs
compiler/rustc_errors/src/lib.rs
src/test/run-make/translation/Makefile
src/test/run-make/translation/basic-translation.ftl [deleted file]
src/test/run-make/translation/basic-translation.rs [deleted file]
src/test/run-make/translation/broken.ftl [new file with mode: 0644]
src/test/run-make/translation/missing.ftl [new file with mode: 0644]
src/test/run-make/translation/test.rs [new file with mode: 0644]
src/test/run-make/translation/working.ftl [new file with mode: 0644]