Skip to content
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 sample fix for E0749 #75360

Merged
merged 4 commits into from
Aug 11, 2020
Merged

Add sample fix for E0749 #75360

merged 4 commits into from
Aug 11, 2020

Conversation

pickfire
Copy link
Contributor

Even though the description is clear but the solution may not be as straightforward.
Adding a suggested fix from documentation side.

r? @GuillaumeGomez

However, this suggestion should be shown in rustc itself for easy fix, the documentation should also reflect on the changes in rustc. Currently,

error[E0749]: negative impls cannot have any items
 --> test.rs:6:5
  |
6 |     type Foo = i32; // error!
  |     ^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0749`.

rustc should tell the user to remove it.

Even though the description is clear but the solution may not be as straightforward.
Adding a suggested fix.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2020
@@ -11,6 +11,7 @@ trait MyTrait {
impl !MyTrait for u32 {
type Foo = i32; // error!
}
// impl !MyTrait for u32 {} // fix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of putting it inside the erroneous code example, it would be better to put it into another code block at the end like the other explanations do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I applied the suggestion. Do we need fn main() {}?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never remember how rustdoc handles global attributes #![...], so let's wait to see if the CI is happy and we'll know for sure. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuillaumeGomez Should we remove it? fn main

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should indeed. Please also squash your commits.

Copy link
Contributor Author

@pickfire pickfire Aug 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am doing most documentation stuff from github directly, I don't want to interact with many branches (~5) I had on rust. (I am also lazy to compile rust, so sometimes I even test out if it works by sending a pull request to run it in CI)

But rather, --squash is troublesome, doing git rebase --autosquash is better, just git --fixup HEAD~ and that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 commits for 11 lines of uncontroversial documentation seems like super huge to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, rust already have > 120,000 commits, adding 4 won't make a difference, I do think it is a lot. I will squash if it is required, otherwise I rather be lazy and not squash. :P

@GuillaumeGomez
Copy link
Member

Thanks!

r=me once CI pass

@Dylan-DPC-zz
Copy link

@bors r=GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Aug 10, 2020

📌 Commit a7f61bf has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 11, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#74744 (Update RELEASES.md for 1.46.0)
 - rust-lang#75085 (Transmute big endian `s6_addr` and `[u16; 8]`)
 - rust-lang#75226 (Miri: Renamed "undef" to "uninit")
 - rust-lang#75333 (polymorphize: constrain unevaluated const handling)
 - rust-lang#75338 (move stack size check to const_eval machine)
 - rust-lang#75347 (Rustdoc: Fix natural ordering to look at all numbers.)
 - rust-lang#75352 (Tweak conditions for E0026 and E0769)
 - rust-lang#75353 (Tiny cleanup, remove unnecessary `unwrap`)
 - rust-lang#75359 (unused_delims: trim expr)
 - rust-lang#75360 (Add sample fix for E0749)

Failed merges:

r? @ghost
@bors bors merged commit 5320028 into rust-lang:master Aug 11, 2020
@pickfire pickfire deleted the patch-4 branch August 11, 2020 15:41
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants