-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Bug with trait inheritance and trait objects #9394
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
I have solved this bug, here is patch:
|
Hmmm, seems that I cannot post it here ;) |
I edited some backticks into your comment so we could see the diff a little better, but feel free to open a pull request! It tends to be easier to review the patch in a pull request than on a bug report... |
https://gist.github.com/bmaxa/6680566 I have posted to gist , don't know how to make pull request ;) |
Done ;) url for git is https://github.com/bmaxa/changes_and_fixes/tree/fixes |
@bmaxa You need to actually open an Pull Request. |
Heh I made pull request to my repository, didn't knew I have to fork first then compare with mozilla/rust |
This solves problem of incorrect indexing into vtable when method from super trait was called through pointer to derived trait. Problem was that offset of super trait vtables was not calculated at all. Now it works, correct offset is calculated by traversing all super traits up to super trait where method belongs. That is how it is intended to work.
Triage: This was fixed in a8a69ec (contains a regression test) |
Fix missing parens in `suboptimal_flops` suggestion Fixes rust-lang#9391. The problem is simple enough, I didn't check if the same problem occurs elsewhere, though. changelog: fix missing parenthesis in `suboptimal_flops` suggestion
If you try to call an inherited method on an trait object, it instead calls a regular method of the trait itself, or potentially crashes if the signatures don't match.
Test case:
The text was updated successfully, but these errors were encountered: