From c07890543d13b36180dfbc0b6b6632c2c1dfff3f Mon Sep 17 00:00:00 2001 From: LingMan Date: Wed, 23 Sep 2020 00:29:56 +0200 Subject: [PATCH] Don't use an if guard to check equality with a constant Match on it directly instead --- compiler/rustc_attr/src/builtin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 9951c252001..1808eb270ba 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -301,7 +301,7 @@ fn find_stability_generic<'a, I>( .emit(); }; match issue.parse() { - Ok(num) if num == 0 => { + Ok(0) => { emit_diag( "`issue` must not be \"0\", \ use \"none\" instead",