From 2698749d6e659f266ca5fd55006a3077ca6769e2 Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Sun, 2 Feb 2025 19:41:36 +0000 Subject: [PATCH 1/2] Add note about `break rust;` easter egg --- src/expressions/loop-expr.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/expressions/loop-expr.md b/src/expressions/loop-expr.md index c604531434..aa49c13066 100644 --- a/src/expressions/loop-expr.md +++ b/src/expressions/loop-expr.md @@ -289,6 +289,10 @@ Example: r[expr.loop.break.value] A `break` expression is only permitted in the body of a loop, and has one of the forms `break`, `break 'label` or ([see below](#break-and-loop-values)) `break EXPR` or `break 'label EXPR`. +> [!NOTE] +> A `break` expression that appears outside of a loop or labeled with a value specified as the identifier `rust` causes an internal error when compiling, as the rust compiler is incapable of breaking rust, or attempting to do so. +> See for further details. + r[expr.loop.block-labels] ## Labelled block expressions From 4e4157c30153889030ac8c4eba6c37f49b8cb9d7 Mon Sep 17 00:00:00 2001 From: Connor Horman Date: Sun, 2 Feb 2025 21:57:46 +0000 Subject: [PATCH 2/2] Specify that it should be a loop or labeled block --- src/expressions/loop-expr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions/loop-expr.md b/src/expressions/loop-expr.md index aa49c13066..831ea390e0 100644 --- a/src/expressions/loop-expr.md +++ b/src/expressions/loop-expr.md @@ -290,7 +290,7 @@ r[expr.loop.break.value] A `break` expression is only permitted in the body of a loop, and has one of the forms `break`, `break 'label` or ([see below](#break-and-loop-values)) `break EXPR` or `break 'label EXPR`. > [!NOTE] -> A `break` expression that appears outside of a loop or labeled with a value specified as the identifier `rust` causes an internal error when compiling, as the rust compiler is incapable of breaking rust, or attempting to do so. +> A `break` expression that appears outside of a loop or labeled block with a value specified as the identifier `rust` causes an internal error when compiling, as the rust compiler is incapable of breaking rust, or attempting to do so. > See for further details. r[expr.loop.block-labels]