-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix diag span errors for bad_placeholder #116511
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 diag span errors for bad_placeholder #116511
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
This should also fix #116473, right? |
no, seems the root cause is not same. |
949ee62
to
bb24706
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why this actually fixes the bug -- there's no information in this PR about the root cause or the fix.
| | ||
help: try replacing `_` with the type in the corresponding trait method signature | ||
| | ||
LL | {type error} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should fix this suggestion anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the help
diag you pointed out is another issue.
The root cause in the issue is we inserted duplicated span
into HirPlaceholderCollector
here:
self.0.push(t.span); |
in the scenario of code like:
macro_rules! m {
() => {
_ // This is the duplicated span ...
};
}
struct S<T = m!()>(m!(), T)
where
T: Trait<m!()>;
This PR is trying to remove the duplicated ones, since we're mapping spans with same type type_name
.
Maybe we need to use Set
instead of Vec
in HirPlaceholderCollector
? I'm not sure about it.
@chenyukang what's the status of this pr? thanks |
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
Fixes #116502