1
Fork 0

Add help suggesting matches to let_chains lint

This commit is contained in:
Esteban Küber 2021-03-07 14:05:52 -08:00
parent e62a543344
commit 23bcea4249
3 changed files with 53 additions and 1 deletions

View file

@ -639,7 +639,11 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
};
}
gate_all!(if_let_guard, "`if let` guards are experimental");
gate_all!(let_chains, "`let` expressions in this position are experimental");
gate_all!(
let_chains,
"`let` expressions in this position are experimental",
"you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`"
);
gate_all!(
async_closure,
"async closures are unstable",