Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upfulfillment error involving quickcheck `Testable` trait on `fn` types (and tuples?) #34503
Comments
This comment has been minimized.
This comment has been minimized.
|
The ICE here goes away if I add derived of I need to double-check if this the actually the same ICE that plagues #33723. |
This comment has been minimized.
This comment has been minimized.
|
(of course, AFAICT there is no reason that we should be requiring the |
This comment has been minimized.
This comment has been minimized.
|
I'm going to copy over the labels from #33723 since this is at least as high priority as that bug is. |
This comment has been minimized.
This comment has been minimized.
|
cc @pnkfelix @rust-lang/compiler There's a release next week. Is there any hope of fixing this? |
This comment has been minimized.
This comment has been minimized.
|
Current investigation results:
I don't myself know the direct way to disable item collection; I looked into it briefly but it was not obvious what parts were safe to "switch off." I hope @michaelwoerister can look at that in time for the release. |
This comment has been minimized.
This comment has been minimized.
|
As I explained on IRC, the trans item collector looks correct, and if it weren't there, building the vtable itself would fail for the same reason: |
michaelwoerister
referenced this issue
Jun 30, 2016
Merged
Drive trans from the output of the translation item collector #33890
This comment has been minimized.
This comment has been minimized.
So, I have disabled the collector on a local branch and the compiler does not crash then. Maybe trans takes additional measures to filter out methods when building vtables. |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister That's odd, the code looks identical. But maybe I wasn't looking in the right place. |
This comment has been minimized.
This comment has been minimized.
|
Maybe it calls |
This comment has been minimized.
This comment has been minimized.
|
Hm, it seems that cannot reproduce the issue at all (with or without collector) with the current HEAD of master. Is it possible that this is fixed already? With the latest nightly from rustup (ad7fe65 2016-06-23) it does crash. |
This comment has been minimized.
This comment has been minimized.
|
This was fixed between |
This comment has been minimized.
This comment has been minimized.
|
(I can't believe I forgot to update my copy of master before I spent yesterday afternoon investigating...) Thanks @arielb1 for narrowing it down! I did further bisection this morning, and determined it was introduced between The one that no longer ICE's is the merge of #34419 In hindsight, its clear why #34419 fixes this this case: (My suspicion is that we should be able to come up with a similar bit of code that exposes the old ICE that I was investigating. But in the meantime, my recommendation is that we beta-nominate #34419 since that seems like a really safe PR to backport to beta.) |
This comment has been minimized.
This comment has been minimized.
|
Yes I have managed to make a new test case that continues to expose the bug: https://play.rust-lang.org/?gist=9398442e3b7aaeb387e5b3630fd0c8d3&version=nightly&backtrace=0 I'll update the description to use this variant instead. (I know the playpen is using a version of nightly that predates #34419; I verified this against a local build of @michaelwoerister could you look into how your item-collection-disabled branch behaves against the above gist of code? |
This comment has been minimized.
This comment has been minimized.
|
(Note @eddyb has predicted that trans itself will fail during vtable construction even if item-collection were disabled; nonetheless, its worth verifying that prediction.) |
This comment has been minimized.
This comment has been minimized.
|
@pnkfelix Disabling the collector makes the ICE go away. Things do not fail later during vtable construction. Which is interesting, since the code really looks very similar. EDIT: Note that the above applies to the updated version of the code under test. |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister On IRC @arielb1 said he'd found the bug in the obligation "forest" handling of nested obligations which have already failed and that he's working on a fix. |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister Maybe without the collector the obligation that poisons the cache is never tested? |
This comment has been minimized.
This comment has been minimized.
Oh, so this would be a mutable state problem? I know little about how obligation caches work (I should probably start learning more about that part of the compiler). |
This comment has been minimized.
This comment has been minimized.
|
Just FYI, if you want to test with the collector disabled: It suffices to replace the body |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister The cache is global with a simple check that the obligation has no inference variables. Once that mistakenly successful |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister Intuitively constructed reproduction: https://play.rust-lang.org/?gist=95f6ad7e16621d718490d4f81e8eec23&version=nightly&backtrace=0. You can try to add things that would fail but cause some sub-obligations to succeed, like duplicating the |
pnkfelix commentedJun 27, 2016
•
edited
spawned off of #33723
This code (playpen) causes an ICE in the beta and nightly compilers:
here is the compiler ICE message:
(What follows is the original reduced test case, which stopped ICE'ing recently due to an unrelated bug fix, which prompted me to write the above revision of the code to continue demonstrating the bug in question.)
Old Description
This is the ICE in question: