Skip to content

Commit d7784d3

Browse files
committed
pedantic
1 parent 1a64df5 commit d7784d3

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,6 +2906,7 @@ Released 2018-09-13
29062906
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
29072907
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
29082908
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
2909+
[`same_name_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_name_method
29092910
[`search_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
29102911
[`self_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_assignment
29112912
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11461146
LintId::of(ranges::RANGE_PLUS_ONE),
11471147
LintId::of(redundant_else::REDUNDANT_ELSE),
11481148
LintId::of(ref_option_ref::REF_OPTION_REF),
1149+
LintId::of(same_name_method::SAME_NAME_METHOD),
11491150
LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
11501151
LintId::of(shadow::SHADOW_UNRELATED),
11511152
LintId::of(strings::STRING_ADD_ASSIGN),
@@ -1423,7 +1424,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14231424
LintId::of(repeat_once::REPEAT_ONCE),
14241425
LintId::of(returns::LET_AND_RETURN),
14251426
LintId::of(returns::NEEDLESS_RETURN),
1426-
LintId::of(same_name_method::SAME_NAME_METHOD),
14271427
LintId::of(self_assignment::SELF_ASSIGNMENT),
14281428
LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS),
14291429
LintId::of(serde_api::SERDE_API_MISUSE),
@@ -1580,7 +1580,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15801580
LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
15811581
LintId::of(returns::LET_AND_RETURN),
15821582
LintId::of(returns::NEEDLESS_RETURN),
1583-
LintId::of(same_name_method::SAME_NAME_METHOD),
15841583
LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS),
15851584
LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
15861585
LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),

clippy_lints/src/same_name_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ declare_clippy_lint! {
3434
/// }
3535
/// ```
3636
pub SAME_NAME_METHOD,
37-
style,
37+
pedantic,
3838
"two method with same name"
3939
}
4040

tests/ui/same_name_method.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![warn(clippy::same_name_method)]
12
#![allow(dead_code, non_camel_case_types)]
23

34
trait T1 {

tests/ui/same_name_method.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
error: method's name is same to an existing method in a trait
2-
--> $DIR/same_name_method.rs:19:13
2+
--> $DIR/same_name_method.rs:20:13
33
|
44
LL | fn foo() {}
55
| ^^^^^^^^^^^
66
|
77
= note: `-D clippy::same-name-method` implied by `-D warnings`
88
note: existing `foo` defined here
9-
--> $DIR/same_name_method.rs:23:13
9+
--> $DIR/same_name_method.rs:24:13
1010
|
1111
LL | fn foo() {}
1212
| ^^^^^^^^^^^
1313

1414
error: method's name is same to an existing method in a trait
15-
--> $DIR/same_name_method.rs:43:13
15+
--> $DIR/same_name_method.rs:44:13
1616
|
1717
LL | fn foo() {}
1818
| ^^^^^^^^^^^
1919
|
2020
note: existing `foo` defined here
21-
--> $DIR/same_name_method.rs:47:13
21+
--> $DIR/same_name_method.rs:48:13
2222
|
2323
LL | fn foo() {}
2424
| ^^^^^^^^^^^
2525

2626
error: method's name is same to an existing method in a trait
27-
--> $DIR/same_name_method.rs:57:13
27+
--> $DIR/same_name_method.rs:58:13
2828
|
2929
LL | fn foo() {}
3030
| ^^^^^^^^^^^
3131
|
3232
note: existing `foo` defined here
33-
--> $DIR/same_name_method.rs:60:9
33+
--> $DIR/same_name_method.rs:61:9
3434
|
3535
LL | impl T1 for S {}
3636
| ^^^^^^^^^^^^^^^^
3737

3838
error: method's name is same to an existing method in a trait
39-
--> $DIR/same_name_method.rs:69:13
39+
--> $DIR/same_name_method.rs:70:13
4040
|
4141
LL | fn foo() {}
4242
| ^^^^^^^^^^^
4343
|
4444
note: existing `foo` defined here
45-
--> $DIR/same_name_method.rs:72:9
45+
--> $DIR/same_name_method.rs:73:9
4646
|
4747
LL | impl T1 for S {}
4848
| ^^^^^^^^^^^^^^^^
4949

5050
error: method's name is same to an existing method in a trait
51-
--> $DIR/same_name_method.rs:33:13
51+
--> $DIR/same_name_method.rs:34:13
5252
|
5353
LL | fn clone() {}
5454
| ^^^^^^^^^^^^^
5555
|
5656
note: existing `clone` defined here
57-
--> $DIR/same_name_method.rs:29:18
57+
--> $DIR/same_name_method.rs:30:18
5858
|
5959
LL | #[derive(Clone)]
6060
| ^^^^^

0 commit comments

Comments
 (0)