Conversation
Even though the description is clear but the solution may not be as straightforward. Adding a suggested fix.
| impl !MyTrait for u32 { | ||
| type Foo = i32; // error! | ||
| } | ||
| // impl !MyTrait for u32 {} // fix |
There was a problem hiding this comment.
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.
Good idea, I applied the suggestion. Do we need fn main() {}?
There was a problem hiding this comment.
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.
@GuillaumeGomez Should we remove it? fn main
There was a problem hiding this comment.
I guess we should indeed. Please also squash your commits.
There was a problem hiding this comment.
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.
4 commits for 11 lines of uncontroversial documentation seems like super huge to me.
There was a problem hiding this comment.
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 <guillaume1.gomez@gmail.com>
|
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.