Skip to content

Commit

Permalink
Merge #424
Browse files Browse the repository at this point in the history
424: Various fixes r=Dajamante a=Veykril

Closes #111
Closes #142
Closes #166
Closes #412

Co-authored-by: Lukas Wirth <[email protected]>
  • Loading branch information
bors-ferrocene[bot] and Veykril authored Aug 4, 2023
2 parents d302733 + 2c7b6cf commit 250a237
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 31 deletions.
13 changes: 13 additions & 0 deletions src/associated-items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ within an :t:`implementation`.
:dp:`fls_bx7931x4155h`
An :t:`associated implementation type` shall have an :t:`initialization type`.

:dp:`fls_bnTcCbDvdp94`
An :t:`associated trait item` is an :t:`associated item` that appears
within a :t:`trait`.

:dp:`fls_N3cdn4lCZ2Bf`
An :t:`associated trait implementation item` is an :t:`associated item` that
appears within a :t:`trait implementation`.

:dp:`fls_x564isbhobym`
An :t:`associated trait constant` is an :t:`associated constant` that appears
within a :t:`trait`.
Expand Down Expand Up @@ -131,6 +139,11 @@ is equivalent to a :t:`where clause` of the following form:
:dp:`fls_oy92gzxgc273`
A :t:`method` is an :t:`associated function` with a :t:`receiver`.

:dp:`fls_oHxzyaiT7Qm6`
The :t:`visibility modifier` of an :t:`associated trait item` or :t:`associated
trait implementation item` is rejected, but may still be consumed by
:t:`[macro]s`.

.. rubric:: Examples

.. code-block:: rust
Expand Down
10 changes: 5 additions & 5 deletions src/concurrency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Send and Sync
.. rubric:: Legality Rules

:dp:`fls_n5l17mlglq11`
The Rust programming language provides synchronization facilities for
:t:`[type]s` through the :std:`core::marker::Send` and
:std:`core::marker::Sync` :t:`[trait]s`.
The Rust programming language provides the :std:`core::marker::Send` and
:std:`core::marker::Sync` :t:`[trait]s` for preventing data races at the
:t:`type` level.

:dp:`fls_2jujsujpjp3w`
A :t:`send type` is a :t:`type` that implements the :std:`core::marker::Send`
Expand All @@ -59,8 +59,8 @@ An :t:`abstract data type` automatically implements the
:t:`[field]s` are :t:`[sync type]s`.

:dp:`fls_zgemofbs5q2x`
A :t:`sync type` shall have :t:`[reference]s` that are safe to transfer across
thread boundaries.
A :t:`sync type` shall have :t:`[value]s` that are allowed to be shared across
multiple threads at any given time without incurring data races.

.. _fls_vyc9vcuamlph:

Expand Down
23 changes: 5 additions & 18 deletions src/generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ default :t:`value` of its related :t:`type parameter`.

:dp:`fls_3qZRBp9j26w3`
The :t:`type` of the :t:`type parameter initializer` of a :t:`type parameter`
shall satisfy the :t:`[type bound]s` of the :t:`type parameter`.
shall satisfy the :t:`[trait bound]s` of the :t:`type parameter`.

:dp:`fls_x4s7p2v981r6`
A :t:`generic enum` shall use all of its :t:`[type parameter]s` and
Expand Down Expand Up @@ -282,7 +282,7 @@ true for the supplied :t:`[generic argument]s`.

:dp:`fls_1xgw1dq60quz`
A :t:`trivial predicate` is a :t:`where clause predicate` that does not use
the :t:`[generic parameter]s` or :t:`[higher-ranked lifetime]s` of the related
the :t:`[generic parameter]s` or :t:`[higher-ranked trait bound]s` of the related
:t:`construct`.

:dp:`fls_47s8i7pzb9gg`
Expand Down Expand Up @@ -320,7 +320,7 @@ Generic Arguments
ConstantArgument ::=
BlockExpression
| $$-$$? LiteralExpression
| SimplePathSegment
| Identifier
LifetimeArgument ::=
LifetimeIndication
Expand Down Expand Up @@ -433,7 +433,8 @@ of the :t:`type parameter`.
:t:`[generic argument]s` are :t:`[constant parameter]s` with
:t:`[constant parameter initializer]s`, :t:`[lifetime parameter]s` with
either inferred :t:`[lifetime argument]s` or :t:`[elided lifetime]s`,
:t:`[type parameter]s` with :t:`[type parameter initializer]s`, and
:t:`[type parameter]s` with :t:`[type parameter initializer]s` or inferred
:t:`[type argument]s`, and

* :dp:`fls_us7d30cbwgpz`
All :t:`[lifetime argument]s` come first, followed by
Expand Down Expand Up @@ -461,17 +462,3 @@ The :t:`value` of a :t:`constant parameter` is determined as follows:

* :dp:`fls_Kyar0jH9BqeW`
Otherwise this is a static error.

