Added error explanations for E0308, E0309, and E0310#24576
Added error explanations for E0308, E0309, and E0310#24576bors merged 4 commits intorust-lang:masterfrom
Conversation
|
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/diagnostics.rs
Outdated
There was a problem hiding this comment.
This should be "can't be contained".
src/librustc/diagnostics.rs
Outdated
There was a problem hiding this comment.
You mean "…variable has." (forgot a 'h')
There was a problem hiding this comment.
I agree with @cactorium that original is grammatically correct but also difficult to read.
I suggest perhaps:
... 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.
For example:
let x: i32 = "I am not a number!"; // ~~~ ~~~~~~~~~~~~~~~~~~~~ // | | // | initializing expression; // | compiler infers type `&str` // | // type `i32` assigned to variable `x`
(Or drop the example if you're not into that. :) )
There was a problem hiding this comment.
That's way better worded :)! Thanks!
|
Nah, it's correct as is. It's the weird part of English where you have to put preposition after the object of the verb (eg. "Where are you going to?"). I'll see if I can come up with a way to make it less confusing though |
For #24407