about summary refs log tree commit diff
path: root/compiler/rustc_error_codes
diff options
context:
space:
mode:
authorRafael Kraut <coding@rafael.kr>2021-05-13 13:22:24 +0200
committerGitHub <noreply@github.com>2021-05-13 13:22:24 +0200
commita56d0e2f6e8b41ab2f307220acbc8fa03caaeaec (patch)
tree9de5660372a6c7cbb8817e0c5e840d78281bdb93 /compiler/rustc_error_codes
parent703f2e1685a63c9718bcc3b09eb33a24334a7541 (diff)
downloadrust-a56d0e2f6e8b41ab2f307220acbc8fa03caaeaec.tar.gz
rust-a56d0e2f6e8b41ab2f307220acbc8fa03caaeaec.zip
swap function order for better read flow
When having the order

```
foo.bar(); // we can now use this method since i32 implements the Foo trait

[...]

impl Foo for i32
```

the `// we can now use this method` comment is less clear to me.
Diffstat (limited to 'compiler/rustc_error_codes')
-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!
 }