:dp:`fls_sVTgsE9WwRvm`
The :t:`value` of a :t:`type parameter` is determined as follows:

* :dp:`fls_nFwbc2vX3Ar9`
If the :t:`type parameter` has a conformant :t:`type argument`, then the
:t:`value` is that of the :t:`type argument`.

* :dp:`fls_MaEZ8U4uF8Hz`
Otherwise, if the :t:`type parameter` has a :t:`type parameter initializer`,
then the :t:`value` is that of the :t:`type parameter initializer`.

* :dp:`fls_x98oSjktXHNN`
Otherwise this is a static error.
18 changes: 18 additions & 0 deletions src/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,24 @@ associated trait function
An :dt:`associated trait function` is an :t:`associated function` that appears
within a :t:`trait`.

.. _fls_47xtji9Pk8Lw:

associated trait implementation item
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:dp:`fls_PaENehzTVgfB`
An :dt:`associated trait implementation item` is an :t:`associated item` that
appears within a :t:`trait implementation`.

.. _fls_J946yIcmlAyV:

associated trait item
^^^^^^^^^^^^^^^^^^^^^

:dp:`fls_IlRrVLm05GTf`
An :dt:`associated trait item` is an :t:`associated item` that appears
within a :t:`trait`.

.. _fls_azz308k3ra99:

associated trait type
Expand Down
8 changes: 4 additions & 4 deletions src/lexical-elements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ The following names are used when referring to :t:`[punctuator]s`:
- Equals
* - :dp:`fls_9gdyw71dl25`
- ``==``
- Equals equals
- Equals equals, logical equality
* - :dp:`fls_sp8ufz28l9w3`
- ``!=``
- Not equals
Expand All @@ -355,10 +355,10 @@ The following names are used when referring to :t:`[punctuator]s`:
- Less than
* - :dp:`fls_ui40thspgyav`
- ``>=``
- Greater than equals
- Greater than equals, greater than or equal to
* - :dp:`fls_h33qzachmimc`
- ``<=``
- Less than equals
- Less than equals, less than or equal to
* - :dp:`fls_13ud1clgdnyv`
- ``@``
- At
Expand Down Expand Up @@ -388,7 +388,7 @@ The following names are used when referring to :t:`[punctuator]s`:
- Colon
* - :dp:`fls_9dd9479zzq30`
- ``::``
- Path separator
- Colon colon, path separator
* - :dp:`fls_kwsu9d3ppv3f`
- ``->``
- Right arrow
Expand Down
4 changes: 2 additions & 2 deletions src/patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,8 @@ A :t:`binding` of a :t:`binding pattern` binds a matched :t:`value` to a

:dp:`fls_RViC5UEZPQUV`
A :t:`binding` with :t:`binding mode` :dt:`by value` binds the matched
:t:`value` by :t:`[pass]ing` the :t:`value` to the :t:`place` indicated by the
:t:`name`.
:t:`value` by :t:`passing <passing convention>` the :t:`value` to the :t:`place`
indicated by the :t:`name`.

:dp:`fls_6lXtoxebD5It`
A :t:`binding` with :t:`binding mode` :dt:`by reference` binds an
Expand Down
10 changes: 9 additions & 1 deletion src/types-and-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,12 @@ The following :t:`[expression]s` are considered :t:`[type inference root]s`:
* :dp:`fls_KphY5qHev0Dc`
The :t:`expression` of a :t:`discriminant initializer`.

* :dp:`fls_67Bf5kR5OtYW`
The :t:`expression` of a :t:`constant parameter initializer`.

* :dp:`fls_sAS3vQpkjksr`
The :t:`expression` of a :t:`constant argument`.

* :dp:`fls_Sowatt1V988J`
A :t:`function body`.

Expand Down Expand Up @@ -2254,7 +2260,9 @@ The :t:`type inference` rules for :t:`[statement]s` are as follows:

* :dp:`fls_97Fxlv2KN6QF`
:t:`[Expression statement]s` apply the :t:`expression` inference rules outlined below
to the related :t:`expression`, without any :t:`expected type` set.
to the related :t:`expression`, with the :t:`expected type` set to the
:t:`unit type` if the :t:`expression statement` lacks the character 0x3B
(semicolon), unset otherwise.

* :dp:`fls_hzXqj6YT1mFr`
:t:`[Let statement]s` are inferred as follows:
Expand Down
3 changes: 2 additions & 1 deletion src/values.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ The :t:`type` of a :t:`static` shall implement the :std:`core::marker::Sized`
:t:`trait`.

:dp:`fls_doi4z6u55bi7`
A :t:`mutable static` is a :t:`static` whose :t:`value` can be modified.
A :t:`mutable static` is a :t:`static` with :t:`keyword` ``mut`` whose
:t:`value` can be modified.

:dp:`fls_74hp208pto22`
Access to a :t:`mutable static` shall require :t:`unsafe context`.
Expand Down

0 comments on commit 250a237

Please sign in to comment.