-
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
ICE if generic destructor invokes a method on self ("vtables missing where they are needed") #4252
Comments
Bounds on struct params are no longer supported, so I had to edit a bit, but I still got it to ICE. Will check in the new test case, xfailed. Not critical for 0.6, though, de-milestoning. |
Still ICEs if I add |
Still ICEs on this updated test:
It fails because it doesn't have the vtables around... Interesting. |
Ah, so, destructors seem to be generated from a strange codepath such that they never get vtables. See |
I updated the title on this. |
accepted for production-ready milestone |
Will this be fixed some when or will it be impossible to write a generic destructor? |
The default buffer size is the same as the one in Java's BufferedWriter. We may want BufferedWriter to have a Drop impl that flushes, but that isn't possible right now due to rust-lang#4252/rust-lang#4430. This would be a bit awkward due to the possibility of the inner flush failing. For what it's worth, Java's BufferedReader doesn't have a flushing finalizer, but that may just be because Java's finalizer support is awful. Closes rust-lang#8953
The default buffer size is the same as the one in Java's BufferedWriter. We may want BufferedWriter to have a Drop impl that flushes, but that isn't possible right now due to #4252/#4430. This would be a bit awkward due to the possibility of the inner flush failing. For what it's worth, Java's BufferedReader doesn't have a flushing finalizer, but that may just be because Java's finalizer support is awful. The current implementation of BufferedStream is weird in my opinion, but it's what the discussion in #8953 settled on. I wrote a custom copy function since vec::copy_from doesn't optimize as well as I would like. Closes #8953
This bug is quite hard to fix. The |
…sucks, someone should look into it maybe
Its pretty hard to trace back from the ICE's that one gets to this cause. E.g. messages like this (see #8286): task 'rustc' failed at 'vtables missing where they are needed',
/Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libstd/option.rs:111 do not tell the user that they should revise the code of their destructor. (Admittedly, generic destructors are already unsafe ... but to me, We should either figure out a way to allow generic destructors to invoke methods on Nominating for 1.0, P-backcompat-lang. |
Definitely something we should resolve one way or another for 1.0, even if its just about getting the error message better (but ideally, since RAII is part of our story, we'd do better than that.) P-high |
This contains the fix for rust-lang#4252 so we can start using methods in destructors.
This contains the fix for #4252 so we can start using methods in destructors.
xyz.rs
:The text was updated successfully, but these errors were encountered: