Skip to content

Commit

Permalink
Rollup merge of #85253 - RafaelKr:patch-1, r=varkor
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GuillaumeGomez committed May 15, 2021
2 parents 57aa0d8 + a56d0e2 commit 36b3c28
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions compiler/rustc_error_codes/src/error_codes/E0277.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
}
Expand Down

0 comments on commit 36b3c28

Please sign in to comment.