icu4x icon indicating copy to clipboard operation
icu4x copied to clipboard

Consider making root-collation CollatorBorrowed const-constructible from baked data

Open hsivonen opened this issue 7 months ago • 3 comments

If CollatorBorrowed was const-constructible, it would be possible to have a CollatorBorrowed-typed mut static (without wrapping in Option or MaybeUninit) that could be overwritten with a dynamically-initialized CollatorBorrowed from main.

hsivonen avatar May 27 '25 06:05 hsivonen

This seems fine to do, and typically how we do borrowed types.

Does this actually need to be discussed?

Manishearth avatar May 29 '25 17:05 Manishearth

Stating explicitly: I'm in favor of const CollatorBorrowed::new_root()

Manishearth avatar May 29 '25 17:05 Manishearth

It could also be named new_invariant given that in Segmenter we call it InvariantOptions.

sffc avatar Jun 12 '25 01:06 sffc

We should do this; I don't think it needs to be discussed.

Manishearth avatar Aug 22 '25 21:08 Manishearth