Skip to content
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

Add Linebender lint set v2. #402

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Add Linebender lint set v2. #402

merged 2 commits into from
Nov 22, 2024

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Nov 22, 2024

Actually satisfying a good chunk of these lints is deferred and they are in an allow block in lib.rs.

Still, I did satisfy some of the lints.

The rand method gen has to be a raw r#gen until they publish a new version. They have that method renamed in master.


#[cfg(not(any(feature = "std", feature = "libm")))]
compile_error!("kurbo requires either the `std` or `libm` feature");

// Suppress the unused_crate_dependencies lint when both std and libm are specified.
#[cfg(all(feature = "std", feature = "libm"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

but this shouldn't happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

If by this you mean:

  • both std and libm together -- well, it easily can, e.g. by using --all-features
  • libm being unused when the libm feature is specified -- well, std overrides it so it won't be used

Copy link
Contributor

Choose a reason for hiding this comment

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

But the case of --all-features will be a compile error because of the lines directly above this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not trying to be difficult, just want to understand and I'm kind of dumb at the moment.

Copy link
Member Author

@xStrom xStrom Nov 22, 2024

Choose a reason for hiding this comment

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

No it won't be a compiler error. Our custom compiler error will trigger only when neither std nor libm is specified. At least one of those needs to be set. You can achieve that error with just --no-default-features.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am so brain dead right now. Going to sleep in shame and infamy.

clippy.toml Outdated Show resolved Hide resolved
@xStrom xStrom added this pull request to the merge queue Nov 22, 2024
Merged via the queue into linebender:main with commit b4ab670 Nov 22, 2024
15 checks passed
@xStrom xStrom deleted the lintv2 branch November 22, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants