-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
[Merged by Bors] - Restructure lints in multiple crates #2447
Conversation
Test262 conformance changes
|
Codecov Report
@@ Coverage Diff @@
## main #2447 +/- ##
==========================================
+ Coverage 52.44% 52.63% +0.19%
==========================================
Files 331 330 -1
Lines 35019 34853 -166
==========================================
- Hits 18365 18346 -19
+ Misses 16654 16507 -147
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
)] | ||
#![allow(clippy::let_unit_value, clippy::module_name_repetitions)] | ||
|
||
extern crate self as boa_gc; |
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.
Do we need this?
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.
I think yes, because of the usages of the Trace
and Finalize
derive macros in boa_gc
itself. The macros expect that ::boa::gc
is available.
@@ -100,12 +125,12 @@ impl Error { | |||
} | |||
|
|||
/// Creates a "general" parsing error. | |||
pub(crate) fn general(message: &'static str, position: Position) -> Self { | |||
pub(crate) const fn general(message: &'static str, position: Position) -> Self { |
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.
I would also add a "must use" and inline hint in these functions
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.
The lint only marks pub functions. I think for internal function must_use would be a much.
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.
Makes sense, and we can use the "unused" lint to check if we aren't using results.
@@ -14,9 +14,10 @@ pub(super) struct Cursor<R> { | |||
impl<R> Cursor<R> { | |||
/// Gets the current position of the cursor in the source code. | |||
#[inline] | |||
pub(super) fn pos(&self) -> Position { | |||
pub(super) const fn pos(&self) -> Position { |
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 should probably also be must_use
right? Does the lint not mark it?
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.
See above regarding must_use.
@@ -22,8 +21,8 @@ pub(super) struct SpreadLiteral; | |||
|
|||
impl SpreadLiteral { | |||
/// Creates a new string literal lexer. | |||
pub(super) fn new() -> Self { | |||
Self {} | |||
pub(super) const fn new() -> Self { |
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.
Do we need this function?
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.
With the way the lexer is built around the Tokenizer
trait, I think it is best to stick to the convention and leave this function as is.
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.
Thanks for the enhancement! I added some comments for potential improvements :)
clippy::nursery, | ||
)] | ||
|
||
use std::fmt::{self, Debug}; |
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 could be included in the std import below
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.
The other std import is only enabled when the profiler
feature is enabled.
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.
Just a small nitpick, and it can be merged :)
boa_gc/src/internals/mod.rs
Outdated
mod gc_box; | ||
pub(crate) use gc_box::GcBox; | ||
|
||
pub(crate) use {self::ephemeron_box::EphemeronBox, self::gc_box::GcBox}; |
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.
I think it would be better as self::{...}
, scoping stuff inside of it, instead of repeating self
@@ -100,12 +125,12 @@ impl Error { | |||
} | |||
|
|||
/// Creates a "general" parsing error. | |||
pub(crate) fn general(message: &'static str, position: Position) -> Self { | |||
pub(crate) const fn general(message: &'static str, position: Position) -> Self { |
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.
Makes sense, and we can use the "unused" lint to check if we aren't using results.
bors r+ |
This Pull Request restructures the lint deny/warn/allow lists in almost all crates. `boa_engine` will be done in a follow up PR as the changes there are pretty extensive.
Pull request successfully merged into main. Build succeeded: |
This Pull Request restructures the lint deny/warn/allow lists in almost all crates.
boa_engine
will be done in a follow up PR as the changes there are pretty extensive.