icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

PluralPattern / PatternPlurals::MultipleVariants is uninhabited

Open Manishearth opened this issue 2 months ago • 2 comments

6bfa473dba removed week-of-year fields, and https://github.com/unicode-org/icu4x/issues/5643 is filed to re-add them. With that change, Week became an uninhabited type.

Unfortunately, Week is used in PluralPattern::pivot_field, which makes the whole type uninhabited, as well as PatternPlurals::MultipleVariants.

This throws up unreachable_code warnings.

We should fix this by either:

  • Fixing https://github.com/unicode-org/icu4x/issues/5643 (needs CLDR changes)
  • Removing MultipleVariants and PluralPattern from the data model
  • Turning pivot_field into Option<Week>
  • Changing the type of pivot_field to some other enum

Some of these solutions probably do not actually make sense.

cc @sffc

Manishearth avatar Oct 17 '25 17:10 Manishearth

I prefer to suppress the warnings.

sffc avatar Oct 18 '25 00:10 sffc

@sffc Right, but that's a temporary fix to prevent warnings while we keep the code around for the actual fix.

... but I'm a bit confused as to what the actual fix is. What data does this represent if CLDR hasn't even made a decision on #5643?

Is there data that CLDR has that we do not consume that has this format? Does it pivot on week or something else?

Manishearth avatar Oct 18 '25 02:10 Manishearth