-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Regression: overflow while adding drop-check rules #29844
Comments
Trait matching creates a region that is equated with our current region each time it runs, but our recursion-detection can't handle this. Annoying. I think we should have a unification system for regions to deal with this (ping @nikomatsakis). |
Hi, I discovered this regression as I was fiddling around with one of my projects, and therefore I'm pretty motivated to try and fix it as it currently prevents me from continuing. I took a look at where the error was reported inside @arielb1 the 'unification system for regions' sounds pretty complex, but if it is possible to explain the workings of that to a mere mortal like me then I'd be happy to do the 'plumbing' work on any implementation. Also I find I solve problems a lot by visualising the data etc, and I was wondering how you handle debugging. I've recently switched from 'managed' languages like Java and I really miss the complete runtime inspection capabilities of something like the IntelliJ idea debugger. Is it possible to use |
|
A unification system for regions isn't something I would want a beginner to do - either me or @nikomatsakis should do it. I do most of my rustc debugging by using the logs - |
@arielb1 yes, I've encountered this problem, but I am not sure what answer I prefer. A unification system for regions is one thing I considered, along with an alternate scheme for inferring substitutions. I had the latter up and working (I can't find the branch just now) but was dissatisfied with it in some ways that I don't remember now -- the main thing was that instead of creating fresh type variables for every impl parameter, it would first try to deduce the values for the type variables by looking at the trait reference. e.g., if we had |
I was also thinking of some kind of "trait IR" to speed up trait matching, but the full set of required operations requires some kind of unification, so we will not completely eliminate the problem. Maybe I should be working on region unification? |
triage: P-high This is a regression, so giving P-high, but given that the fix may involve changing some fundamental infrastructure we have to be a bit wary. |
out what types/regions we should use just by matching up the trait reference from the impl with the trait reference we need. Fixes rust-lang#29844.
@arielb1 I found that branch I was talking about (which required running https://github.com/nikomatsakis/rust/tree/dropck-infinite-recursion It does make this test case pass. I am running all tests now to see if the rest pass. I've only rebased the code but not deeply re-reviewed it. In particular, I don't remember what I didn't like about it. |
Looks like this will hit 1.5 stable tomorrow? |
Possibly worth considering a point release. |
Fixes #29844 I would prefer to (a) make some performance measurements (b) use the unification table in a few more places before committing further, but this is probably good enough for beta. r? @nikomatsakis
Thanks so much guys for being able to fix this. It is great to be part of a community that is willing to help others, and I realise now that I wouldn't have been able to fix it myself. |
Sorry for the mess. My patch got a little delayed, and then I had a cold (I'm better now). |
Our team should try to be better with things slipping than that, though. |
https://users.rust-lang.org/t/drop-check-regression-overflow-while-adding-drop-check-rules-for-struct/3617
playpen
gives the error
cc @pnkfelix
The text was updated successfully, but these errors were encountered: