From a8de11cdd5c20a75d3cef4c7a322d29539b7bda2 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 22 Nov 2019 13:35:08 +0100 Subject: [PATCH] small error code explanations improvements --- src/librustc_error_codes/error_codes/E0033.md | 2 +- src/librustc_error_codes/error_codes/E0038.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0033.md b/src/librustc_error_codes/error_codes/E0033.md index c49cedf2d5869..735a2d1f3fe85 100644 --- a/src/librustc_error_codes/error_codes/E0033.md +++ b/src/librustc_error_codes/error_codes/E0033.md @@ -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 \ No newline at end of file +[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects diff --git a/src/librustc_error_codes/error_codes/E0038.md b/src/librustc_error_codes/error_codes/E0038.md index 21b5eb47480e6..25e380b02e647 100644 --- a/src/librustc_error_codes/error_codes/E0038.md +++ b/src/librustc_error_codes/error_codes/E0038.md @@ -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; } @@ -183,7 +183,7 @@ fn call_foo(thing: Box) { 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.