-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Upgrade hoedown to 3.0.4 #27945
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
Upgrade hoedown to 3.0.4 #27945
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -68,49 +67,60 @@ const HOEDOWN_EXTENSIONS: libc::c_uint = | |||
type hoedown_document = libc::c_void; // this is opaque to us |
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.
while you're here, this should probably be an empty enum
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.
Isn't c_void basically an empty enum? I mean I guess it's represented in hardware by a u8
, but what does the difference make?
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 believe that c_void
is inhabitable; that is, you can create one
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.
The actual representation or whether this can be constructed isn't so much the problem here, but rather *mut hoedown_document
and *mut c_void
are the same types. In Rust it's more idiomatic to have those be separate types (to get at least some level of type safety). Creating an empty enum (enum hoedown_document {}
) should serve this purpose
Changed Adding any kind of type safety to the other void pointers is non-trivial because they point to different types in different passes. A lot of this module is very unsafe/hacky but hopefully we can replace it all with a pure rust Markdown parser at some point anyway! |
Some hoedown FFI changes: - `HOEDOWN_EXT_NO_INTRA_EMPHASIS` constant changed. - Updated/tidied up all callback function signatures. - All opaque data access has an additional layer of indirection for some reason (`hoedown_renderer_data`). This also fixes #27862.
Some hoedown FFI changes:
HOEDOWN_EXT_NO_INTRA_EMPHASIS
constant changed.hoedown_renderer_data
).This also fixes #27862.