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 more lints #4598

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Add more lints #4598

merged 1 commit into from
Nov 17, 2023

Conversation

daxpedda
Copy link
Contributor

@daxpedda daxpedda commented Oct 27, 2023

In #4597 I stumbled on a couple of Surfaces where I forgot to apply 'static, which reminded me of elided-lifetimes-in-paths. I used it to make sure I didn't miss any others.

I'm not sure if this is desired at all, but thought I would make a PR so maintainers can take a look.
I could also add the whole rust-2018-idioms group if that's desirable, it's pretty simply with cargo fix.

Requires #4597, but I'm happy to rebase it to trunk if it helps.

@kpreid
Copy link
Contributor

kpreid commented Oct 28, 2023

I could easily add more lints like …

rust-2018-compatibility and rust-2021-compatibility aren't relevant in code that is already in the 2021 edition.

@daxpedda
Copy link
Contributor Author

I could easily add more lints like …

rust-2018-compatibility and rust-2021-compatibility aren't relevant in code that is already in the 2021 edition.

Aye, that makes sense.
I'm wondering why absolute-paths-not-starting-with-crate is in rust-2018-compatibility then ... that still seems useful to me in any edition. But it's the only relevant lint I could find.

@kpreid
Copy link
Contributor

kpreid commented Oct 28, 2023

I'm wondering why absolute-paths-not-starting-with-crate is in rust-2018-compatibility then ... that still seems useful to me in any edition. But it's the only relevant lint I could find.

That one's not enabled because, past the 2015 edition, such paths don't even work; the semantics were changed in 2018 such that absolute paths may only refer to named crates, where they could previously refer to items declared in the current crate root. So, that lint only means anything in 2015 edition code.

All compatibility lints are about “this will mean something different, or be rejected, in the next edition”. So there is no reason to enable any of them once you are using later editions.

@daxpedda
Copy link
Contributor Author

Ah! Thanks @kpreid, much appreciated.

@daxpedda daxpedda marked this pull request as ready for review November 16, 2023 22:28
@daxpedda daxpedda requested a review from a team as a code owner November 16, 2023 22:28
@daxpedda
Copy link
Contributor Author

Just to clarify: my suggestion in OP now boils down to adding rust-2018-idioms only.

@cwfitzgerald
Copy link
Member

Yeah adding rust-2018 idioms seems good

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Requesting changes per above.

(Reminder: please re-request a review from me once the changes are addressed to make sure I see it!)

@daxpedda
Copy link
Contributor Author

Done.

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

We probably should add these to wgpu-core and hal as well, but let's wait till #3626 lands.

@cwfitzgerald cwfitzgerald merged commit 8859310 into gfx-rs:trunk Nov 17, 2023
27 checks passed
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048
vinnydiehl pushed a commit to vinnydiehl/mozilla-unified that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048

UltraBlame original commit: eb839abb42abde594497e419517260997fa1fc4d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048

UltraBlame original commit: eb839abb42abde594497e419517260997fa1fc4d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048

UltraBlame original commit: eb839abb42abde594497e419517260997fa1fc4d
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.

3 participants