-
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
Make some lints incremental #57293
Make some lints incremental #57293
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1360,6 +1360,7 @@ fn check_const(cx: &LateContext<'_, '_>, body_id: hir::BodyId) { | |
promoted: None | ||
}; | ||
// trigger the query once for all constants since that will already report the errors | ||
// FIXME: Use ensure here | ||
let _ = cx.tcx.const_eval(param_env.and(cid)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is that this regression is related to |
||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,37 +125,72 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) { | |
store.register_early_pass(sess, false, true, box BuiltinCombinedEarlyLintPass::new()); | ||
} | ||
|
||
late_lint_methods!(declare_combined_late_lint_pass, [BuiltinCombinedLateLintPass, [ | ||
late_lint_methods!(declare_combined_late_lint_pass, [BuiltinCombinedModuleLateLintPass, [ | ||
HardwiredLints: HardwiredLints, | ||
WhileTrue: WhileTrue, | ||
ImproperCTypes: ImproperCTypes, | ||
VariantSizeDifferences: VariantSizeDifferences, | ||
BoxPointers: BoxPointers, | ||
UnusedAttributes: UnusedAttributes, | ||
PathStatements: PathStatements, | ||
|
||
// Depends on referenced function signatures in expressions | ||
UnusedResults: UnusedResults, | ||
NonSnakeCase: NonSnakeCase, | ||
|
||
NonUpperCaseGlobals: NonUpperCaseGlobals, | ||
NonShorthandFieldPatterns: NonShorthandFieldPatterns, | ||
UnusedAllocation: UnusedAllocation, | ||
|
||
// Depends on types used in type definitions | ||
MissingCopyImplementations: MissingCopyImplementations, | ||
UnstableFeatures: UnstableFeatures, | ||
InvalidNoMangleItems: InvalidNoMangleItems, | ||
|
||
PluginAsLibrary: PluginAsLibrary, | ||
|
||
// Depends on referenced function signatures in expressions | ||
MutableTransmutes: MutableTransmutes, | ||
|
||
// Depends on types of fields, checks if they implement Drop | ||
UnionsWithDropFields: UnionsWithDropFields, | ||
UnreachablePub: UnreachablePub, | ||
UnnameableTestItems: UnnameableTestItems::new(), | ||
|
||
TypeAliasBounds: TypeAliasBounds, | ||
UnusedBrokenConst: UnusedBrokenConst, | ||
|
||
TrivialConstraints: TrivialConstraints, | ||
TypeLimits: TypeLimits::new(), | ||
|
||
NonSnakeCase: NonSnakeCase, | ||
InvalidNoMangleItems: InvalidNoMangleItems, | ||
|
||
// Depends on access levels | ||
UnreachablePub: UnreachablePub, | ||
|
||
ExplicitOutlivesRequirements: ExplicitOutlivesRequirements, | ||
]], ['tcx]); | ||
|
||
store.register_late_pass(sess, false, true, box BuiltinCombinedModuleLateLintPass::new()); | ||
|
||
late_lint_methods!(declare_combined_late_lint_pass, [BuiltinCombinedLateLintPass, [ | ||
// FIXME: Look into regression when this is used as a module lint | ||
// May Depend on constants elsewhere | ||
UnusedBrokenConst: UnusedBrokenConst, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I narrow down the regression to this lint, and moving that to a non-module pass should get rid of it. |
||
|
||
// Uses attr::is_used which is untracked, can't be an incremental module pass. | ||
UnusedAttributes: UnusedAttributes, | ||
|
||
// Needs to run after UnusedAttributes as it marks all `feature` attributes as used. | ||
UnstableFeatures: UnstableFeatures, | ||
|
||
// Tracks state across modules | ||
UnnameableTestItems: UnnameableTestItems::new(), | ||
|
||
// Tracks attributes of parents | ||
MissingDoc: MissingDoc::new(), | ||
|
||
// Depends on access levels | ||
// FIXME: Turn the computation of types which implement Debug into a query | ||
// and change this to a module lint pass | ||
MissingDebugImplementations: MissingDebugImplementations::new(), | ||
ExplicitOutlivesRequirements: ExplicitOutlivesRequirements, | ||
]], ['tcx]); | ||
|
||
store.register_late_pass(sess, false, box BuiltinCombinedLateLintPass::new()); | ||
store.register_late_pass(sess, false, false, box BuiltinCombinedLateLintPass::new()); | ||
|
||
add_lint_group!(sess, | ||
"nonstandard_style", | ||
|
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.
This actually has a separate API from regular attribute access, in several places, it would be nice if we could get rid of the other APIs.