about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-24 00:49:43 +0100
committerGitHub <noreply@github.com>2020-03-24 00:49:43 +0100
commit7a47df81697ae1db7b7545b11a06e00e989ccd87 (patch)
tree2ffbad7e476cb33d84953b3f94223aea30fde4d3 /src/librustc_error_codes/error_codes
parent72c99f2cf0021fe119dd3de8272349f679188150 (diff)
parent99ae42876b1e99b558c392d7912b826d32c39476 (diff)
downloadrust-7a47df81697ae1db7b7545b11a06e00e989ccd87.tar.gz
rust-7a47df81697ae1db7b7545b11a06e00e989ccd87.zip
Rollup merge of #70242 - DeeDeeG:improve-e0308, r=Dylan-DPC
Improve E0308 error message wording

Hi folks,

I made [a post on Reddit](https://old.reddit.com/r/rust/comments/fmi11x/consider_linting_rusts_documentationerror_text/) about how (IMO) the docs/error messages can be a bit intimidating, one thing led to another, and I was encouraged to submit a Pull Request if I felt I could re-phrase the error message that I used as an example.

So that's this Pull Request. Open to any feedback or style changes, and I understand this is subjective.

(On another note: I am happy to see [this message was recently improved](https://github.com/rust-lang/rust/pull/69139) in `master`, so it's already better than it is in stable Rust 1.42.0.)

Ideally the last sentence could be split into at least two: [sentence explaining the inferred type.] [Sentence explaining explicit type.] [Sentence that summarizes that "this is bad," and why.]

But I'm not sure how to do so; I'm wary of writing something that turns out to be technically incorrect.
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0308.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0308.md b/src/librustc_error_codes/error_codes/E0308.md
index 7d87d54194e..b2c84370490 100644
--- a/src/librustc_error_codes/error_codes/E0308.md
+++ b/src/librustc_error_codes/error_codes/E0308.md
@@ -13,7 +13,7 @@ let x: i32 = "I am not a number!";
 ```
 
 This error occurs when the compiler was unable to infer the concrete type of a
-variable. It can occur for several cases, the most common of which is a
-mismatch in the expected type that the compiler inferred for a variable's
-initializing expression, and the actual type explicitly assigned to the
-variable.
+variable. It can happen in several cases, the most common being a mismatch
+between the type that the compiler inferred for a variable based on its
+initializing expression, on the one hand, and the type the author explicitly
+assigned to the variable, on the other hand.