Skip to content

Commit be4f7be

Browse files
authored
Merge pull request #1483 from mattheww/2024-03_unicode_escape_fix
Literal expressions: fix mistake in the definition of unicode escapes
2 parents 5afb503 + 659915c commit be4f7be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/expressions/literal-expr.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The escaped value is the character whose [Unicode scalar value] is the result of
7676

7777
The escape sequence consists of `\u{`, followed by a sequence of characters each of which is a hexadecimal digit or `_`, followed by `}`.
7878

79-
The escaped value is the character whose [Unicode scalar value] is the result of interpreting the hexadecimal digits contained in the escape sequence as a hexadecimal integer, as if by [`u8::from_str_radix`] with radix 16.
79+
The escaped value is the character whose [Unicode scalar value] is the result of interpreting the hexadecimal digits contained in the escape sequence as a hexadecimal integer, as if by [`u32::from_str_radix`] with radix 16.
8080

8181
> **Note**: the permitted forms of a [CHAR_LITERAL] or [STRING_LITERAL] token ensure that there is such a character.
8282
@@ -438,6 +438,7 @@ The expression's type is the primitive [boolean type], and its value is:
438438
[`f64::INFINITY`]: ../../core/primitive.f64.md#associatedconstant.INFINITY
439439
[`f64::NAN`]: ../../core/primitive.f64.md#associatedconstant.NAN
440440
[`u8::from_str_radix`]: ../../core/primitive.u8.md#method.from_str_radix
441+
[`u32::from_str_radix`]: ../../core/primitive.u32.md#method.from_str_radix
441442
[`u128::from_str_radix`]: ../../core/primitive.u128.md#method.from_str_radix
442443
[CHAR_LITERAL]: ../tokens.md#character-literals
443444
[STRING_LITERAL]: ../tokens.md#string-literals

0 commit comments

Comments
 (0)