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

Disallow compile warnings in CI #720

Merged
merged 2 commits into from Oct 2, 2023

Conversation

mightyiam
Copy link
Contributor

Co-authored-by: Shahar "Dawn" Or mightyiampresence@gmail.com

@mightyiam
Copy link
Contributor Author

I see that CI is waiting on approval from a maintainer. So we will explain ourselves. Our intention in this PR is to disallow compile warnings in the codebase. And, of course, to eventually "take care" of each existing warning. The reason that this draft PR currently only attempts to make CI fail on compile warnings and does not yet fix the individual warnings is that we wanted to see it fail, first.

The warnings are one of:

  • warning: a method with this name may be added to the standard library in the future
  • warning: use of deprecated method ...

In the cases of the former kind, we will use fully qualified paths to disambiguate, thereby eliminating the warning.

In the cases of the latter kind, we can place #[allow(deprecated)] to avoid the warnings. This would make sense, because the deprecated items are our own.

If maintainers agree with this intention of not having warnings in the codebase, consider allowing the CI run. And we will attempt to fix all warnings in reasonable ways.

@phimuemue
Copy link
Member

Hi there, thanks for this.

Do you happen to have the fix for the warnings at hand? If so, could you open a PR?

@mightyiam
Copy link
Contributor Author

@phimuemue sorry for taking so long. We do intend to work on this. @warren2k and I. If no one else intends to pick this up, we would appreciate the patience. Also, will our subsequent pull requests CI runs require approval or is it "first contribution"?

@mightyiam mightyiam marked this pull request as ready for review August 19, 2023 14:09
@mightyiam
Copy link
Contributor Author

@phimuemue ready!

@Philippe-Cholet
Copy link
Member

Philippe-Cholet commented Aug 20, 2023

I'm no maintainer here but I would surely appreciate to see no warning while experimenting on Itertools.

I'm not sure to understand why u32 is there in the first place, but why put it behind the "use_alloc" feature? Obviously only used in alloc context (Powerset).

@mightyiam mightyiam marked this pull request as draft August 20, 2023 13:10
@Philippe-Cholet
Copy link
Member

Philippe-Cholet commented Aug 26, 2023

Note that I just removed pow_scalar_base in 4671345 while updating Powerset.

@mightyiam
Copy link
Contributor Author

Oh, that's nice. Thank you for your work, @Philippe-Cholet. And thank you for letting us know. We're working on this in mob programming format. We've made progress today. It's not in this branch yet. Another session scheduled for tomorrow.

Hey, do you suppose we could get exempt from workflows needing approval, perhaps?

@Philippe-Cholet
Copy link
Member

I just wanted to let you know about the little upcoming conflict.
As a non-maintainer, I don't know about workflows approval. From what I understand, you need it (from a maintainer) in your first PR and I guess it's automatic in future PR.

@mightyiam
Copy link
Contributor Author

@phimuemue it seems done. Should work. So un-drafting. Please approve workflow.

@mightyiam mightyiam marked this pull request as ready for review August 27, 2023 13:40
@mightyiam mightyiam mentioned this pull request Aug 27, 2023
@mightyiam mightyiam marked this pull request as draft September 9, 2023 13:31
@mightyiam
Copy link
Contributor Author

Converted to draft because requires rebase.

@mightyiam mightyiam force-pushed the no_warn branch 2 times, most recently from 7c2a5df to d3adf4c Compare September 9, 2023 13:49
@mightyiam mightyiam marked this pull request as ready for review September 9, 2023 13:50
@mightyiam
Copy link
Contributor Author

Please approve workflow and review.

@mightyiam mightyiam marked this pull request as draft September 9, 2023 14:26
@mightyiam mightyiam marked this pull request as ready for review September 9, 2023 14:26
@mightyiam
Copy link
Contributor Author

All checks passed!

wrappers.rs Outdated
Comment on lines 1 to 3
//! This module helps suppress two kinds of warnings: `deprecated` and `unstable_name_collisions`.
//! New items are created that are noop-wrappers of the original items.
//! The items' original paths are preserved.
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer that we didn't create a top-level wrappers.rs file, and instead #[allow(deprecated, unstable_name_collisions)] as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a bit for you to consider, @jswrenn. Other than the sheer number of #[allow()]s, some of these warnings are in expressions that include multiple chained method calls. So the span of the #[allow()] is more than we intend. Feels clumsy to me.
Unless, of course, we extract the very call to which it is intended, which gets ugly immediately.

Call it and we'll do it.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should blanket-allow both deprecated and unstable_name_collisions.

For deprecated:

  • We don't care when it's our own deprecated methods.
  • We only take a dependency on one other crate, and I'm not particularly worried about it deprecating anything.
  • We don't really care when the standard library deprecates methods. It's rare, and the standard library doesn't ever remove deprecated methods.

For unstable_name_collisions: This is a non-actionable warning at this time. Until RFC 2845 is implemented, both itertools and the standard library is deadlocked on moving forward. We can't remove methods that trigger unstable_name_collisions without breaking our dependents, and the standard library can't stabilize unstable conflicting methods without breaking itertools dependants.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like you've thought it through. Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@warren2k
Copy link
Contributor

Rebased. Have yet to address the feedback.

@jswrenn
Copy link
Member

jswrenn commented Sep 20, 2023

I attempted to fix a merge conflict so I could merge this, but ultimately broke CI. I'm not sure why.

Could you roll back to 352bd2d, fix the merge conflict, and re-request my review?

@mightyiam
Copy link
Contributor Author

Sure. Likely this weekend.

warren2k and others added 2 commits September 30, 2023 20:17
Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
Co-authored-by: warren2k <846021+warren2k@users.noreply.github.com>
@warren2k
Copy link
Contributor

All checks have passed. We think this is ready for merge.

@mightyiam
Copy link
Contributor Author

Yes. Even though these two commits are included in #740 , they already provide value and so we'd love for them to be merged 😉 @jswrenn .

@jswrenn jswrenn added this pull request to the merge queue Oct 2, 2023
Merged via the queue into rust-itertools:master with commit f027c36 Oct 2, 2023
8 checks passed
@mightyiam mightyiam deleted the no_warn branch October 2, 2023 16:17
@jswrenn jswrenn mentioned this pull request Nov 14, 2023
@jswrenn jswrenn added this to the next milestone Nov 14, 2023
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.

None yet

5 participants