-
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
Format doc comments #102285
Format doc comments #102285
Conversation
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in src/librustdoc/clean/types.rs cc @camelid Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi Changes rustc_apfloat. rustc_apfloat is currently in limbo and you almost certainly don't want to change it (see #55993). cc @eddyb |
@@ -538,7 +537,6 @@ pub trait Float: | |||
/// NaN -> \c IEK_NAN | |||
/// 0 -> \c IEK_ZERO | |||
/// Inf -> \c IEK_INF | |||
/// |
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.
Dismissing my ping on the basis of these being trivial comment-only changes (tho I wish we could've just frozen this directory sigh).
If needed, I could try to go through them and only grab the doc comment changes for the core/std/alloc libraries, removing the rest of the changes.
Consider this comment a (tiny) vote for having a PR just for library/
, the compiler itself in general is more likely to be chaotic, and even have weird snippets in comments etc.
But if people are willing to review the PR as-is, I have nothing against that, to be clear.
@bors rollup=never |
@@ -534,7 +534,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { | |||
let receiver_place = loop { | |||
match receiver.layout.ty.kind() { | |||
ty::Ref(..) | ty::RawPtr(..) => break self.deref_operand(&receiver)?, | |||
ty::Dynamic(..) => break receiver.assert_mem_place(), // no immediate unsized values | |||
ty::Dynamic(..) => break receiver.assert_mem_place(), /* no immediate unsized values */ |
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.
Some of these are strange -- there is no reason this needs changing I think
Generally we don't accept formatting PRs unless they are checked by tidy. Also this PR is way too big to be reviewable so it'd be advisable to split it up. There's a question here of whether the time people will spend reviewing this (in particular for the part outside of |
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #102051) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -501,7 +501,7 @@ fn codegen_stmt<'tcx>( | |||
|
|||
#[cfg(any())] // This is never true | |||
match &stmt.kind { | |||
StatementKind::StorageLive(..) | StatementKind::StorageDead(..) => {} // Those are not very useful | |||
StatementKind::StorageLive(..) | StatementKind::StorageDead(..) => {} /* Those are not very useful */ |
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.
Please revert this change.
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 understand why rust-fmt made that change.
I'll go through each change manually and remove changes like this, and just remove all changes to compiler/ anyway.
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'm with Ralf on this one -- one PR to do this across everything is too big, and procedurally can't really happen because different people should review the different parts.
I was tempted to just close, but it sounds like you're going to use this one for just library changes, so that would be ok I think. You might still consider closing this one and opening a new one so that you'll have a fresh PR without all the pings to the will-be-irrelevant people and teams.
Hi @AldaronLau! First off, let me say "thank you" for spending the time and effort to help improve the consistency of the repo's doc comments. 🙂 As @RalfJung mentions, reviewer time is both limited and precious and so for PRs like this is, it's critical that they be optimized for ease of review. To that end, I have a few suggestions that might help:
Thanks for your help in this area! |
I'm not familiar with |
The |
ping from triage: Can you please address the merge conflicts - and post your status on this PR? FYI: when a PR is ready for review, send a message containing |
Sorry, I forgot about this - I'll reopen a smaller PR for /library only. |
I find the lack of consistency in formatting in rust docs for core/std/alloc to be annoying.
This PR formats code blocks in doc comments by running the unstable
format_code_in_doc_comments
.Running
cargo fmt
with this feature does make tidy fail (with trailing whitespace), so it had to be commented out in the rustfmt.toml after adding and running.One thing I'm not sure about is why there were other formatting changes when I ran it. If needed, I could try to go through them and only grab the doc comment changes for the core/std/alloc libraries, removing the rest of the changes.