Apply suggestion from code review

This commit is contained in:
Yuki Okushi 2020-01-07 00:44:52 +09:00
parent cd201f526f
commit f7a93f029c
5 changed files with 14 additions and 14 deletions

View file

@ -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,

View file

@ -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`");
}
}
}

View file

@ -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",
},

View file

@ -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)]

View file

@ -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) -> 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 {