Skip to content

Commit 92d4ae2

Browse files
committed
rename irrefutable_let_pattern to irrefutable_let_patterns
1 parent e7c7f5f commit 92d4ae2

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/doc/unstable-book/src/language-features/irrefutable-let-pattern.md renamed to src/doc/unstable-book/src/language-features/irrefutable-let-patterns.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `irrefutable_let_pattern`
1+
# `irrefutable_let_patterns`
22

33
The tracking issue for this feature is: [#44495]
44

@@ -11,13 +11,13 @@ in the `if let` and `while let` forms. The old way was to always error
1111
but now with a tag the error-by-default lint can be switched off.
1212

1313
```rust
14-
#![feature(irrefutable_let_pattern)]
14+
#![feature(irrefutable_let_patterns)]
1515

1616
fn main() {
17-
#[allow(irrefutable_let_pattern)]
17+
#[allow(irrefutable_let_patterns)]
1818
if let _ = 5 {}
1919

20-
#[allow(irrefutable_let_pattern)]
20+
#[allow(irrefutable_let_patterns)]
2121
while let _ = 5 {}
2222
}
2323
```

src/librustc_mir/hair/pattern/check_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
369369
NotUseful => {
370370
match source {
371371
hir::MatchSource::IfLetDesugar { .. } => {
372-
if cx.tcx.features().irrefutable_let_pattern {
372+
if cx.tcx.features().irrefutable_let_patterns {
373373
cx.tcx.lint_node(
374374
lint::builtin::IRREFUTABLE_LET_PATTERNS,
375375
hir_pat.id, pat.span,
@@ -404,7 +404,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
404404
},
405405
// The arm with the wildcard pattern.
406406
1 => {
407-
if cx.tcx.features().irrefutable_let_pattern {
407+
if cx.tcx.features().irrefutable_let_patterns {
408408
cx.tcx.lint_node(
409409
lint::builtin::IRREFUTABLE_LET_PATTERNS,
410410
hir_pat.id, pat.span,

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ declare_features! (
468468
(active, tool_attributes, "1.25.0", Some(44690), None),
469469

470470
// allow irrefutable patterns in if-let and while-let statements (RFC 2086)
471-
(active, irrefutable_let_pattern, "1.27.0", Some(44495), None),
471+
(active, irrefutable_let_patterns, "1.27.0", Some(44495), None),
472472

473473
// Allows use of the :literal macro fragment specifier (RFC 1576)
474474
(active, macro_literal_matcher, "1.27.0", Some(35625), None),

src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// gate-test-irrefutable_let_pattern
1+
// gate-test-irrefutable_let_patterns
22

33
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
44
// file at the top-level directory of this distribution and at
@@ -11,7 +11,7 @@
1111
// except according to those terms.
1212

1313
fn main() {
14-
#[allow(irrefutable_let_pattern)]
14+
#[allow(irrefutable_let_patterns)]
1515
if let _ = 5 {}
1616
//~^ ERROR 15:12: 15:13: irrefutable if-let pattern [E0162]
1717
}

src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// should-fail-irrefutable_let_pattern
11+
// should-fail-irrefutable_let_patterns
1212
fn main() {
1313
if let _ = 5 {}
1414
//~^ ERROR irrefutable if-let pattern [E0162]

src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(irrefutable_let_pattern)]
11+
#![feature(irrefutable_let_patterns)]
1212

13-
// should-fail-irrefutable_let_pattern_with_gate
13+
// should-fail-irrefutable_let_patterns_with_gate
1414
fn main() {
1515
if let _ = 5 {}
16-
//~^ ERROR irrefutable if-let pattern [irrefutable_let_pattern]
16+
//~^ ERROR irrefutable if-let pattern [irrefutable_let_patterns]
1717
}

src/test/run-pass/allow_irrefutable_let_patterns.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(irrefutable_let_pattern)]
11+
#![feature(irrefutable_let_patterns)]
1212

13-
// must-compile-successfully-irrefutable_let_pattern_with_gate
13+
// must-compile-successfully-irrefutable_let_patterns_with_gate
1414
fn main() {
15-
#[allow(irrefutable_let_pattern)]
15+
#[allow(irrefutable_let_patterns)]
1616
if let _ = 5 {}
1717

18-
#[allow(irrefutable_let_pattern)]
18+
#[allow(irrefutable_let_patterns)]
1919
while let _ = 5 {
2020
break;
2121
}

0 commit comments

Comments
 (0)