From 361c09ebefbbf46fcbad0190d83adb660a9aba98 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Fri, 13 Mar 2020 16:44:31 -0400 Subject: [PATCH 1/2] Attributes are now allowed on `if` and `if let` This became possible with https://github.com/rust-lang/rust/pull/69201 --- src/expressions.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/expressions.md b/src/expressions.md index fc0764c000b6a..35605fabe9d15 100644 --- a/src/expressions.md +++ b/src/expressions.md @@ -272,11 +272,10 @@ a few specific cases: https://github.com/rust-lang/rust/issues/15701 --> * The tail expression of [block expressions]. +* [`if`][_IfExpression_] and [`if let`][_IfLetExpression_] expressions. They are never allowed before: - -* [`if`][_IfExpression_] and [`if let`][_IfLetExpression_] expressions. * [Range][_RangeExpression_] expressions. * Binary operator expressions ([_ArithmeticOrLogicalExpression_], [_ComparisonExpression_], [_LazyBooleanExpression_], [_TypeCastExpression_], From 36b557cb40b788ca59832b918bfa4102589ec6f5 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 9 Apr 2020 20:33:34 -0700 Subject: [PATCH 2/2] No need to mention if/if-let expressions. The first point ("Before an expression") covers those. --- src/expressions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/expressions.md b/src/expressions.md index 35605fabe9d15..68187f90b8731 100644 --- a/src/expressions.md +++ b/src/expressions.md @@ -272,7 +272,6 @@ a few specific cases: https://github.com/rust-lang/rust/issues/15701 --> * The tail expression of [block expressions]. -* [`if`][_IfExpression_] and [`if let`][_IfLetExpression_] expressions. They are never allowed before: