Skip to content

Commit 03aa1fc

Browse files
committed
Remove "Unique Representation" Note.
The definition is not useful and none of the types that noted uniquness actually upholds that definition if pointer fragments are allowed to be read as integer types.
1 parent 0bd1163 commit 03aa1fc

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

src/memory-model.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ A sequence of bytes is said to represent a value of a type, if the decode operat
5151

5252
> [!NOTE]
5353
> Representation is related to, but is not the same property as, the layout of the type.
54-
> A type has a unique representation when each value is represented by exactly one byte sequence. Most primitive types have unique representations.
5554
5655
r[memory.encoding.symmetric]
5756
The result of encoding a given value of a type is a sequence of bytes that represents that value.

src/types/numeric.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ A value `i` of an unsigned integer type `U` is represented by a sequence of init
8383
> [!WARN]
8484
> On `little` endian, the order of bytes used to decode an integer type is the same as the natural order of a `u8` array - that is, the `m` value corresponds with the `m` index into a same-sized `u8` array. On `big` endian, however, the order is the opposite of this order - that is, the `m` value corresponds with the `size_of::<T>() - m` index in that array.
8585
86-
8786
r[type.numeric.repr.signed]
8887
A value `i` of a signed integer type with width `N` is represented the same as the corresponding value of the unsigned counterpart type which is congruent modulo `2^N`.
8988

@@ -98,9 +97,6 @@ A floating-point value is represented by the following decoding:
9897
* The byte sequence is decoded as the unsigned integer type with the same width as the floating-point type,
9998
* The resulting integer is decoded according to [IEEE 754-2019] into the format used for the type.
10099

101-
> [!NOTE]
102-
> The representation of each finite number and infinity is unique as a result of the definition of [IEEE 754-2019].
103-
> The exact behaviour of encoding and decoding NaNs is not yet decided
104100

105101
r[type.numeric.repr.float-format]
106102
The [IEEE 754-2019] `binary32` format is used for `f32`, and the `binary64` format is used for `f64`. The set of values for each floating-point type are determined by the respective format.

src/types/textual.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ or 0xE000 to 0x10FFFF range.
1818
r[type.text.char-repr]
1919
A value of type `char` is represented as the value of type `u32` with value equal to the code point that it represents.
2020

21-
> [!NOTE]
22-
> The representation of `char` is unique.
23-
2421
r[type.text.str-value]
2522
A value of type `str` is represented the same way as `[u8]`, a slice of
2623
8-bit unsigned bytes. However, the Rust standard library makes extra assumptions

0 commit comments

Comments
 (0)