You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During codegen we were handling `dyn T` the same way as `&dyn T` which
was causing a bunch of type mismatch warnings.
To fix that, I first changed how we encode trait fat pointers. We
used to encode them as:
```
struct RefToTrait {
void* data;
Tag* vtable;
}
```
But now we encode them as:
```
struct RefToTrait {
T* data; // This is a typedef to void*.
Tag* vtable;
}
```
Then I modified encoding `dyn T` to codegen a thin pointer `T*`. I had
also to modify places where we were forcing `void*` to be the type of
the `data` field.
* Fix vtable restriction after `dyn T` refactoring.
The vtable restriction code was relying on the fact that `dyn T` and
`&dyn T` were generating the same gotoc expression. Instead, we now
ensure that we pass the fat pointer type to the function that creates
the vtable call site.
* Fix Rc<dyn> and add a bunch of debug stuff.
I'm still seeing tons of type mismatch on std crate and unable to find
vtable warnings.
* Add testcase for issue-990
* Clean up code for PR
* Codegen unimplemented for dropping unsized struct
We were incorrectly handling them. I'm mitigation this issue for now and
I created a testcase.
Note: Without this mitigation but with the fix to fat
pointers not using void*, this was failing codegen of firecracker.
* Replace bool by Unit
* PR comments + better tests
* Add assertion and improve comments
0 commit comments