Allow opaque types in trait impl headers and rely on coherence to reject unsound cases#103488
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases#103488bors merged 10 commits intorust-lang:masterfrom
Conversation
lcnr
left a comment
There was a problem hiding this comment.
this is still unsound when equating two opaque types with the same DefId during coherence, similar to #102048. With the current setup that might be difficult to fix, though I might be wrong.
We can land this PR and then I can try to write an example and open an issue.
87bc33e to
a41f93a
Compare
There was a problem hiding this comment.
I'm not sure yet how to improve this diagnostic beyond looking at the entries in take_opaque_types() and doing some guessing for common cases.
a41f93a to
86dc770
Compare
|
☔ The latest upstream changes (presumably #103727) made this pull request unmergeable. Please resolve the merge conflicts. |
86dc770 to
4d7c724
Compare
This comment has been minimized.
This comment has been minimized.
4d7c724 to
b8a45f6
Compare
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
☔ The latest upstream changes (presumably #101834) made this pull request unmergeable. Please resolve the merge conflicts. |
b8a45f6 to
c67ec50
Compare
There was a problem hiding this comment.
that should be reachable when using generic const exprs when relating a const inference var (from a const param) with an unevaluated constant during coherence
This comment has been minimized.
This comment has been minimized.
5b9d06f to
1e768de
Compare
200226d to
8774fa8
Compare
…ect unsound cases
|
☔ The latest upstream changes (presumably #103491) made this pull request unmergeable. Please resolve the merge conflicts. |
…lally allow trait resolution to prove false things during coherence
8774fa8 to
603a83b
Compare
603a83b to
c16a90f
Compare
|
|
||
| // Ok because `i32` does not implement `Dummy`, | ||
| // so it can't possibly be the hidden type of `F`. | ||
| impl Test for i32 { |
There was a problem hiding this comment.
when coherence is checking whether F conflicts with i32 we register i32 as the hidden type of F and that fails because i32: !Dummy but F = impl Dummy.
|
@bors r=lcnr |
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? `@lcnr` fixes rust-lang#99840
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ``@lcnr`` fixes rust-lang#99840
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ```@lcnr``` fixes rust-lang#99840
…earth Rollup of 6 pull requests Successful merges: - rust-lang#103488 (Allow opaque types in trait impl headers and rely on coherence to reject unsound cases) - rust-lang#104359 (Refactor must_use lint into two parts) - rust-lang#104612 (Lower return type outside async block creation) - rust-lang#104621 (Fix --extern library finding errors) - rust-lang#104647 (enable fuzzy_provenance_casts lint in liballoc and libstd) - rust-lang#104750 (Bump `fd-lock` in `bootstrap` again) Failed merges: - rust-lang#104732 (Refactor `ty::ClosureKind` related stuff) r? `@ghost` `@rustbot` modify labels: rollup
|
This PR was a perf regression (see the report here #104758 (comment)). It's relatively small and mostly limited to secondary workloads so I'm marking as triaged. |
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes rust-lang#99840
r? @lcnr
fixes #99840