-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Cosmetic improvements to comments #58524
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
28900f6
to
cf4bc34
Compare
@matthewjasper I see you got auto-chosen, but please don’t feel obliged to review. (Or maybe just review part, if you're not too averse to it.) |
@@ -986,7 +986,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx> { | |||
} | |||
} else { | |||
// Types in signatures. | |||
// FIXME: This is very ineffective. Ideally each HIR type should be converted | |||
// FIXME: this is very ineffective. Ideally, each HIR type should be converted |
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.
Controversial, please don't change this.
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.
(Case after FIXME.)
@@ -369,7 +369,7 @@ impl VisibilityLike for Option<AccessLevel> { | |||
const MAX: Self = Some(AccessLevel::Public); | |||
// Type inference is very smart sometimes. | |||
// It can make an impl reachable even some components of its type or trait are unreachable. | |||
// E.g. methods of `impl ReachableTrait<UnreachableTy> for ReachableTy<UnreachableTy> { ... }` | |||
// E.g., methods of `impl ReachableTrait<UnreachableTy> for ReachableTy<UnreachableTy> { ... }` |
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.
E.g.,
Another uglification that we shouldn't do IMO.
// but metadata cannot encode gensyms currently, so we create it here. | ||
// This is only a guess, two equivalent idents may incorrectly get different gensyms here. | ||
let ident = ident.gensym_if_underscore(); | ||
let def_id = def.def_id(); | ||
let expansion = Mark::root(); // FIXME(jseyfried) intercrate hygiene | ||
// FIXME(jseyfried): inter-crate hygiene. |
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 don't move trailing comments into separate lines.
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, trailing comments are discouraged in all the codebases I have contributed to, I'll say that much. It decreases readability and is especially problematic when there's a line length cap, I find. It may be worth a brief debate.
Ok, I think I'm personally converged on encouraging @alexreg to stop this activity, which is a waste of everyone's (including alexreg himself) time and disruption for the codebase. Everything that can be automated should go into rustfmt, and be performed on each commit/PR when the corresponding infra is up. Personal projects may satisfy the irresistible urge to style code in non-automated ways, if necessary. EDIT: I'm sufficiently sure that if #58036 and friends are merged, we'll see further similar over 1000 diff PRs, e.g. tweaking variable naming across the codebase to match the author's preferred style, because there are always things to "improve" if you have the right attitude. That's why I think this needs to be nipped in the bud. EDIT2: Previous comment removed since this wasn't my primary point. |
☔ The latest upstream changes (presumably #58495) made this pull request unmergeable. Please resolve the merge conflicts. |
Since I already got involved into this, I'll try to move this into more constructive direction and describe what I think would be an acceptable way to make changes like this. Adding a Style Rule, The ProcessSuppose you want Rust codebase to follow a certain stylistic rule, for example a rule that comments describing functions should use third person verbs (
Components
|
This PR is not meeting any of the requirements so far - the rules are 1) not described anywhere, 2) not applicable automatically, 3) lumped into a single batch and 4) have controversies. |
@petrochenkov Thanks for trying to be more constructive with your feedback regarding this all. I think going forwards that makes a lot of sense. However, because of the way I worked on this PR, the changes are all mixed together a bit much and very hard to separate either mechanically or by hand. I think that unless there are changes in this PR that are particularly controversial, and exhibit styles that don't already exist in the codebase, they should be permitted for the sake of getting the uncontroversial and universally beneficial aspects of this PR merged. Would appreciate thoughts on this however. |
@alexreg
This is unfortunate, but sunk cost is not a good base for making decisions.
The changes I mentioned in the inline comments are controversial. |
I'm going to nominate this to discuss the proposed process (#58524 (comment)) on Thursday and hopefully close this question. |
Blocked on #58619 |
Closing as decided in #58619 |
This has been factored out from #58036.