Skip to content

Commit 36b3c28

Browse files
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.
2 parents 57aa0d8 + a56d0e2 commit 36b3c28

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+5
-5
lines changed

compiler/rustc_error_codes/src/error_codes/E0277.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ trait Foo {
2929
fn bar(&self);
3030
}
3131
32-
fn some_func<T: Foo>(foo: T) {
33-
foo.bar(); // we can now use this method since i32 implements the
34-
// Foo trait
35-
}
36-
3732
// we implement the trait on the i32 type
3833
impl Foo for i32 {
3934
fn bar(&self) {}
4035
}
4136
37+
fn some_func<T: Foo>(foo: T) {
38+
foo.bar(); // we can now use this method since i32 implements the
39+
// Foo trait
40+
}
41+
4242
fn main() {
4343
some_func(5i32); // ok!
4444
}

0 commit comments

Comments
 (0)