File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -496,6 +496,10 @@ related :t:`let statement` appears.
496
496
The :t: `binding ` of a :t: `match arm ` is :t: `in scope ` within its related
497
497
:t: `[expression]s ` and related :t: `match arm guard `.
498
498
499
+ :dp: `fls_eBacCVlDaKYK `
500
+ A :t: `binding ` declared outside of a :t: `const block expression ` is not :t: `in
501
+ scope ` within such a :t: `const block expression `.
502
+
499
503
.. _fls_ftphlagzd2te :
500
504
501
505
Generic Parameter Scope
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ Expressions
20
20
OuterAttributeOrDoc* (
21
21
AsyncBlockExpression
22
22
| BlockExpression
23
+ | ConstBlockExpression
23
24
| IfExpression
24
25
| IfLetExpression
25
26
| LoopExpression
@@ -316,6 +317,9 @@ A :t:`constant context` is a :t:`construct` that requires a
316
317
* :dp: `fls_ib8p7dfwddx2 `
317
318
The :t: `static initializer ` of a :t: `static `.
318
319
320
+ * :dp: `fls_ucFupTeCyylb `
321
+ The :t: `block expression ` of a :t: `const block expression `.
322
+
319
323
:dp: `fls_ox6sgl9n43g2 `
320
324
It is a static error to create a :t: `mutable reference ` in a
321
325
:t: `constant context `.
@@ -784,6 +788,48 @@ the :t:`[capture target]s` of the :t:`async block expression`.
784
788
42
785
789
}
786
790
791
+ .. _fls_G59PiNQkVUnQ :
792
+
793
+ Const Blocks
794
+ ~~~~~~~~~~~~
795
+
796
+ .. rubric :: Syntax
797
+
798
+ .. syntax ::
799
+
800
+ ConstBlockExpression ::=
801
+ $$const$$ BlockExpression
802
+
803
+ .. rubric :: Legality Rules
804
+
805
+ :dp: `fls_0lcunL4bo8ka `
806
+ A :t: `const block expression ` is a :t: `block expression ` that is specified
807
+ with :t: `keyword ` ``const `` and encapsulates behavior which is evaluated
808
+ statically.
809
+
810
+ :dp: `fls_veEGzEbpT4ny `
811
+ An :t: `const block expression ` denotes a new :t: `control flow boundary `.
812
+
813
+ :dp: `fls_PiUS1hF3dv9U `
814
+ The :t: `block expression ` of a :t: `const block expression ` shall be a
815
+ :t: `constant expression `.
816
+
817
+ :dp: `fls_wuwb0SnpP6Zu `
818
+ The :t: `type ` of a :t: `const block expression ` is the :t: `type ` of the
819
+ containing :t: `block expression `.
820
+
821
+ :dp: `fls_2i7TD7VoQk4B `
822
+ The :t: `value ` of a :t: `const block expression ` is the :t: `value ` of the
823
+ contained :t: `block expression `.
824
+
825
+ .. rubric :: Examples
826
+
827
+ .. code-block :: rust
828
+
829
+ const {
830
+ 42
831
+ }
832
+
787
833
.. _fls_0ybsR1hEo7wV :
788
834
789
835
Named Blocks
You can’t perform that action at this time.
0 commit comments