diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-06-08 11:25:35 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-06-08 11:37:35 -0400 |
| commit | 92d4ae2be2e9428c9ab523f04f917a41ac0f760e (patch) | |
| tree | 9ff210c877bf15d3edf6fa99ed82a97ea61786a6 | |
| parent | e7c7f5f07139cd4afe6e8db13942a0ec250ded70 (diff) | |
| download | rust-92d4ae2be2e9428c9ab523f04f917a41ac0f760e.tar.gz rust-92d4ae2be2e9428c9ab523f04f917a41ac0f760e.zip | |
rename `irrefutable_let_pattern` to `irrefutable_let_patterns`
| -rw-r--r-- | src/doc/unstable-book/src/language-features/irrefutable-let-patterns.md (renamed from src/doc/unstable-book/src/language-features/irrefutable-let-pattern.md) | 8 | ||||
| -rw-r--r-- | src/librustc_mir/hair/pattern/check_match.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/allow_irrefutable_let_patterns.rs | 8 |
7 files changed, 17 insertions, 17 deletions
diff --git a/src/doc/unstable-book/src/language-features/irrefutable-let-pattern.md b/src/doc/unstable-book/src/language-features/irrefutable-let-patterns.md index 13681c96811..0d782e1c539 100644 --- a/src/doc/unstable-book/src/language-features/irrefutable-let-pattern.md +++ b/src/doc/unstable-book/src/language-features/irrefutable-let-patterns.md @@ -1,4 +1,4 @@ -# `irrefutable_let_pattern` +# `irrefutable_let_patterns` The tracking issue for this feature is: [#44495] @@ -11,13 +11,13 @@ in the `if let` and `while let` forms. The old way was to always error but now with a tag the error-by-default lint can be switched off. ```rust -#![feature(irrefutable_let_pattern)] +#![feature(irrefutable_let_patterns)] fn main() { - #[allow(irrefutable_let_pattern)] + #[allow(irrefutable_let_patterns)] if let _ = 5 {} - #[allow(irrefutable_let_pattern)] + #[allow(irrefutable_let_patterns)] while let _ = 5 {} } ``` diff --git a/src/librustc_mir/hair/pattern/check_match.rs b/src/librustc_mir/hair/pattern/check_match.rs index d5d69bf7f2b..895f050d399 100644 --- a/src/librustc_mir/hair/pattern/check_match.rs +++ b/src/librustc_mir/hair/pattern/check_match.rs @@ -369,7 +369,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, NotUseful => { match source { hir::MatchSource::IfLetDesugar { .. } => { - if cx.tcx.features().irrefutable_let_pattern { + if cx.tcx.features().irrefutable_let_patterns { cx.tcx.lint_node( lint::builtin::IRREFUTABLE_LET_PATTERNS, hir_pat.id, pat.span, @@ -404,7 +404,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, }, // The arm with the wildcard pattern. 1 => { - if cx.tcx.features().irrefutable_let_pattern { + if cx.tcx.features().irrefutable_let_patterns { cx.tcx.lint_node( lint::builtin::IRREFUTABLE_LET_PATTERNS, hir_pat.id, pat.span, diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index f08a404a02a..01820379c96 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -468,7 +468,7 @@ declare_features! ( (active, tool_attributes, "1.25.0", Some(44690), None), // allow irrefutable patterns in if-let and while-let statements (RFC 2086) - (active, irrefutable_let_pattern, "1.27.0", Some(44495), None), + (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), diff --git a/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs b/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs index 1facb6b152a..7cd026e21d6 100644 --- a/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs +++ b/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs @@ -1,4 +1,4 @@ -// gate-test-irrefutable_let_pattern +// gate-test-irrefutable_let_patterns // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at @@ -11,7 +11,7 @@ // except according to those terms. fn main() { - #[allow(irrefutable_let_pattern)] + #[allow(irrefutable_let_patterns)] if let _ = 5 {} //~^ ERROR 15:12: 15:13: irrefutable if-let pattern [E0162] } diff --git a/src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs b/src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs index 71dcbf329c7..8c9a24f4e72 100644 --- a/src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs +++ b/src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// should-fail-irrefutable_let_pattern +// should-fail-irrefutable_let_patterns fn main() { if let _ = 5 {} //~^ ERROR irrefutable if-let pattern [E0162] diff --git a/src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs b/src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs index 2f9b7f0628d..6f95f10c0d9 100644 --- a/src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs +++ b/src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(irrefutable_let_pattern)] +#![feature(irrefutable_let_patterns)] -// should-fail-irrefutable_let_pattern_with_gate +// should-fail-irrefutable_let_patterns_with_gate fn main() { if let _ = 5 {} - //~^ ERROR irrefutable if-let pattern [irrefutable_let_pattern] + //~^ ERROR irrefutable if-let pattern [irrefutable_let_patterns] } diff --git a/src/test/run-pass/allow_irrefutable_let_patterns.rs b/src/test/run-pass/allow_irrefutable_let_patterns.rs index 3a4f226dfe6..689a54d60f3 100644 --- a/src/test/run-pass/allow_irrefutable_let_patterns.rs +++ b/src/test/run-pass/allow_irrefutable_let_patterns.rs @@ -8,14 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(irrefutable_let_pattern)] +#![feature(irrefutable_let_patterns)] -// must-compile-successfully-irrefutable_let_pattern_with_gate +// must-compile-successfully-irrefutable_let_patterns_with_gate fn main() { - #[allow(irrefutable_let_pattern)] + #[allow(irrefutable_let_patterns)] if let _ = 5 {} - #[allow(irrefutable_let_pattern)] + #[allow(irrefutable_let_patterns)] while let _ = 5 { break; } |
