-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add sample fix for E0749 #75360
Conversation
Even though the description is clear but the solution may not be as straightforward. Adding a suggested fix.
@@ -11,6 +11,7 @@ trait MyTrait { | |||
impl !MyTrait for u32 { | |||
type Foo = i32; // error! | |||
} | |||
// impl !MyTrait for u32 {} // fix |
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.
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.
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.
Good idea, I applied the suggestion. Do we need fn main() {}
?
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 never remember how rustdoc handles global attributes #![...]
, so let's wait to see if the CI is happy and we'll know for sure. :)
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.
@GuillaumeGomez Should we remove it? fn main
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 guess we should indeed. Please also squash your commits.
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 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.
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.
4 commits for 11 lines of uncontroversial documentation seems like super huge to me.
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.
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
Co-authored-by: Guillaume Gomez <[email protected]>
Thanks! r=me once CI pass |
@bors r=GuillaumeGomez rollup |
📌 Commit a7f61bf has been approved by |
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
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,
rustc should tell the user to remove it.