-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lower condition of
if
expression before it's "then" block
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#![feature(let_chains)] //~ WARN the feature `let_chains` is incomplete | ||
|
||
fn main() { | ||
if true && let x = 1 { //~ ERROR `let` expressions are not supported here | ||
let _ = x; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: `let` expressions are not supported here | ||
--> $DIR/issue-82290.rs:4:16 | ||
| | ||
LL | if true && let x = 1 { | ||
| ^^^^^^^^^ | ||
| | ||
= note: only supported directly in conditions of `if`- and `while`-expressions | ||
= note: as well as when nested within `&&` and parenthesis in those conditions | ||
|
||
warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/issue-82290.rs:1:12 | ||
| | ||
LL | #![feature(let_chains)] | ||
| ^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|