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 warnings from Rust 1.80.0 nightly #3074

Merged

Conversation

sivadeilra
Copy link
Collaborator

CI jobs are failing because Rust nightly tools have added new warnings. This PR fixes all warnings as of nightly 2024-06-04.

@sivadeilra sivadeilra marked this pull request as draft June 6, 2024 02:39
@ChrisDenton
Copy link
Collaborator

ChrisDenton commented Jun 6, 2024

The change here is that size_of and align_of have now been added to the prelude rust-lang/rust#123168

@ChrisDenton
Copy link
Collaborator

I think the correct fix would be to also add use std::mem::{align_of, size_of}; to the top of the module until the library's MSRV is 1.80 or greater.

@kennykerr
Copy link
Collaborator

kennykerr commented Jun 6, 2024

This is pretty unpleasant.

I also wonder - when the MSRV is finally caught up - whether it will be smart enough to tell us that we don't need the use imports any longer.

@sivadeilra
Copy link
Collaborator Author

Yeah, I agree. I think the combination of align_of and size_of being moved into the prelude and the new qualified name warning are making things worse, not better.

It might be best to just add -Aunused-qualifications to the clippy action, for now.

I really want to get other PRs unblocked, though, so this is kind of urgent.

@ChrisDenton
Copy link
Collaborator

ChrisDenton commented Jun 6, 2024

Looking at the lint's implementation, it seems there's a special carve out for explicitly global use, e.g. ::std::mem::size_of (that is prefixed by ::). So that should work.

Or, yes, allowing the lint.

@kennykerr
Copy link
Collaborator

I recently had to remove all the global :: due to another lint. #2911

@kennykerr
Copy link
Collaborator

Let's just allow the lint and keep changes to a minimum please.

@sivadeilra sivadeilra force-pushed the user/ardavis/fix-nightly-warnings branch from af9a466 to f66dfb6 Compare June 6, 2024 17:26
@ChrisDenton
Copy link
Collaborator

It should be as simple as removing it from here:

unused_qualifications = "warn"

@sivadeilra sivadeilra force-pushed the user/ardavis/fix-nightly-warnings branch from f66dfb6 to 855acb4 Compare June 6, 2024 17:34
@sivadeilra sivadeilra marked this pull request as ready for review June 6, 2024 17:58
Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

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

Thanks Arlie!

@kennykerr kennykerr merged commit a623c3f into microsoft:master Jun 6, 2024
90 checks passed
@sivadeilra sivadeilra deleted the user/ardavis/fix-nightly-warnings branch June 6, 2024 18:08
mati865 pushed a commit to mati865/windows-rs that referenced this pull request Jun 15, 2024
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.

rustc nightly (2024-06-06+) flags unused-qualifications in a way that is not backward compatible
4 participants