-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Stabilize allow irrefutable if-let patterns #55639
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
Changes from 7 commits
a4b8366
1e371f8
751e13d
6783165
f78ae35
12492a9
95f56e5
3e6940a
b67d0f5
0fe8993
bb87044
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -430,8 +430,8 @@ declare_features! ( | |||||
// #[doc(alias = "...")] | ||||||
(active, doc_alias, "1.27.0", Some(50146), None), | ||||||
|
||||||
// Allows irrefutable patterns in if-let and while-let statements (RFC 2086) | ||||||
(active, irrefutable_let_patterns, "1.27.0", Some(44495), None), | ||||||
// Allows use of the :literal macro fragment specifier (RFC 1576) | ||||||
(active, macro_literal_matcher, "1.27.0", Some(35625), None), | ||||||
Nokel81 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
// inconsistent bounds in where clauses | ||||||
(active, trivial_bounds, "1.28.0", Some(48214), None), | ||||||
|
@@ -686,6 +686,8 @@ declare_features! ( | |||||
(accepted, extern_crate_item_prelude, "1.31.0", Some(55599), None), | ||||||
// Allows use of the :literal macro fragment specifier (RFC 1576) | ||||||
(accepted, macro_literal_matcher, "1.31.0", Some(35625), None), | ||||||
// Allows irrefutable patterns in if-let and while-let statements (RFC 2086) | ||||||
(accepted, irrefutable_let_patterns, "1.32.0", Some(44495), None), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It slipped so you'll have to bump the version. |
||||||
// Use `?` as the Kleene "at most one" operator | ||||||
(accepted, macro_at_most_once_rep, "1.32.0", Some(48075), None), | ||||||
// Self struct constructor (RFC 2302) | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
warning: the feature `irrefutable_let_patterns` has been stable since 1.32.0 and no longer requires an attribute to enable | ||
Centril marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
--> $DIR/allow_irrefutable_let_patterns.rs:12:12 | ||
| | ||
LL | #![feature(irrefutable_let_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: #[warn(stable_features)] on by default |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,62 @@ | ||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:23:10 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:16:13 | ||
| | ||
LL | foo!(a, 1, { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:26:10 | ||
LL | if let $p = $e $b | ||
| ^^ | ||
... | ||
LL | / foo!(a, 1, { //~ warning 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:32:12 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:16:13 | ||
| | ||
LL | if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | if let $p = $e $b | ||
| ^^ | ||
... | ||
LL | / bar!(a, 1, { //~ warning irrefutable if-let | ||
LL | | println!("irrefutable pattern"); | ||
LL | | }); | ||
| |_______- in this macro invocation | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:36:12 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:34:5 | ||
| | ||
LL | if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | / if let a = 1 { //~ warning irrefutable if-let | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } | ||
| |_____^ | ||
|
||
error[E0162]: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:46:19 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:38:5 | ||
| | ||
LL | } else if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | / if let a = 1 { //~ warning 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:52:19 | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:48:12 | ||
| | ||
LL | } else if let a = 1 { //~ ERROR irrefutable if-let | ||
| ^ irrefutable pattern | ||
LL | } else if let a = 1 { //~ warning irrefutable if-let | ||
| ____________^ | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } | ||
| |_____^ | ||
|
||
error: aborting due to 6 previous errors | ||
warning: irrefutable if-let pattern | ||
--> $DIR/if-let.rs:54:12 | ||
| | ||
LL | } else if let a = 1 { //~ warning irrefutable if-let | ||
| ____________^ | ||
LL | | println!("irrefutable pattern"); | ||
LL | | } | ||
| |_____^ | ||
|
||
For more information about this error, try `rustc --explain E0162`. |
Uh oh!
There was an error while loading. Please reload this page.