Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize allow irrefutable if-let patterns #55639

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Fixed the inline code
  • Loading branch information
Nokel81 authored Dec 3, 2018
commit 95f56e5df91bafed61d5f61c203930ed8513c882
4 changes: 2 additions & 2 deletions src/librustc_mir/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -341,7 +341,7 @@ An if-let pattern attempts to match the pattern, and enters the body if the
match was successful. If the match is irrefutable (when it cannot fail to
match), use a regular `let`-binding instead. For instance:

```compile_fail,E0162
```compile_pass
struct Irrefutable(i32);
let irr = Irrefutable(0);

@@ -370,7 +370,7 @@ A while-let pattern attempts to match the pattern, and enters the body if the
match was successful. If the match is irrefutable (when it cannot fail to
match), use a regular `let`-binding inside a `loop` instead. For instance:

```compile_fail,E0165
```compile_pass,no_run
struct Irrefutable(i32);
let irr = Irrefutable(0);