reveal_actual_level improvements#156536
Merged
rust-bors[bot] merged 4 commits intoMay 13, 2026
Merged
Conversation
`reveal_actual_level` has two call sites, which look like this:
```
let (level, mut src) = self.raw_lint_id_level(lint, idx, aux);
let (level, lint_id) = reveal_actual_level(level, &mut src, sess, lint, |id| {
self.raw_lint_id_level(id, idx, aux)
});
```
and:
```
let (level, mut src) = self.probe_for_lint_level(tcx, lint, cur);
let (level, lint_id) = reveal_actual_level(level, &mut src, tcx.sess, lint, |lint| {
self.probe_for_lint_level(tcx, lint, cur)
});
```
They both have the same pattern: there's a prior call expression that is then
repeated within a closure passed to `reveal_actual_level`.
This commit moves that prior call inside `reveal_actual_level`, making things
simpler.
It currently returns a triple: `(Level, Option<LintExpectationId>, LintLevelSource)`. That's structurally identical to `LevelAndSource`, so this commit changes it accordingly.
It's currrently `(Option<(Level, Option<LintExpectationId>)>, LintLevelSource)`. But when the first element of the pair is `None` the second element is always `LintLevelSource::Default`. So this commit moves the `LintLevelSource` within the `Option`, which simplifies things a bit.
Again, the returned triple is equivalent to `LevelAndSource`.
GuillaumeGomez
approved these changes
May 13, 2026
Member
|
Thanks! @bors r+ rollup |
Contributor
rust-timer
added a commit
that referenced
this pull request
May 13, 2026
Rollup merge of #156536 - nnethercote:reveal_actual_level-improvements, r=GuillaumeGomez `reveal_actual_level` improvements Details in individual commits. r? @GuillaumeGomez
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.
Details in individual commits.
r? @GuillaumeGomez