diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-15 13:29:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-15 13:29:52 +0200 |
| commit | 36b3c284977ed73bcf39affb7e2b7f75ffeeb4d5 (patch) | |
| tree | 5a791c59c06518d14323a146e9ffdf7f71094ab2 | |
| parent | 57aa0d812acee349a04215918d70456c1a13e167 (diff) | |
| parent | a56d0e2f6e8b41ab2f307220acbc8fa03caaeaec (diff) | |
| download | rust-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.md | 10 |
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! } |
