-
Notifications
You must be signed in to change notification settings - Fork 1.8k
clippy_dev
: Parsing revamp part 2/N
#15921
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
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @samueltardieu. Use |
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) { |
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.
None of those lifetimes are necessary
clippy_dev/src/parse.rs
Outdated
impl ParseCxImpl { | ||
/// Finds all lint declarations (`declare_clippy_lint!`) | ||
#[must_use] | ||
pub fn find_lint_decls(&mut self) -> Vec<Lint> { |
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.
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.
clippy_dev/src/parse.rs
Outdated
} | ||
|
||
#[must_use] | ||
pub fn read_deprecated_lints(&mut self) -> (Vec<DeprecatedLint>, Vec<RenamedLint>) { |
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.
Same nit as above about &mut self
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