Skip to content

Commit

Permalink
small error code explanations improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 22, 2019
1 parent 9bb2e3c commit a8de11c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes/E0033.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ dereferencing the pointer.
You can read more about trait objects in the [Trait Objects] section of the
Reference.

[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects
[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects
4 changes: 2 additions & 2 deletions src/librustc_error_codes/error_codes/E0038.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ cause this problem.)
In such a case, the compiler cannot predict the return type of `foo()` in a
situation like the following:

```compile_fail
```compile_fail,E0038
trait Trait {
fn foo(&self) -> Self;
}
Expand Down Expand Up @@ -183,7 +183,7 @@ fn call_foo(thing: Box<Trait>) {

We don't just need to create a table of all implementations of all methods of
`Trait`, we need to create such a table, for each different type fed to
`foo()`. In this case this turns out to be (10 types implementing `Trait`)*(3
`foo()`. In this case this turns out to be (10 types implementing `Trait`)\*(3
types being fed to `foo()`) = 30 implementations!

With real world traits these numbers can grow drastically.
Expand Down

0 comments on commit a8de11c

Please sign in to comment.