Skip to content

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Oct 20, 2025

Based on #15866

This adds a parsing context that can allocate from an arena. Ultimately this will also store a source map for better error reporting, but a few other changes are happening before that.

The arena itself is unlikely to be needed from a perf standpoint (reading all the files should be the slow part), but having more things be copyable is nice. For reference the perf impact of this change is within the noise.

changelog: none

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2025

r? @samueltardieu

rustbot has assigned @samueltardieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@samueltardieu
Copy link
Member

@rustbot label S-blocked
by #15866

pub fn deprecate(clippy_version: Version, name: &str, reason: &str) {
let mut lints = find_lint_decls();
let (mut deprecated_lints, renamed_lints) = read_deprecated_lints();
pub fn deprecate<'cx, 'env: 'cx>(cx: ParseCx<'cx>, clippy_version: Version, name: &'env str, reason: &'env str) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of those lifetimes are necessary

impl ParseCxImpl {
/// Finds all lint declarations (`declare_clippy_lint!`)
#[must_use]
pub fn find_lint_decls(&mut self) -> Vec<Lint> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It is strange that in this commit &mut self is used as a parameter and never used. This would not pass dogfood should the PR be partially merged up to this commit.

}

#[must_use]
pub fn read_deprecated_lints(&mut self) -> (Vec<DeprecatedLint>, Vec<RenamedLint>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nit as above about &mut self

@samueltardieu samueltardieu added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work label Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants