Use call_site hygiene to avoid unused qualification#7866
Merged
Darksonn merged 2 commits intotokio-rs:masterfrom Jan 22, 2026
Merged
Use call_site hygiene to avoid unused qualification#7866Darksonn merged 2 commits intotokio-rs:masterfrom
Darksonn merged 2 commits intotokio-rs:masterfrom
Conversation
3cea2f7 to
85ae3ea
Compare
Member
|
It sounds like the output is still incorrect. Am I mistaken? What is the output prior to this change? |
Contributor
Author
The above output have two parts, base is the output prior to this change: The new is the output after this change: |
Member
|
Ah, so the error went away. That's great. Could we test this under tests-build? |
Contributor
Author
Yes, I have added one. |
Darksonn
reviewed
Jan 21, 2026
85ae3ea to
a2c7801
Compare
taiki-e
approved these changes
Jan 22, 2026
Contributor
|
Awesome, thanks! |
This was referenced Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Previous attempt: #7777
More context: rust-lang/rust#149873
Direct using user's span here will lead to unexpected warning of unused qualification for user code.
Solution
As @taiki-e suggests (rust-lang/rust#149873 (comment)), use
Span::call_sitehygiene here to help the lint can useSpan::from_expansionto check it.Have tested this solution in https://github.com/mu001999-contrib/tokio-unexpected-warning, the output is:
The difference is that the new crate uses the dependency
tokio = { git = "https://github.com/mu001999-contrib/tokio", branch = "fix/use-callsite-span", features = ["full"] }