Check that all hidden types are the same and then deduplicate them.#95731
Check that all hidden types are the same and then deduplicate them.#95731bors merged 1 commit intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
compiler-errors
left a comment
There was a problem hiding this comment.
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.
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.
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