You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/expressions.rst
+65-2Lines changed: 65 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -482,6 +482,9 @@ The following :t:`[construct]s` are :t:`[place expression context]s`:
482
482
* :dp:`fls_Ufz9W5vyZkv3`
483
483
The :t:`operand` of a :t:`borrow expression`,
484
484
485
+
* :dp:`fls_K7SbApHPmwjM`
486
+
The :t:`operand` of a :t:`raw borrow expression`,
487
+
485
488
* :dp:`fls_KxWIzoh9WwK7`
486
489
The :t:`operand` of a :t:`dereference expression`,
487
490
@@ -927,6 +930,7 @@ Operator Expressions
927
930
|ErrorPropagationExpression
928
931
|LazyBooleanExpression
929
932
|NegationExpression
933
+
|RawBorrowExpression
930
934
|TypeCastExpression
931
935
932
936
.. rubric:: Legality Rules
@@ -971,11 +975,11 @@ state, or simply :t:`borrowed`.
971
975
The :t:`type` of a :t:`borrow expression` is determined as follows:
972
976
973
977
* :dp:`fls_5b2x5ri2w54r`
974
-
If the :t:`borrow expression` denotes a:t:`shared reference`, then the
978
+
If the :t:`borrow expression` denotes an:t:`immutable borrow expression`, then the
975
979
:t:`type` is ``&T``, where ``T`` is the :t:`type` of the :t:`operand`.
976
980
977
981
* :dp:`fls_agl09ia869rk`
978
-
If the :t:`borrow expression` denotes a :t:`mutable reference`, then the
982
+
If the :t:`borrow expression` denotes a :t:`mutable borrow expression`, then the
979
983
:t:`type` is ``&mut T``, where ``T`` is the :t:`type` of the :t:`operand`.
980
984
981
985
:dp:`fls_8cvmee9bzs40`
@@ -2057,6 +2061,65 @@ The :t:`evaluation` of a :t:`lazy or expression` proceeds as follows:
2057
2061
false && panic!()
2058
2062
this || that
2059
2063
2064
+
.. _fls_vXGuvRWOLbEE:
2065
+
2066
+
Raw Borrow Expression
2067
+
~~~~~~~~~~~~~~~~~~~~~
2068
+
2069
+
.. rubric:: Syntax
2070
+
2071
+
.. syntax::
2072
+
2073
+
RawBorrowExpression ::=
2074
+
$$&$$ $$raw$$ ($$const$$ | $$mut$$) Operand
2075
+
2076
+
.. rubric:: Legality Rules
2077
+
2078
+
:dp:`fls_TS6DvMon5h27`
2079
+
A :t:`raw borrow expression` is an :t:`expression` that creates a :t:`raw pointer` to the memory location of its :t:`operand` without incurring a :t:`borrow`.
2080
+
2081
+
:dp:`fls_UtjWrE2qeplQ`
2082
+
An :dt:`immutable raw borrow expression` is a :t:`raw borrow expression` that has :t:`keyword` ``const``.
2083
+
2084
+
:dp:`fls_4e7EE4a8Yvmy`
2085
+
A :dt:`mutable raw borrow expression` is a :t:`raw borrow expression` that has :t:`keyword` ``mut``.
2086
+
2087
+
:dp:`fls_gOXUWePymgGV`
2088
+
When the :t:`operand` of a :t:`raw borrow expression` is a :t:`place expression`, the :t:`raw borrow expression` produces a :t:`raw pointer` to the memory location indicated by the :t:`operand`.
2089
+
2090
+
:dp:`fls_YBC8GrIBzZbi`
2091
+
It is a static error if the :t:`operand` of a :t:`raw borrow expression` is a :t:`temporary`.
2092
+
2093
+
:dp:`fls_Twkre8IzUa8S`
2094
+
The :t:`type` of a :t:`raw borrow expression` is determined as follows:
2095
+
2096
+
* :dp:`fls_Ki4FOzJMqtvJ`
2097
+
If the :t:`raw borrow expression` denotes an :t:`immutable raw borrow expression`, then the :t:`type` is ``*const T``, where ``T`` is the :t:`type` of the :t:`operand`.
2098
+
2099
+
* :dp:`fls_DJxQDBsO9hc7`
2100
+
If the :t:`raw borrow expression` denotes a :t:`mutable raw borrow expression`, then the :t:`type` is ``*mut T``, where ``T`` is the :t:`type` of the :t:`operand`.
2101
+
2102
+
:dp:`fls_WlXB0AHifCdd`
2103
+
The :t:`value` of a :t:`raw borrow expression` is the address of its :t:`operand`.
2104
+
2105
+
.. rubric:: Dynamic Semantics
2106
+
2107
+
:dp:`fls_qQrV8QuGGcVO`
2108
+
The :t:`evaluation` of a :t:`raw borrow expression` evaluates its :t:`operand`.
Copy file name to clipboardExpand all lines: src/glossary.rst
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5357,6 +5357,17 @@ an included :t:`range expression high bound`.
5357
5357
:dp:`fls_krei7lc6lo8q`
5358
5358
See :s:`RangeToInclusiveExpression`.
5359
5359
5360
+
.. _fls_YLhE2qpzYXRK:
5361
+
5362
+
raw borrow expression
5363
+
^^^^^^^^^^^^^^^^^^^^^
5364
+
5365
+
:dp:`fls_Fe39wLb0vvEg`
5366
+
A :dt:`raw borrow expression` is an :t:`expression` that creates a :t:`raw pointer` to the memory location of its :t:`operand` without incurring a :t:`borrow`.
0 commit comments