Skip to content
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

Change the message for if_let_guard feature gate #80121

Merged
merged 1 commit into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
}
};
}
gate_all!(if_let_guard, "`if let` guard is not implemented");
gate_all!(if_let_guard, "`if let` guards are experimental");
gate_all!(let_chains, "`let` expressions in this position are experimental");
gate_all!(async_closure, "async closures are unstable");
gate_all!(generators, "yield syntax is experimental");
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::ops::Range;
fn _if_let_guard() {
match () {
() if let 0 = 1 => {}
//~^ ERROR `if let` guard is not implemented
//~^ ERROR `if let` guards are experimental

() if (let 0 = 1) => {}
//~^ ERROR `let` expressions in this position are experimental
Expand Down Expand Up @@ -74,7 +74,7 @@ fn _macros() {
match () {
#[cfg(FALSE)]
() if let 0 = 1 => {}
//~^ ERROR `if let` guard is not implemented
//~^ ERROR `if let` guards are experimental
_ => {}
}
use_expr!(let 0 = 1);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | macro_rules! use_expr {
LL | use_expr!(let 0 = 1);
| ^^^ no rules expected this token in macro call

error[E0658]: `if let` guard is not implemented
error[E0658]: `if let` guards are experimental
--> $DIR/feature-gate.rs:7:12
|
LL | () if let 0 = 1 => {}
Expand All @@ -16,7 +16,7 @@ LL | () if let 0 = 1 => {}
= note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information
= help: add `#![feature(if_let_guard)]` to the crate attributes to enable

error[E0658]: `if let` guard is not implemented
error[E0658]: `if let` guards are experimental
--> $DIR/feature-gate.rs:76:12
|
LL | () if let 0 = 1 => {}
Expand Down