forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#57535 - varkor:stabilise-if-while-let-patte…
…rns, r=Centril Stabilise irrefutable if-let and while-let patterns This stabilises RFC 2086 (rust-lang#44495). This replaces rust-lang#55639, as we want to stabilise this in time for the beta cut-off. Closes rust-lang#55639. r? @Centril
- Loading branch information
Showing
30 changed files
with
176 additions
and
239 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
src/doc/unstable-book/src/language-features/irrefutable-let-patterns.md
This file was deleted.
Oops, something went wrong.
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
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
12 changes: 0 additions & 12 deletions
12
src/test/run-pass/binding/allow_irrefutable_let_patterns.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/test/ui/feature-gates/feature-gate-without_gate_irrefutable_pattern.rs
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/test/ui/feature-gates/feature-gate-without_gate_irrefutable_pattern.stderr
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,39 +1,62 @@ | ||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:13:10 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:6:13 | ||
| | ||
LL | foo!(a, 1, { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:16:10 | ||
LL | if let $p = $e $b | ||
| ^^ | ||
... | ||
LL | / foo!(a, 1, { //~ WARN irrefutable if-let | ||
LL | | println!("irrefutable pattern"); | ||
LL | | }); | ||
| |_______- in this macro invocation | ||
| | ||
LL | bar!(a, 1, { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
= note: #[warn(irrefutable_let_patterns)] on by default | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:22:12 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:6:13 | ||
| | ||
LL | if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | if let $p = $e $b | ||
| ^^ | ||
... | ||
LL | / bar!(a, 1, { //~ WARN irrefutable if-let | ||
LL | | println!("irrefutable pattern"); | ||
LL | | }); | ||
| |_______- in this macro invocation | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:26:12 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:24:5 | ||
| | ||
LL | if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | / if let a = 1 { //~ WARN irrefutable if-let | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } | ||
| |_____^ | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:36:19 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:28:5 | ||
| | ||
LL | } else if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | / if let a = 1 { //~ WARN irrefutable if-let | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } else if true { | ||
LL | | println!("else-if in irrefutable if-let"); | ||
LL | | } else { | ||
LL | | println!("else in irrefutable if-let"); | ||
LL | | } | ||
| |_____^ | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:42:19 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:38:12 | ||
| | ||
LL | } else if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | } else if let a = 1 { //~ WARN irrefutable if-let | ||
| ____________^ | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } | ||
| |_____^ | ||
|
||
error: aborting due to 6 previous errors | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:44:12 | ||
| | ||
LL | } else if let a = 1 { //~ WARN irrefutable if-let | ||
| ____________^ | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } | ||
| |_____^ | ||
|
||
For more information about this error, try `rustc --explain E0162`. |
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
Oops, something went wrong.