Why will Rust integer types be deprecated soon?
Asked Answered
M

1

7

I've noticed a deprecation note on the Rust std page next to u8, i8, u16 and so on:

enter image description here

What is going on, and what will the replacement be?

Mossberg answered 1/2, 2022 at 19:15 Comment(0)
O
16

The types themselves aren't being deprecated, just the modules named e.g. std::i8 which contain constants. For example, std::i8::MIN is being replaced with i8::MIN (docs). The deprecation notice says:

Deprecating in a future Rust version: all constants in this module replaced by associated constants on i8
Objectionable answered 1/2, 2022 at 19:19 Comment(1)
Might be worth mentioning that the exact things being deprecated are the modules named std::i8 and so on, which contain those constants.Adventitious

© 2022 - 2024 — McMap. All rights reserved.