From f7a93f029ce721fc2d74d8ba12942d9cdfbb6c14 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 7 Jan 2020 00:44:52 +0900 Subject: [PATCH] Apply suggestion from code review --- clippy_lints/src/attrs.rs | 4 ++-- clippy_lints/src/missing_const_for_fn.rs | 2 +- src/lintlist/mod.rs | 2 +- tests/ui/cfg_attr_rustfmt.stderr | 4 ++-- .../missing_const_for_fn/could_be_const.stderr | 16 ++++++++-------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index 2939a71a511..c57061c0bfa 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -187,7 +187,7 @@ declare_clippy_lint! { /// ``` pub DEPRECATED_CFG_ATTR, complexity, - "usage of `cfg_attr(rustfmt)` instead of `tool_attributes`" + "usage of `cfg_attr(rustfmt)` instead of tool attributes" } declare_lint_pass!(Attributes => [ @@ -520,7 +520,7 @@ impl EarlyLintPass for DeprecatedCfgAttribute { cx, DEPRECATED_CFG_ATTR, attr.span, - "`cfg_attr` is deprecated for rustfmt and got replaced by `tool_attributes`", + "`cfg_attr` is deprecated for rustfmt and got replaced by tool attributes", "use", "#[rustfmt::skip]".to_string(), Applicability::MachineApplicable, diff --git a/clippy_lints/src/missing_const_for_fn.rs b/clippy_lints/src/missing_const_for_fn.rs index cdd9e5a90a8..eb2a3220a04 100644 --- a/clippy_lints/src/missing_const_for_fn.rs +++ b/clippy_lints/src/missing_const_for_fn.rs @@ -113,7 +113,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingConstForFn { cx.tcx.sess.span_err(span, &err); } } else { - span_lint(cx, MISSING_CONST_FOR_FN, span, "this could be a `const_fn`"); + span_lint(cx, MISSING_CONST_FOR_FN, span, "this could be a `const fn`"); } } } diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index af89a473b6a..1086f5e48f9 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -318,7 +318,7 @@ pub const ALL_LINTS: [Lint; 345] = [ Lint { name: "deprecated_cfg_attr", group: "complexity", - desc: "usage of `cfg_attr(rustfmt)` instead of `tool_attributes`", + desc: "usage of `cfg_attr(rustfmt)` instead of tool attributes", deprecation: None, module: "attrs", }, diff --git a/tests/ui/cfg_attr_rustfmt.stderr b/tests/ui/cfg_attr_rustfmt.stderr index 74f27456d79..c1efd47db90 100644 --- a/tests/ui/cfg_attr_rustfmt.stderr +++ b/tests/ui/cfg_attr_rustfmt.stderr @@ -1,4 +1,4 @@ -error: `cfg_attr` is deprecated for rustfmt and got replaced by `tool_attributes` +error: `cfg_attr` is deprecated for rustfmt and got replaced by tool attributes --> $DIR/cfg_attr_rustfmt.rs:18:5 | LL | #[cfg_attr(rustfmt, rustfmt::skip)] @@ -6,7 +6,7 @@ LL | #[cfg_attr(rustfmt, rustfmt::skip)] | = note: `-D clippy::deprecated-cfg-attr` implied by `-D warnings` -error: `cfg_attr` is deprecated for rustfmt and got replaced by `tool_attributes` +error: `cfg_attr` is deprecated for rustfmt and got replaced by tool attributes --> $DIR/cfg_attr_rustfmt.rs:22:1 | LL | #[cfg_attr(rustfmt, rustfmt_skip)] diff --git a/tests/ui/missing_const_for_fn/could_be_const.stderr b/tests/ui/missing_const_for_fn/could_be_const.stderr index c060a9a983e..7d3dca1800b 100644 --- a/tests/ui/missing_const_for_fn/could_be_const.stderr +++ b/tests/ui/missing_const_for_fn/could_be_const.stderr @@ -1,4 +1,4 @@ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:12:5 | LL | / pub fn new() -> Self { @@ -8,7 +8,7 @@ LL | | } | = note: `-D clippy::missing-const-for-fn` implied by `-D warnings` -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:18:1 | LL | / fn one() -> i32 { @@ -16,7 +16,7 @@ LL | | 1 LL | | } | |_^ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:23:1 | LL | / fn two() -> i32 { @@ -25,7 +25,7 @@ LL | | abc LL | | } | |_^ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:30:1 | LL | / fn string() -> String { @@ -33,7 +33,7 @@ LL | | String::new() LL | | } | |_^ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:35:1 | LL | / unsafe fn four() -> i32 { @@ -41,7 +41,7 @@ LL | | 4 LL | | } | |_^ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:40:1 | LL | / fn generic(t: T) -> T { @@ -49,7 +49,7 @@ LL | | t LL | | } | |_^ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:44:1 | LL | / fn sub(x: u32) -> usize { @@ -57,7 +57,7 @@ LL | | unsafe { transmute(&x) } LL | | } | |_^ -error: this could be a `const_fn` +error: this could be a `const fn` --> $DIR/could_be_const.rs:63:9 | LL | / pub fn b(self, a: &A) -> B {