Skip to content

Remove dead_code paths #12743

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

CBSpeir
Copy link
Contributor

@CBSpeir CBSpeir commented May 1, 2024

The following paths are dead_code and can be removed:

clippy_utils::paths::VEC_RESIZE

clippy_utils::paths::SLICE_GET

clippy_utils::paths::STR_BYTES

When the lints were moved into the Methods lint pass, they switched from using paths to diagnostic items. However, the paths were never removed. This occurred in PR #8957.

This relates to issue #5393

changelog: none

This path is no longer used and can be removed.
@rustbot
Copy link
Collaborator

rustbot commented May 1, 2024

r? @y21

rustbot has assigned @y21.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 1, 2024
Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

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

Makes sense. A bit unfortunate that dead_code can't emit a warning here. Do you know if there are more unused paths or is this the only one?

@CBSpeir
Copy link
Contributor Author

CBSpeir commented May 1, 2024

I've been matching up the paths to the lints/code that use them. I made it through about half before I found VEC_RESIZE. I will continue checking the rest, and report back if I find any more dead_code.

If I find additional ones, should I add them as commits to this PR or create a new PR?

@y21
Copy link
Member

y21 commented May 1, 2024

Yeah, you can just add them here to this PR.

Both clippy_utils::paths::SLICE_GET and clippy_utils::paths::STR_BYTES
are dead_code and can therefore be removed.
@CBSpeir CBSpeir changed the title Remove clippy_utils::paths::VEC_RESIZE Remove dead_code paths May 2, 2024
@CBSpeir
Copy link
Contributor Author

CBSpeir commented May 2, 2024

In addition to VEC_RESIZE, both SLICE_GET and STR_BYTES were dead_code paths. I update the top comment to reflect this.

@y21
Copy link
Member

y21 commented May 2, 2024

Looks good. Thank you for taking the time to go through these!

@bors r+

@bors
Copy link
Contributor

bors commented May 2, 2024

📌 Commit 5e05821 has been approved by y21

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 2, 2024

⌛ Testing commit 5e05821 with merge c369183...

@bors
Copy link
Contributor

bors commented May 2, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: y21
Pushing c369183 to master...

@bors bors merged commit c369183 into rust-lang:master May 2, 2024
@CBSpeir CBSpeir deleted the remove-paths-vec_resize branch May 2, 2024 13:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants