-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Use new mem::uninitialized API #806
Conversation
An example of the result: gtk-rs/pango#155 |
See comments there, invalid usage of |
More like lazy usage but yes. ;) I'll update the PR later on. |
Not lazy, it's undefined behaviour just like with |
I wanted to mean that my implementation was lazy. :) |
Oh that's possible :) Changing the code generator to use |
c664d93
to
3599ded
Compare
This is finally done. T_T |
src/codegen/function_body_chunk.rs
Outdated
.map(|param| { | ||
let kind = type_mem_mode(env, param); | ||
; | ||
(param, kind) |
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.
Unneeded debug change?
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.
Indeed, good catch.
414a3ef
to
25028ca
Compare
Thanks, look good for me, it still need |
src/codegen/translate_from_glib.rs
Outdated
if name == "error" { | ||
format!(", {} as usize", name) | ||
} else { | ||
format!(", {{ let {0} = {0}.assume_init(); {0} as usize }})", name) |
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.
Seems this can be just format!(", {}.assume_init() as usize)", name)
without "error" branch
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.
@GuillaumeGomez If you don't want this one-liner, please, merge this PR yourself.
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.
Oh, error branch still needed.
Can you tell me which function?
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.
I updated it to a one-liner. However, I don't understand your last comment. What error?
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.
I meant branch if name == "error"
, I suspect that it never reached:
note that it not ends with ')',
and I updated it to produce bad code, but gtk-rs crates still builds fine after regen.
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.
I'll remove this check and see the result.
Can you regenerate the pango PR so we can also check the results? :) |
25028ca
to
564fd26
Compare
564fd26
to
3cffab8
Compare
3cffab8
to
d2c0909
Compare
@EPashkin You were right: the condition was completely useless so I removed it. |
@GuillaumeGomez Thanks |
I'll send the PRs soon then! |
Fixes #770.
cc @sdroege @EPashkin