]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/same_name_method.rs
Rollup merge of #90741 - mbartlett21:patch-4, r=dtolnay
[rust.git] / src / tools / clippy / clippy_lints / src / same_name_method.rs
index 737ff634e449c4ff4406667e8f4d9e2afd4a6262..1bbaa104e60b17e8ab591e51c6c47fd27e45b258 100644 (file)
@@ -11,7 +11,7 @@
 
 declare_clippy_lint! {
     /// ### 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.
     ///
     /// ### Why is this bad?
@@ -33,6 +33,7 @@
     ///     fn foo(&self) {}
     /// }
     /// ```
+    #[clippy::version = "1.57.0"]
     pub SAME_NAME_METHOD,
     restriction,
     "two method with same name"
@@ -99,7 +100,7 @@ fn check_crate_post(&mut self, cx: &LateContext<'tcx>) {
                                         cx,
                                         SAME_NAME_METHOD,
                                         *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.span_note(
                                                 trait_method_span,
@@ -138,7 +139,7 @@ fn check_crate_post(&mut self, cx: &LateContext<'tcx>) {
                                         cx,
                                         SAME_NAME_METHOD,
                                         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| {
                                             // TODO should we `span_note` on every trait?
                                             // iterate on trait_spans?