diff options
Diffstat (limited to 'src/docs/same_name_method.txt')
| -rw-r--r-- | src/docs/same_name_method.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/docs/same_name_method.txt b/src/docs/same_name_method.txt new file mode 100644 index 00000000000..792dd717fc6 --- /dev/null +++ b/src/docs/same_name_method.txt @@ -0,0 +1,23 @@ +### What it does +It lints if a struct has two methods with the same name: +one from a trait, another not from trait. + +### Why is this bad? +Confusing. + +### Example +``` +trait T { + fn foo(&self) {} +} + +struct S; + +impl T for S { + fn foo(&self) {} +} + +impl S { + fn foo(&self) {} +} +``` \ No newline at end of file |
