-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Modify lint pass note for consistency with the book #12596
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
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
This has been discussed before in some meeting, in general early lints are discouraged as often the lint will need additional info not present in an early pass later on anyway and thus will need to be rewritten (for example, to use The only upsides to an early pass (the mentioned "something specific from an early pass") are handling ranges (which aren't desugared yet) or telling whether a module is inlined (which also isn't desugared yet), which you can do both in the HIR anyway. Otherwise you lose access to every query. So we should change the book's documentation instead :P |
Agreed it's confusing, yeah focusing on |
I'm thinking this:
should be replaced with:
Does this look good? |
Early lints aren't inherently faster. They tend to be faster because they generally do less work, but a late lint only doing syntax checking will be just as fast. What early pass lints do is run before type checking and HIR lowering. This means code like this: fn main() {
let y = 'a'..'z';
let x: () = 0;
} can display:
If |
In that case, let's omit any mention of performance:
|
92f193d
to
e2861d5
Compare
@Alexendoo can you please review the changes? :) |
Thanks! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR:
cargo dev new_lint
.cargo dev new_lint
.Late pass remains the default value if no pass is specified as most lints use late pass.
Closes #12595
changelog: none