Uh oh!
There was an error while loading. Please reload this page.
Update orphan and overlap rules for RFC 1023 - #23867
Conversation
rust-highfive
commented
Mar 30, 2015
(rust_highfive has picked a reviewer for you, use r? to override) |
nikomatsakis
commented
Mar 30, 2015
The integration of coherence checking into trait matching is a bit less clean than I would like -- it preserves the existing "intercrate mode". I'd like to rework select to remove that mode and instead consider that an impl like |
nikomatsakis
commented
Mar 30, 2015
Ah, and I just remembered a potential bug around subtyping in the way that I implemented the orphan check. I'll patch that. But it shouldn't really affect much, so I'll leave the PR open to use for reference while considering rust-lang/rfcs#1023. |
nikomatsakis
commented
Apr 1, 2015
r? @pnkfelix Since we will remove variance for trait matching, that complication is resolved the easy way. My concern was that the overlap checking wasn't checking all 4 combinations that seem to be necessary with variance (that is, instantiate impl A with skolemized parameters, then check whether A <: B or B <: A, and vice versa). But with invariance you need only check whether A = B, which is reflexive. |
6f214c6 to
1451d80Comparepnkfelix
commented
Apr 1, 2015
Okay, I left some notes, but its all truly minor nits that I only recommend you do if you already are rebasing this PR for some other reason. So r+ from me. |
pnkfelix
commented
Apr 1, 2015
@bors r+ 6ba9692 |
6ba9692 to
67abce2Comparenikomatsakis
commented
Apr 1, 2015
Addressed nits. |
nikomatsakis
commented
Apr 1, 2015
@bors r=pnkfelix 67abce2 |
bors
commented
Apr 1, 2015
☔ The latest upstream changes (presumably #23936) made this pull request unmergeable. Please resolve the merge conflicts. |
local only if matches `FUNDAMENTAL(LocalType)`, where `FUNDAMENTAL` includes `&T` and types marked as fundamental (which includes `Box`). Also apply these tests to negative reasoning.
`Fn` traits are considered fundamental, along with `Box` (though that is mostly for show; the real type is `~T` in the compiler).
probing the specifics of `Fundamental`. Fixesrust-lang#23086. Fixesrust-lang#23516.
since `Option` is not fundamental and hence the old impls run afoul of the orphan rules.
67abce2 to
15b58feComparenikomatsakis
commented
Apr 1, 2015
…pnkfelix This PR implements rust-lang/rfcs#1023. In the process it fixesrust-lang#23086 and rust-lang#23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence. I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable). Fixesrust-lang#23918.
sidesteps a coherence difficulty where `liballoc` had to prove that `&str: !Error`, which didn't involve any local types.
nikomatsakis
commented
Apr 1, 2015
This PR implements rust-lang/rfcs#1023. In the process it fixesrust-lang#23086 and rust-lang#23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence. I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable). Fixesrust-lang#23918.
bors
commented
Apr 2, 2015
⌛ Testing commit 19d3dab with merge 2b42de0... |
bluss
commented
Apr 2, 2015
This should have been marked breaking-change? |
tbu-
commented
Apr 3, 2015
Yup. Broke something for rust-ascii. |
This PR implements rust-lang/rfcs#1023. In the process it fixes#23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence.
I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable).
Fixes#23918.