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 clippy::indexing_slicing to the list of ignored lints #120

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

cfcosta
Copy link
Contributor

@cfcosta cfcosta commented Sep 26, 2023

I am currently using valuable on a project that has most clippy lints enabled, and it is showing warnings because it uses direct array indexing to access the fields on the generated macro code. Unfortunately, there's no way to ignore it directly, as it gets "imported" to application code on macro expansion.

This PR adds clippy::indexing_slicing to the listing of ignored lints.

Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

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

Thanks.

It is usually a bug that clippy warns of code generated by external macros, and it also seems to be a bug that this lint is triggered for static slices and immediate indexes whose exact length is known at compile time, so I recommend you report the bug to clippy.

That said, it is very easy to work around this by ignoring it on our part, so adding a allow attribute is a reasonable action.

@cfcosta
Copy link
Contributor Author

cfcosta commented Sep 26, 2023

@taiki-e will do. Does anyone else needs approving this for it to be merged? The test failures seem completely unrelated.

@taiki-e
Copy link
Member

taiki-e commented Sep 26, 2023

CI failure will be fixed in #119. I will merge this once the CI fix is merged.

@taiki-e taiki-e merged commit 3222528 into tokio-rs:master Oct 8, 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.

2 participants