-
Notifications
You must be signed in to change notification settings - Fork 26
Translate dyn Trait method shims
#814
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
Conversation
0823773 to
4d86339
Compare
charon/src/bin/charon-driver/translate/translate_trait_objects.rs
Outdated
Show resolved
Hide resolved
charon/src/bin/charon-driver/translate/translate_trait_objects.rs
Outdated
Show resolved
Hide resolved
charon/src/bin/charon-driver/translate/translate_trait_objects.rs
Outdated
Show resolved
Hide resolved
Nadrieril
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks pretty good, ty! Marking it as draft while you address the comments.
c4493e1 to
ee928ae
Compare
|
Fixed the |
|
I renamed |
|
OK, I will try to implement it. |
|
OK, updated. |
a5662db to
cda7046
Compare
|
Sorry I just created merge conflicts for you again |
Co-authored-by: ssyram <liguany126@126.com>
Co-authored-by: ssyram <liguany126@126.com>
Co-authored-by: ssyram <liguany126@126.com>
06a7b80 to
e84b41e
Compare
Co-authored-by: ssyram <liguany126@126.com>
e84b41e to
b51c1fc
Compare
This PR is split from #762 . It contains the part of the implementation for supporting vtable instances. For each concrete casting from
&Tto&dyn Trait, a globalstatic {impl Trait for T}::{vtable}will be generated, which initialises the method fields with the method shims --- notably, when one calls amethodfrom&dyn Trait, the receiver is&dyn Traitinstead of the concrete type&T. This requires a bridging method that uses aConcretizecast to cast back from&dyn Traitto&Tand then call the correctmethodwithin the user-definedimpl Trait for T.Note that this PR does not handle the virtual implementations, e.g., closures --- there is no explicit
impl Fn for CLOSUREthat is defined by the user. This will be fixed in the up-coming PR split from #762 .Also, in this PR, the metadata fields of the vtable instances, i.e., the
size,alignanddropfields are not translated and are currentlyOpaque. This will also be partly alleviated in the up-coming PR from #762 .ci: use AeneasVerif/aeneas#619
ci: use AeneasVerif/eurydice#294