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 removal span calculation of unused_qualifications suggestion #113811

Merged

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jul 18, 2023

Given a path such as std::ops::Index<str>, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect.

Closes #113808.

@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 18, 2023
@jieyouxu jieyouxu force-pushed the fix-unused-qualifications-suggestion branch from 00fd820 to 4603cf3 Compare July 18, 2023 01:20
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the fix-unused-qualifications-suggestion branch from 4603cf3 to 33bd453 Compare July 18, 2023 01:52
@oli-obk
Copy link
Contributor

oli-obk commented Jul 18, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 18, 2023

📌 Commit 33bd453 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 18, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 18, 2023
…-suggestion, r=oli-obk

Fix removal span calculation of `unused_qualifications` suggestion

Given a path such as `std::ops::Index<str>`, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect.

Closes rust-lang#113808.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 18, 2023
…-suggestion, r=oli-obk

Fix removal span calculation of `unused_qualifications` suggestion

Given a path such as `std::ops::Index<str>`, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect.

Closes rust-lang#113808.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 18, 2023
…-suggestion, r=oli-obk

Fix removal span calculation of `unused_qualifications` suggestion

Given a path such as `std::ops::Index<str>`, calculate the unnecessary qualification removal span by computing the beginning of the entire span until the ident span of the last path segment, which handles generic arguments and lifetime arguments in the last path segment. Previous logic only kept the ident span of the last path segment which is incorrect.

Closes rust-lang#113808.
@bors
Copy link
Contributor

bors commented Jul 18, 2023

⌛ Testing commit 33bd453 with merge 64901c00f1cb8ffa8340129649f60bb0f680f50c...

@bors
Copy link
Contributor

bors commented Jul 18, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 18, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#113811 (Fix removal span calculation of `unused_qualifications` suggestion)
 - rust-lang#113812 (docs(release): Remove nightly-only cargo item)
 - rust-lang#113823 (Fix results search alias display)
 - rust-lang#113824 (a small `fn needs_drop` refactor)
 - rust-lang#113828 (Ping spastorino on changes to SMIR)
 - rust-lang#113832 (Add `#[track_caller]` to lint related diagnostic functions)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job dist-aarch64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors bors merged commit 931d9f0 into rust-lang:master Jul 18, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 18, 2023
@jieyouxu jieyouxu deleted the fix-unused-qualifications-suggestion branch December 20, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unused_qualification removes generic params
5 participants