mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-09-21 15:11:56 +00:00
Fixed same_name_method description
This commit is contained in:
parent
392b0c5c25
commit
f26821c969
2 changed files with 8 additions and 8 deletions
|
@ -11,7 +11,7 @@ use std::collections::{BTreeMap, BTreeSet};
|
||||||
|
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
/// ### What it does
|
/// ### What it does
|
||||||
/// It lints if a struct has two method with same time:
|
/// It lints if a struct has two methods with the same name:
|
||||||
/// one from a trait, another not from trait.
|
/// one from a trait, another not from trait.
|
||||||
///
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
|
@ -100,7 +100,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
|
||||||
cx,
|
cx,
|
||||||
SAME_NAME_METHOD,
|
SAME_NAME_METHOD,
|
||||||
*impl_span,
|
*impl_span,
|
||||||
"method's name is same to an existing method in a trait",
|
"method's name is the same as an existing method in a trait",
|
||||||
|diag| {
|
|diag| {
|
||||||
diag.span_note(
|
diag.span_note(
|
||||||
trait_method_span,
|
trait_method_span,
|
||||||
|
@ -139,7 +139,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
|
||||||
cx,
|
cx,
|
||||||
SAME_NAME_METHOD,
|
SAME_NAME_METHOD,
|
||||||
impl_span,
|
impl_span,
|
||||||
"method's name is same to an existing method in a trait",
|
"method's name is the same as an existing method in a trait",
|
||||||
|diag| {
|
|diag| {
|
||||||
// TODO should we `span_note` on every trait?
|
// TODO should we `span_note` on every trait?
|
||||||
// iterate on trait_spans?
|
// iterate on trait_spans?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error: method's name is same to an existing method in a trait
|
error: method's name is the same as an existing method in a trait
|
||||||
--> $DIR/same_name_method.rs:20:13
|
--> $DIR/same_name_method.rs:20:13
|
||||||
|
|
|
|
||||||
LL | fn foo() {}
|
LL | fn foo() {}
|
||||||
|
@ -11,7 +11,7 @@ note: existing `foo` defined here
|
||||||
LL | fn foo() {}
|
LL | fn foo() {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: method's name is same to an existing method in a trait
|
error: method's name is the same as an existing method in a trait
|
||||||
--> $DIR/same_name_method.rs:44:13
|
--> $DIR/same_name_method.rs:44:13
|
||||||
|
|
|
|
||||||
LL | fn foo() {}
|
LL | fn foo() {}
|
||||||
|
@ -23,7 +23,7 @@ note: existing `foo` defined here
|
||||||
LL | fn foo() {}
|
LL | fn foo() {}
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
error: method's name is same to an existing method in a trait
|
error: method's name is the same as an existing method in a trait
|
||||||
--> $DIR/same_name_method.rs:58:13
|
--> $DIR/same_name_method.rs:58:13
|
||||||
|
|
|
|
||||||
LL | fn foo() {}
|
LL | fn foo() {}
|
||||||
|
@ -35,7 +35,7 @@ note: existing `foo` defined here
|
||||||
LL | impl T1 for S {}
|
LL | impl T1 for S {}
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: method's name is same to an existing method in a trait
|
error: method's name is the same as an existing method in a trait
|
||||||
--> $DIR/same_name_method.rs:70:13
|
--> $DIR/same_name_method.rs:70:13
|
||||||
|
|
|
|
||||||
LL | fn foo() {}
|
LL | fn foo() {}
|
||||||
|
@ -47,7 +47,7 @@ note: existing `foo` defined here
|
||||||
LL | impl T1 for S {}
|
LL | impl T1 for S {}
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: method's name is same to an existing method in a trait
|
error: method's name is the same as an existing method in a trait
|
||||||
--> $DIR/same_name_method.rs:34:13
|
--> $DIR/same_name_method.rs:34:13
|
||||||
|
|
|
|
||||||
LL | fn clone() {}
|
LL | fn clone() {}
|
||||||
|
|
Loading…
Reference in a new issue