Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Aug 4, 2023
1 parent 02a4502 commit 3fdfdb0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 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
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
24 changes: 16 additions & 8 deletions src/types-and-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1672,23 +1672,23 @@ proceeds as follows:
#. :dp:`fls_pGRLTACDvzv2`
Otherwise, if one :t:`type` ``T`` is an :t:`integer type variable`, behavior
depends on the other :t:`type` ``U``:

#. :dp:`fls_fTy3FVt0fK9g`
If ``U`` is an :t:`integer type` or an :t:`integer type variable`, the
:t:`integer type variable` ``T`` is assigned :t:`type` ``U``.

#. :dp:`fls_7IsrfUoPXSZU`
Otherwise, :t:`type unification` fails.

#. :dp:`fls_Hb95CPyUpCmc`
Otherwise, if one :t:`type` ``T`` is an :t:`floating-point type variable`,
behavior depends on the other :t:`type` ``U``:

#. :dp:`fls_jEZVWlfVPevb`
If ``U`` is an :t:`floating-point type` or an
:t:`floating-point type variable`, the :t:`floating-point type variable`
``T`` is assigned :t:`type` ``U``.

#. :dp:`fls_nKcqFo7yIDBe`
Otherwise, :t:`type unification` fails.

Expand Down Expand Up @@ -2120,6 +2120,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_67Bf5kR5OtYW`
The :t:`expression` of a :t:`constant argument`.

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

Expand Down Expand Up @@ -2152,7 +2158,7 @@ depending on the :t:`type inference root` as follows:
If the :t:`enum type` that contains the :t:`discriminant` is subject to
:t:`attribute` :c:`repr` that specifies a :t:`primitive representation`, the
:t:`expected type` is the specified :t:`primitive type`.

* :dp:`fls_QaGKt99CmvF6`
Otherwise, the :t:`expected type` is :c:`isize`.

Expand Down Expand Up @@ -2218,7 +2224,7 @@ inferece rules below), an :t:`obligation` requiring that ``Type`` implements

#. :dp:`fls_1rnssw39aRWn`
For each :t:`statement`, apply the :t:`statement` inference rules outlined below.

#. :dp:`fls_aYJaZXcOVVyk`
For each :t:`expression`, apply the :t:`expression` inference rules outlined below.

Expand Down Expand Up @@ -2252,7 +2258,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 Expand Up @@ -2322,7 +2330,7 @@ The :t:`type inference` rules for :t:`[expression]s` are as follows:

* :dp:`fls_4ZT35povCL04`
A :t:`match expression` is inferred as follows:

#. :dp:`fls_62OcWZaVN9hh`
:t:`Unify` the :t:`[type]s` of the :t:`[pattern]s` of every :t:`match arm`,
then infer the :t:`subject expression` with the :t:`expected type` set to
Expand Down

0 comments on commit 3fdfdb0

Please sign in to comment.