Skip to content

Commit a992a11

Browse files
committed
Auto merge of #87937 - LeSeulArtichaut:active-if-let-guards, r=nagisa
Don't mark `if_let_guard` as an incomplete feature I don't think there is any reason for `if_let_guard` to be an incomplete feature, and I think the reason they were marked in the first place was simply because they weren't implemented at all. r? `@pnkfelix` cc tracking issue #51114
2 parents 958d788 + dabdd6d commit a992a11

File tree

11 files changed

+13
-19
lines changed

11 files changed

+13
-19
lines changed

compiler/rustc_feature/src/active.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ declare_features! (
552552
(incomplete, lazy_normalization_consts, "1.46.0", Some(72219), None),
553553

554554
/// Allows `if let` guard in match arms.
555-
(incomplete, if_let_guard, "1.47.0", Some(51114), None),
555+
(active, if_let_guard, "1.47.0", Some(51114), None),
556556

557557
/// Allows non-trivial generic constants which have to be manually propagated upwards.
558558
(incomplete, const_evaluatable_checked, "1.48.0", Some(76560), None),

src/test/ui/generator/yielding-in-match-guards.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// of the underlying generator.
1212

1313
#![feature(if_let_guard)]
14-
#![allow(incomplete_features)]
1514

1615
async fn f() -> u8 { 1 }
1716
async fn foo() -> [bool; 10] { [false; 10] }

src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(if_let_guard)]
2-
#![allow(incomplete_features)]
32

43
#![deny(irrefutable_let_patterns)]
54

src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: irrefutable `if let` pattern
2-
--> $DIR/deny-irrefutable-let-patterns.rs:7:8
2+
--> $DIR/deny-irrefutable-let-patterns.rs:6:8
33
|
44
LL | if let _ = 5 {}
55
| ^^^^^^^^^
66
|
77
note: the lint level is defined here
8-
--> $DIR/deny-irrefutable-let-patterns.rs:4:9
8+
--> $DIR/deny-irrefutable-let-patterns.rs:3:9
99
|
1010
LL | #![deny(irrefutable_let_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^
1212
= note: this pattern will always match, so the `if let` is useless
1313
= help: consider replacing the `if let` with a `let`
1414

1515
error: irrefutable `while let` pattern
16-
--> $DIR/deny-irrefutable-let-patterns.rs:9:11
16+
--> $DIR/deny-irrefutable-let-patterns.rs:8:11
1717
|
1818
LL | while let _ = 5 {
1919
| ^^^^^^^^^
@@ -22,7 +22,7 @@ LL | while let _ = 5 {
2222
= help: consider instead using a `loop { ... }` with a `let` inside it
2323

2424
error: irrefutable `if let` guard pattern
25-
--> $DIR/deny-irrefutable-let-patterns.rs:14:18
25+
--> $DIR/deny-irrefutable-let-patterns.rs:13:18
2626
|
2727
LL | _ if let _ = 2 => {}
2828
| ^

src/test/ui/rfc-2294-if-let-guard/bindings.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(if_let_guard)]
2-
#![allow(incomplete_features)]
32

43
fn main() {
54
match Some(None) {

src/test/ui/rfc-2294-if-let-guard/bindings.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0425]: cannot find value `y` in this scope
2-
--> $DIR/bindings.rs:7:14
2+
--> $DIR/bindings.rs:6:14
33
|
44
LL | _ => y,
55
| ^ not found in this scope
66

77
error[E0425]: cannot find value `y` in this scope
8-
--> $DIR/bindings.rs:9:5
8+
--> $DIR/bindings.rs:8:5
99
|
1010
LL | y
1111
| ^ not found in this scope

src/test/ui/rfc-2294-if-let-guard/run-pass.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(if_let_guard)]
4-
#![allow(incomplete_features)]
54

65
enum Foo {
76
Bar,

src/test/ui/rfc-2294-if-let-guard/typeck.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(if_let_guard)]
2-
#![allow(incomplete_features)]
32

43
fn ok() -> Result<Option<bool>, ()> {
54
Ok(Some(true))

src/test/ui/rfc-2294-if-let-guard/typeck.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/typeck.rs:10:22
2+
--> $DIR/typeck.rs:9:22
33
|
44
LL | Ok(x) if let Err(_) = x => {},
55
| ^^^^^^ expected enum `Option`, found enum `Result`
@@ -8,7 +8,7 @@ LL | Ok(x) if let Err(_) = x => {},
88
found enum `Result<_, _>`
99

1010
error[E0308]: mismatched types
11-
--> $DIR/typeck.rs:12:22
11+
--> $DIR/typeck.rs:11:22
1212
|
1313
LL | Ok(x) if let 0 = x => {},
1414
| ^ expected enum `Option`, found integer

src/test/ui/rfc-2294-if-let-guard/warns.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(if_let_guard)]
2-
#![allow(incomplete_features)]
32

43
#[deny(irrefutable_let_patterns)]
54
fn irrefutable_let_guard() {

src/test/ui/rfc-2294-if-let-guard/warns.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
error: irrefutable `if let` guard pattern
2-
--> $DIR/warns.rs:7:24
2+
--> $DIR/warns.rs:6:24
33
|
44
LL | Some(x) if let () = x => {}
55
| ^^
66
|
77
note: the lint level is defined here
8-
--> $DIR/warns.rs:4:8
8+
--> $DIR/warns.rs:3:8
99
|
1010
LL | #[deny(irrefutable_let_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^
1212
= note: this pattern will always match, so the guard is useless
1313
= help: consider removing the guard and adding a `let` inside the match arm
1414

1515
error: unreachable pattern
16-
--> $DIR/warns.rs:16:25
16+
--> $DIR/warns.rs:15:25
1717
|
1818
LL | x if let None | None = x => {}
1919
| ^^^^
2020
|
2121
note: the lint level is defined here
22-
--> $DIR/warns.rs:13:8
22+
--> $DIR/warns.rs:12:8
2323
|
2424
LL | #[deny(unreachable_patterns)]
2525
| ^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)