rust/compiler/rustc_span
Jacob Pratt 80db7158af
Rollup merge of #151235 - type-info-rename-bits, r=oli-obk
Change field `bit_width: usize` to `bits: u32` in type info

Follow-up https://github.com/rust-lang/rust/pull/151123#discussion_r2698418929. Quotes:

@Skgland:
> > I'm not sure whether we should use `usize` or `u64` here to represent the bit width.
>
> My expectation would be `u32` matching the associated `{u,i}N::BITS`[^1][^2][^3] constant that already exists on the integer types.
>
> [^1]: https://doc.rust-lang.org/std/primitive.i8.html#associatedconstant.BITS
> [^2]: https://doc.rust-lang.org/std/primitive.i128.html#associatedconstant.BITS
> [^3]: https://doc.rust-lang.org/std/primitive.usize.html#associatedconstant.BITS

@SpriteOvO:
> I found some [previous discussions](https://github.com/rust-lang/rust/pull/76492#issuecomment-700516940) regarding the type of `::BITS` constant. And during the stabilization of `::BITS`, the choice of `u32` affected some ecosystem crates (#81654), but soon after, these crates all accepted the `u32` type.
>
> So I think it makes sense to keep the type consistent with `::BITS` here. Then I'd also like to change the name from `bit_width` to `bits`, also for consistency.

r? @oli-obk
2026-01-18 03:16:46 -05:00
..
src Rollup merge of #151235 - type-info-rename-bits, r=oli-obk 2026-01-18 03:16:46 -05:00
Cargo.toml parser/lexer: bump to Unicode 17, use faster unicode-ident 2025-12-27 11:20:24 +01:00