Skip to content

Commit 8c7895d

Browse files
committed
Promote isize/usize to be the main candidate for literal suffixes.
1 parent c3e4beb commit 8c7895d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

text/0544-rename-int-uint.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ However, given the discussions about the previous revisions of this RFC, and the
4646

4747
# Detailed Design
4848

49-
- Rename `int/uint` to `isize/usize`, with `isz/usz` being their literal suffixes, respectively.
49+
- Rename `int/uint` to `isize/usize`, with them being their own literal suffixes.
5050
- Update code and documentation to use pointer-sized integers more narrowly for their intended purposes. Provide a deprecation period to carry out these updates.
5151

5252
`usize` in action:
@@ -62,7 +62,7 @@ There are different opinions about which literal suffixes to use. The following
6262
### `isize/usize`:
6363

6464
* Pros: They are the same as the type names, very consistent with the rest of the integer primitives.
65-
* Cons: They are too long for some, and may stand out too much as suffixes.
65+
* Cons: They are too long for some, and may stand out too much as suffixes. However, discouraging people from overusing `isize/usize` is the point of this RFC. And if they are not overused, then this will not be a problem in practice.
6666

6767
### `is/us`:
6868

@@ -72,9 +72,11 @@ There are different opinions about which literal suffixes to use. The following
7272
Note: No matter which suffixes get chosen, it can be beneficial to reserve `is` as a keyword, but this is outside the scope of this RFC.
7373

7474
### `iz/uz`:
75+
7576
* Pros and cons: Similar to those of `is/us`, except that `iz/uz` are not actual words, which is an additional advantage. However it may not be immediately clear that `iz/uz` are abbreviations of `isize/usize`.
7677

7778
### `i/u`:
79+
7880
* Pros: They are very succinct.
7981
* Cons: They are *too* succinct and carry the "default integer types" connotation, which is undesirable.
8082

@@ -83,7 +85,7 @@ Note: No matter which suffixes get chosen, it can be beneficial to reserve `is`
8385
* Pros: They are the middle grounds between `isize/usize` and `is/us`, neither too long nor too short. They are not actual English words and it's clear that they are short for `isize/usize`.
8486
* Cons: Not everyone likes the appearances of `isz/usz`, but this can be said about all the candidates.
8587

86-
Thus, this author believes that `isz/usz` are the best choices here.
88+
After community discussions, it is deemed that using `isize/usize` directly as suffixes is a fine choice and there is no need to introduce other suffixes.
8789

8890
## Advantages of `isize/usize`:
8991

0 commit comments

Comments
 (0)