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

Fix: must_use on traits has no effect and causes CI to fail #946

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

z-tech
Copy link
Contributor

@z-tech z-tech commented Feb 27, 2025

Fix: must_use on traits has no effect and causes CI to fail

As of Rust 1.87.0-nightly, #[must_use] on provided trait methods triggers a warning, which becomes an error under cargo check with -D warnings, breaking CI.

Since it had no effect to begin with I think it's safe to remove and we need to do this to resolve CI werrors.


  • Targeted PR against correct branch (master)
  • [N/A ] Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • [N/A ] Wrote unit tests
  • [N/A ] Updated relevant documentation in the code
  • [N/A] Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • [N/A] Re-reviewed Files changed in the GitHub PR explorer

@z-tech z-tech requested review from a team as code owners February 27, 2025 18:52
@z-tech z-tech requested review from Pratyush, mmagician and weikengchen and removed request for a team February 27, 2025 18:52
@z-tech z-tech mentioned this pull request Feb 27, 2025
6 tasks
@@ -570,7 +570,6 @@ impl<P: QuadExtConfig> From<bool> for QuadExtField<P> {
impl<P: QuadExtConfig> Neg for QuadExtField<P> {
type Output = Self;
#[inline]
#[must_use]
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to remove it from here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Running this from the CI on 1.87.0-nightly, RUSTFLAGS="-D warnings" cargo check --all-features --examples --workspace --benches gives:

error: #[must_use] has no effect when applied to a provided trait method
--> ff/src/fields/models/quadratic_extension.rs:573:5
|
573 | #[must_use]
| ^^^^^^^^^^^

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