diff --git a/src/expressions.rst b/src/expressions.rst index 5d2a498c..7ae9c917 100644 --- a/src/expressions.rst +++ b/src/expressions.rst @@ -25,6 +25,7 @@ Expressions | LoopExpression | MatchExpression | UnsafeBlockExpression + | NamedBlockExpression ) ExpressionWithoutBlock ::= @@ -652,7 +653,7 @@ Block Expressions .. syntax:: BlockExpression ::= - Label? $${$$ + $${$$ InnerAttributeOrDoc* StatementList $$}$$ @@ -666,13 +667,6 @@ Block Expressions A :t:`block expression` is an :t:`expression` that sequences :t:`[expression]s` and :t:`[statement]s`. -:dp:`fls_gOxD5xdYLaQG` -A :t:`named block expression` is a :t:`block expression` with a :t:`label`. - -:dp:`fls_osLgtbU8OfbD` -An :t:`anonymous block expression` is a :t:`block expression` without a -:t:`label`. - :dp:`fls_tn3hj7k2lliu` A :t:`tail expression` is the last :t:`expression` within a :t:`block expression`. @@ -786,6 +780,39 @@ the :t:`[capture target]s` of the :t:`async block expression`. 42 } +.. _fls_0ybsR1hEo7wV: + +Named Blocks + +.. rubric:: Syntax + +.. syntax:: + + NamedBlockExpression ::= + Label BlockExpression + +.. rubric:: Legality Rules + +:dp:`fls_J8wJNfcSAYrS` +A :t:`named block expression` is a :t:`block expression` with a :t:`label`. + +:dp:`fls_B4NBv2jfZLuy` +The :t:`type` of the :t:`named block expression` is the :t:`type` of its +:t:`block expression`. + +:dp:`fls_YxvAUUYAPkaq` +The :t:`value` of the :t:`named block expression` is the :t:`value` of its +:t:`block expression`. + +.. rubric:: Examples + +.. code-block:: rust + + 'block: { + break 'block 1; + 3 + } + .. _fls_8wnyln2nmg4y: Unsafe Blocks diff --git a/src/glossary.rst b/src/glossary.rst index 0051c2d5..18469fd6 100644 --- a/src/glossary.rst +++ b/src/glossary.rst @@ -129,15 +129,6 @@ models existential quantifier ALL. :dp:`fls_0fEw9Bx8xX8q` See :s:`ConfigurationPredicateAll`. -.. _fls_eg1wsZzoiTzK: - -anonymous block expression -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:dp:`fls_ZU8eI3kyzw3z` -An :dt:`anonymous block expression` is a :t:`block expression` without a -:t:`label`. - .. _fls_du8uevac5q7j: anonymous loop expression @@ -7652,4 +7643,3 @@ zero-variant enum type :dp:`fls_84gqz3vwi5mj` A :dt:`zero-variant enum type` is an :t:`enum type` without any :t:`[enum variant]s`. -