about summary refs log tree commit diff
path: root/src/librustc_error_codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-11 11:36:39 +0000
committerbors <bors@rust-lang.org>2020-01-11 11:36:39 +0000
commitbfd04876b93ad5c013d90bc46937e28b6ee1a3f4 (patch)
treefc35ad7fae01337e6873d43c00087dd53c3992db /src/librustc_error_codes
parent543b7d97d019bff882cc70cf2f8bdc317e7b840f (diff)
parent4eee796679bd13e0935c16f41a5e6e2ab0d5c018 (diff)
downloadrust-bfd04876b93ad5c013d90bc46937e28b6ee1a3f4.tar.gz
rust-bfd04876b93ad5c013d90bc46937e28b6ee1a3f4.zip
Auto merge of #68126 - Centril:rollup-cz5u7xx, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #67756 (Collector tweaks)
 - #67889 (Compile some CGUs in parallel at the start of codegen)
 - #67930 (Rename Result::as_deref_ok to as_deref)
 - #68018 (feature_gate: Remove `GateStrength`)
 - #68070 (clean up E0185 explanation)
 - #68072 (Fix ICE #68058)
 - #68114 (Don't require `allow_internal_unstable` unless `staged_api` is enabled.)
 - #68120 (Ban `...X` pats, harden tests, and improve diagnostics)

Failed merges:

r? @ghost
Diffstat (limited to 'src/librustc_error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0185.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/librustc_error_codes/error_codes/E0185.md b/src/librustc_error_codes/error_codes/E0185.md
index f0ad2af144a..944a93ed14e 100644
--- a/src/librustc_error_codes/error_codes/E0185.md
+++ b/src/librustc_error_codes/error_codes/E0185.md
@@ -2,7 +2,7 @@ An associated function for a trait was defined to be static, but an
 implementation of the trait declared the same function to be a method (i.e., to
 take a `self` parameter).
 
-Here's an example of this error:
+Erroneous code example:
 
 ```compile_fail,E0185
 trait Foo {
@@ -17,3 +17,19 @@ impl Foo for Bar {
     fn foo(&self) {}
 }
 ```
+
+When a type implements a trait's associated function, it has to use the same
+signature. So in this case, since `Foo::foo` does not take any argument and
+does not return anything, its implementation on `Bar` should be the same:
+
+```
+trait Foo {
+    fn foo();
+}
+
+struct Bar;
+
+impl Foo for Bar {
+    fn foo() {} // ok!
+}
+```