-
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
remove intercrate ambiguity hints #47738
Conversation
er, oops -- let me add a test! |
I actually have to figure out how to formulate one. The test I have which reproduces diesel's problem isn't, I think, affected by this change. |
(Also, the problem was sort of order dependent, but I might be able to fix that.) |
r=me |
ok, added a test that fails on beta/nightly and which I believe is representative of the diesel error |
@bors r+ p=1 -- important to get diesel up and going again |
📌 Commit cb4aa5f has been approved by |
@nikomatsakis oh bad 😞 Anyway I'm interested in both refactoring trait selection and reintroducing the hints. It may take time for me to remember things around trait selection though... |
For reference: the PR that introduced the hints is #43426 |
@bors r- // travis failures, will investigate |
I can't say I like this fix - this regresses from beta because it removes the coherence problem detection feature. Maybe we should just disable intercrate ambiguity hints "initially", and then call trait selection again with them enabled only if there was a coherence error. That's it, add a That way the error detection code will not be called unless there is an actual coherence error, in which case we don't care as much if there is an overflow. |
It is a brute force fix, that's true. Doing it in two passes is a decent idea. |
I'll review with the two-pass thing |
I did the two-pass change but for .. some reason I do not know I am not getting the full range of hints yet. I'll debug in a bit, but pushing intermediate status. |
4f6f7d4
to
915014c
Compare
A squash would be nice. |
The missing errors might be caused by the infcx The reason this worked before is because intercrate mode only uses the per-infcx evaluation cache: rust/src/librustc/traits/select.rs Lines 1249 to 1277 in 6b99ade
And coherence uses a fresh inference context for each overlap check, starting with an empty evaluation cache: To fix this, I think the best way would be to create a fresh inference context for the "error reporting" check. |
2035f63
to
25c5899
Compare
@arielb1 ok, cleaned up, take a look -- running full tests now but seems to work |
25c5899
to
dce6473
Compare
⌛ Testing commit 2fc5739 with merge fb4d05e0e9c83a68626168b86e0fd26fc3aa736d... |
💔 Test failed - status-appveyor |
⌛ Testing commit 2fc5739 with merge 20d027e9d7d9d50f1eb257fa38c4a2b7dd0cd4ee... |
💔 Test failed - status-appveyor |
I can confirm that this PR fixes Diesel's build |
It doesn't look like bors recognized the retry request |
⌛ Testing commit 2fc5739 with merge 60e2baaa825fc13e1d1f764e32348ee6af7d3314... |
💔 Test failed - status-travis |
https://travis-ci.org/rust-lang/rust/jobs/335887927#L1 ... spurious? |
@bors retry |
remove intercrate ambiguity hints The scheme was causing overflows during coherence checking (e.g. #47139). This is sort of a temporary fix; the proper fix I think involves reworking trait selection in deeper ways. cc @sgrif -- this *should* fix diesel cc @qnighy -- I'd like to discuss you with alternative techniques for achieving the same end. =) Actually, it might be good to put some energy into refactoring traits first. r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
Backport 47738 to beta Backport of #47738 to beta branch.
The scheme was causing overflows during coherence checking (e.g. #47139). This is sort of a temporary fix; the proper fix I think involves reworking trait selection in deeper ways.
cc @sgrif -- this should fix diesel
cc @qnighy -- I'd like to discuss you with alternative techniques for achieving the same end. =) Actually, it might be good to put some energy into refactoring traits first.
r? @eddyb