*: enable borrow_interior_mutable_const clippy lint#31875
Merged
teskje merged 2 commits intoMaterializeInc:mainfrom Mar 13, 2025
Merged
*: enable borrow_interior_mutable_const clippy lint#31875teskje merged 2 commits intoMaterializeInc:mainfrom
teskje merged 2 commits intoMaterializeInc:mainfrom
Conversation
teskje
commented
Mar 12, 2025
| now.saturating_add( | ||
| TIMESTAMP_INTERVAL.saturating_mul(Timestamp::from(TIMESTAMP_INTERVAL_UPPER_BOUND)), | ||
| ) | ||
| now.saturating_add(TIMESTAMP_INTERVAL_MS * TIMESTAMP_INTERVAL_UPPER_BOUND) |
Contributor
Author
There was a problem hiding this comment.
Idk what the meaning of the two constants here ("timestamp interval" and "timestamp interval upper bound") is, but it seems like maybe it could be a single constant?
teskje
commented
Mar 12, 2025
| /// Set of [`SystemVar`]s that can also get set at a per-Session level. | ||
| /// | ||
| /// TODO(parkmycar): Instead of a separate list, make this a field on VarDefinition. | ||
| const SESSION_VARS: LazyLock<BTreeMap<&'static UncasedStr, &'static VarDefinition>> = |
Contributor
Author
There was a problem hiding this comment.
Had to move this outside the SystemVars impl because associated static items are not allowed.
Mostly about unused lifetime specifiers in function signatures.
661ce08 to
77f54b8
Compare
77f54b8 to
eb687f8
Compare
Contributor
Author
|
TFTR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables a new clip lint, borrow_interior_mutable_const. This lint would have been useful in finding #31594 before it was merged, rather than only after the canary deploy.
This PR also fixes a bunch of other likely wrong usages of
const(all only performance-impacting afaict), as well as a bunch of other clippy errors one gets on the recent Rust version.Motivation
Checklist
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel.