# Pre-RFC: \`usize\` semantics

**URL:** <https://internals.rust-lang.org/t/pre-rfc-usize-semantics/19444>\
**Category:** Unsafe Code Guidelines\
**Created:** [August 29, 2023, 10:42am UTC](https://internals.rust-lang.org/t/pre-rfc-usize-semantics/19444 "2023-08-29T10:42:44Z")\
**Posts on this page:** 1\
**Showing post:** 111

<div class="post-metadata">

**Author:** ![newpavlov](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/newpavlov/32/3290_2.png) [@newpavlov](https://internals.rust-lang.org/u/newpavlov)\
**Post date:** [May 14, 2024, 1:48pm UTC](https://internals.rust-lang.org/t/pre-rfc-usize-semantics/19444/111 "2024-05-14T13:48:40Z")

</div>

I generally agree, but I would like to add the following:

- The proposed mechanism should be general enough, e.g. it should allow the `winapi`/`windows-*` crates to specify that they can work only on Windows targets.
- I think conditionally allowing `From<u32> for usize` impl looks somewhat similar to this [proposal](https://internals.rust-lang.org/t/7163). It would be nice to have the same tooling for both these usecases.
- We will need a rough outline of how the defaults would change in future editions. I don't think we should make the "not-CHERI" condition a default one, i.e. crates should have to explicitly opt out of CHERI support.

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-usize-semantics/19444)._
