-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fulfillment error involving quickcheck Testable
trait on fn
types (and tuples?)
#34503
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
Comments
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. |
(of course, AFAICT there is no reason that we should be requiring the |
I'm going to copy over the labels from #33723 since this is at least as high priority as that bug is. |
cc @pnkfelix @rust-lang/compiler There's a release next week. Is there any hope of fixing this? |
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. |
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: |
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. |
@michaelwoerister That's odd, the code looks identical. But maybe I wasn't looking in the right place. |
Maybe it calls |
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 was fixed between |
(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.) |
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? |
(Note @eddyb has predicted that trans itself will fail during vtable construction even if item-collection were disabled; nonetheless, its worth verifying that prediction.) |
@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. |
@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. |
@michaelwoerister Maybe without the collector the obligation that poisons the cache is never tested? |
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). |
Just FYI, if you want to test with the collector disabled: It suffices to replace the body |
@michaelwoerister The cache is global with a simple check that the obligation has no inference variables. Once that mistakenly successful |
@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 |
Fix a bug where an obligation that depend on an erroring obligation would be regarded as successful, leading to global cache pollution and random lossage. Fixes rust-lang#33723. Fixes rust-lang#34503.
fail obligations that depend on erroring obligations Fix a bug where an obligation that depend on an erroring obligation would be regarded as successful, leading to global cache pollution and random lossage. Fixes #33723. Fixes #34503. r? @eddyb since @nikomatsakis is on vacation beta-nominating because of the massive lossage potential (e.g. with `Copy` this could lead to random memory leaks), plus this is a regression.
Fix a bug where an obligation that depend on an erroring obligation would be regarded as successful, leading to global cache pollution and random lossage. Fixes rust-lang#33723. Fixes rust-lang#34503.
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:
The text was updated successfully, but these errors were encountered: