-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add E0393 error explanation #32989
Add E0393 error explanation #32989
Conversation
@@ -3426,6 +3426,30 @@ parameters. You can read more about it in the API documentation: | |||
https://doc.rust-lang.org/std/marker/struct.PhantomData.html | |||
"##, | |||
|
|||
E0393: r##" | |||
A type parameter which needs to be explicity specified because its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing. How about "A type parameter which references Self
in its default value was not specified.".
@@ -1 +1 @@ | |||
Subproject commit 7265c17d1845354f979a39b4ceb3a6934025b2ab | |||
Subproject commit 2278a549559c38872b4338cb002ecc2a80d860dc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be there
cb5c95d
to
d3e82e3
Compare
@@ -3426,6 +3426,37 @@ parameters. You can read more about it in the API documentation: | |||
https://doc.rust-lang.org/std/marker/struct.PhantomData.html | |||
"##, | |||
|
|||
E0393: r##" | |||
A type parameter which references `Self` in its default value was not specified. | |||
Example of erroneous code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Here is an example of erroneous code"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a debate on this sentence every time, right? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't agree with you on this one. I think it's too much "decoration" for such a simple sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently it's not a sentence, though. Neither is "Erroneous code example", but that reads more naturally so I'm mostly okay with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arf, people will never agree on this sentence. We should put the debate on the RFC as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't currently have an opinion about whether the phrase in question needs to take the form of a sentence or not, but I do have an opinion about the supposedly more natural alternative of "Erroneous code example":
The phrase "Example of erroneous code" is at least unambiguous about what is erroneous: the code itself.
The phrase "Erroneous code example" is less clear.
-
The adjective "Erroneous" could be interpreted as applying to the word "code", as in:
here is some code that illustrates the error under discussion
-
or it could alternatively be interpreted as applying to the word "example", as in:
here is an attempt at an example of some code to illustrate concept X, but the example is erroneous, and thus the example fails to actually illustrate X
(Of course one has to actually work to come up with the latter interpretation. Nonetheless, I'm generally -1 on phrasing that slip too easily into multiple potential parsings.)
@bors r+ rollup Felix's comment makes sense |
📌 Commit d3e82e3 has been approved by |
And here ends the debate. :) |
⌛ Testing commit d3e82e3 with merge 77c7f3e... |
💔 Test failed - auto-win-gnu-64-opt |
@bors: retry On Fri, Apr 22, 2016 at 8:37 AM, bors [email protected] wrote:
|
Add E0393 error explanation Part of #32777. r? @Manishearth cc @steveklabnik
💔 Test failed - auto-mac-64-nopt-t |
|
||
fn together_we_will_rule_the_galaxy(son: &A) {} | ||
// error: the type parameter `T` must be explicitly specified in an | ||
object type because its default value `Self` references the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<stdin>:5:49: 5:50 error: unknown start of token: `
<stdin>:5 object type because its default value `Self` references the
It seems it doesn't like backticks in here. Should I remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the issue that there needs to be //
at the beginning of line 3438?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right! I totally overpassed it... Thanks @pnkfelix!
Updated. |
@bors r+ rollup |
📌 Commit d648fc6 has been approved by |
Add E0393 error explanation Part of #32777. r? @Manishearth cc @steveklabnik
Part of #32777.
r? @Manishearth
cc @steveklabnik