Skip to content

Commit

Permalink
Merge #498
Browse files Browse the repository at this point in the history
498: Update to 1.77 r=pietroalbini a=Veykril



Co-authored-by: Lukas Wirth <[email protected]>
  • Loading branch information
bors-ferrocene[bot] and Veykril authored Jun 14, 2024
2 parents ac3dc25 + 3d21066 commit bd8cc2c
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 1 deletion.
37 changes: 37 additions & 0 deletions src/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,18 @@ C signed int type
:dp:`fls_8QIcvapJehqY`
:dt:`C signed int type` is the `signed int` :t:`type` of the :t:`C` language.

.. _fls_roz4WXH5JZFj:

c string literal
^^^^^^^^^^^^^^^^

:dp:`fls_g3NHtaOhTB7g`
A :dt:`c string literal` is a :t:`literal` that consists of multiple characters
with an implicit 0x00 byte appended to it.

:dp:`fls_FZ6QSpjmVme5`
See :s:`CStringLiteral`.

.. _fls_Egfa8tdbqllA:

Call conformance
Expand Down Expand Up @@ -5279,6 +5291,18 @@ not recognize :t:`[escaped character]s`.
:dp:`fls_5x71i3ay3na2`
See ``RawByteStringLiteral.``

.. _fls_yGGvg3e0nPOh:

raw c string literal
^^^^^^^^^^^^^^^^^^^^

:dp:`fls_qhWBzqoYZL0e`
A :dt:`raw c string literal` is a :t:`simple c string literal` that does not
recognize :t:`[escaped character]s`.

:dp:`fls_WpFJyq6q4k6E`
See ``RawCStringLiteral.``

.. _fls_uv4dyt4gi32x:

raw pointer
Expand Down Expand Up @@ -6015,6 +6039,19 @@ of multiple :s:`[AsciiCharacter]s`.
:dp:`fls_OfI70zK68TnQ`
See :s:`SimpleByteStringLiteral`.

.. _fls_fx2hhB0HHSUG:

simple c string literal
^^^^^^^^^^^^^^^^^^^^^^^

:dp:`fls_qoHXrmds9SgI`
A :dt:`simple c string literal` is any :t:`Unicode` character except characters
0x0D (carriage return), 0x22 (quotation mark), 0x5C (reverse solidus) and 0x00
(null byte).

:dp:`fls_ggm5FNUqg9EY`
See :s:`SimpleCStringLiteral`.

.. _fls_6mcm7xdcyn40:

simple import
Expand Down
109 changes: 108 additions & 1 deletion src/lexical-elements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ Literals
BooleanLiteral
| ByteLiteral
| ByteStringLiteral
| CStringLiteral
| CharacterLiteral
| NumericLiteral
| StringLiteral
Expand Down Expand Up @@ -703,6 +704,112 @@ The :t:`type` of a :t:`raw byte string literal` of size ``N`` is ``&'static
br#""#
br##"left #"# right"##
.. _fls_U1gHCy16emVe:

C String Literals
~~~~~~~~~~~~~~~~~

.. rubric:: Syntax

.. syntax::
CStringLiteral ::=
RawCStringLiteral
| SimpleCStringLiteral
.. rubric:: Legality Rules

:dp:`fls_VKCW830CzhhN`
A :t:`c string literal` is a :t:`literal` that consists of multiple characters
with an implicit 0x00 byte appended to it.

:dp:`fls_XJprzaEn82Xs`
The character sequence 0x0D 0xCA (carriage return, new line) is replaced by 0xCA
(new line) inside of a :t:`c string literal`.

.. _fls_p090c5oTnElW:

Simple C String Literals
^^^^^^^^^^^^^^^^^^^^^^^^

.. rubric:: Syntax

.. syntax::

SimpleCStringLiteral ::=
$$c"$$ SimpleCStringContent* $$"$$

SimpleCStringContent ::=
AsciiEscape
| SimpleStringCharacter
| StringContinuation
| UnicodeEscape
:dp:`fls_fnwQHo7twAom`
A :t:`simple c string literal` is any :t:`Unicode` character except characters
0x0D (carriage return), 0x22 (quotation mark), 0x5C (reverse solidus) and 0x00
(null byte).

.. rubric:: Legality Rules

:dp:`fls_nPI7j0siGP8G`
A :t:`simple c string literal` is a :t:`c string literal` where the characters are
:t:`Unicode` characters.

:dp:`fls_Ae7LM4Wg0NA7`
The :t:`type` of a :t:`simple string literal` is :std:`&'static
[core::ffi::CStr]`.

.. rubric:: Examples

.. code-block:: rust
c""
c"cat"
c"\tcol\nrow"
c"bell\x07"
c"\u{B80a}"
c"\
multi\
line\
string"
.. _fls_G4LdypF3rL6i:

Raw C String Literals
^^^^^^^^^^^^^^^^^^^^^

.. rubric:: Syntax

.. syntax::

RawCStringLiteral ::=
$$cr$$ RawCStringContent

RawCStringContent ::=
NestedRawCStringContent
| $$"$$ ~[$$\r$$]* $$"$$
NestedRawCStringContent ::=
$$#$$ RawCStringContent $$#$$

.. rubric:: Legality Rules

:dp:`fls_gLrei65i8Uzq`
A :t:`raw c string literal` is a :t:`simple c string literal` that does not
recognize :t:`[escaped character]s`.

:dp:`fls_9nJHsg9dCi66`
The :t:`type` of a :t:`simple string literal` is :std:`&'static
[core::ffi::CStr]`.

.. rubric:: Examples

.. code-block:: rust
cr""
cr#""#
cr##"left #"# right"##
.. _fls_hv9jtycp0o1y:

Numeric Literals
Expand Down Expand Up @@ -1097,7 +1204,7 @@ The :t:`type` of a :t:`simple string literal` is ``&'static str``.
"cat"
"\tcol\nrow"
"bell\x07"
"\uB80a"
"\u{B80a}"
"\
multi\
line\
Expand Down
5 changes: 5 additions & 0 deletions src/statements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ alternatively executes a :t:`block expression`.
If a :t:`let statement` lacks a :t:`block expression`, then the :t:`pattern` of
the :t:`let statement` shall be an :t:`irrefutable pattern`.

:dp:`fls_1s1UikGU5YQb`
If a :t:`let statement` has a :t:`block expression`, then the :s:`Expression` of
the :s:`LetInitializer` shall not be a :s:`LazyBooleanExpression` or end with
token ``}``.

:dp:`fls_iB25BeFys0j8`
The :t:`expected type` of the :t:`pattern` of the :t:`let statement` is determined as follows:

Expand Down

0 comments on commit bd8cc2c

Please sign in to comment.