-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Check that all hidden types are the same and then deduplicate them. #95731
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
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.
r=me with or without comment addressed
// once we convert the generic parameters to those of the opaque type. | ||
if let Some(prev) = result.get_mut(&opaque_type_key) { | ||
if prev.ty != ty { | ||
let mut err = infcx.tcx.sess.struct_span_err( |
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.
Is this an error that we can trigger from code? If so, could you add a unit test (if it's easy to reproduce)?
Otherwise, maybe we can bug (or delay a bug) here instead if it should never happen.
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.
It should with type-alias-impl-trait, but due to a funky bug it never happens in practice. I'll prep a second PR that we won't backport that does this.
Until then, I'll leave in this error just so in case I'm wrong, we get an error instead of an ICE on beta.
@bors r=compiler-errors |
📌 Commit 27dc503 has been approved by |
…piler-errors Check that all hidden types are the same and then deduplicate them. fixes rust-lang#95538 This used to trigger a sanity check. Now we accept that there may be multiple places where a hidden type is constrained and we merge all of these at the end. Ideally we'd merge eagerly, but that is a larger refactoring that I don't want to put into a backport
Rollup of 6 pull requests Successful merges: - rust-lang#95342 (Ignore "format the world" commit in git blame) - rust-lang#95353 ([bootstrap] Give a hard error when filtering tests for a file that does not exist) - rust-lang#95649 (New mir-opt deref_separator) - rust-lang#95721 (Fix typo in bootstrap/setup.rs) - rust-lang#95730 (Rename RWLock to RwLock in std::sys.) - rust-lang#95731 (Check that all hidden types are the same and then deduplicate them.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Beta backport decision postponed to next week, this patch was merged just a few hours ago, so there are not yet perf results to look at. |
…ulacrum [beta] backports rollup * Remove NodeIdHashingMode. rust-lang#95656 * Check that all hidden types are the same and then deduplicate them. rust-lang#95731 r? `@Mark-Simulacrum`
fixes #95538
This used to trigger a sanity check. Now we accept that there may be multiple places where a hidden type is constrained and we merge all of these at the end.
Ideally we'd merge eagerly, but that is a larger refactoring that I don't want to put into a backport