-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 bad placeholder type error on certain consts and statics #77431
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
fn foo() -> _ { 5 } //~ ERROR E0121 | ||
|
||
static BAR: _ = "test"; //~ ERROR E0121 | ||
//~^ ERROR E0121 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a duplicate error now, but as this is a pre-existing issue (#77428), and this fixes an ICE that could reasonably be encountered by users, I thought a quick fix was best. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this triggers quite a few more additional error messages in other places; it'd be nicer to fix this now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @estebank: I thought we deduplicated diagnostics? Do you know the reason it's failing in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't deduplicate automatically at the error level, we do it on a case by case basis ahead of time. For I remember having to tweak the logic a bit to have correct coverage (the Edit: Oh! I see, this only happens for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What do you mean by this? |
||
|
||
fn main() { | ||
} | ||
const FOO: dyn Fn() -> _ = ""; //~ ERROR E0121 | ||
|
||
static BOO: dyn Fn() -> _ = ""; //~ ERROR E0121 | ||
|
||
fn main() {} |
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.
Wait... what happens if you remove this call? I'm pretty sure that using
PlaceholderHirTyCollector
it will make the call when encountering the_
as expected.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.
Oh, let me try…
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.
Unfortunately, it has no effect, and the test continues to ICE.