about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-05-15 13:29:52 +0200
committerGitHub <noreply@github.com>2021-05-15 13:29:52 +0200
commit36b3c284977ed73bcf39affb7e2b7f75ffeeb4d5 (patch)
tree5a791c59c06518d14323a146e9ffdf7f71094ab2
parent57aa0d812acee349a04215918d70456c1a13e167 (diff)
parenta56d0e2f6e8b41ab2f307220acbc8fa03caaeaec (diff)
downloadrust-36b3c284977ed73bcf39affb7e2b7f75ffeeb4d5.tar.gz
rust-36b3c284977ed73bcf39affb7e2b7f75ffeeb4d5.zip
Rollup merge of #85253 - RafaelKr:patch-1, r=varkor
swap function order for better read flow

I was reading this error message for the first time.

I was a little bit confused when reading that part:
```
foo.bar(); // we can now use this method since i32 implements the Foo trait
```

At the time I was reading `// we can now use this method` I wasn't sure why. It only made sense when reading on. So swapping these parts results in a better read flow.
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0277.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0277.md b/compiler/rustc_error_codes/src/error_codes/E0277.md
index 9f6db6ed7a2..5f05b59d5a6 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0277.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0277.md
@@ -29,16 +29,16 @@ trait Foo {
     fn bar(&self);
 }
 
-fn some_func<T: Foo>(foo: T) {
-    foo.bar(); // we can now use this method since i32 implements the
-               // Foo trait
-}
-
 // we implement the trait on the i32 type
 impl Foo for i32 {
     fn bar(&self) {}
 }
 
+fn some_func<T: Foo>(foo: T) {
+    foo.bar(); // we can now use this method since i32 implements the
+               // Foo trait
+}
+
 fn main() {
     some_func(5i32); // ok!
 }