Skip to content
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

Update to riddle and metadata generation #2510

Merged
merged 5 commits into from
May 18, 2023
Merged

Update to riddle and metadata generation #2510

merged 5 commits into from
May 18, 2023

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented May 18, 2023

Here's another update as I continue to work toward #1093.

Metadata generation requires a stricter metadata reader that more accurately captures type information in a lossless manner rather than just capturing what I happen to need for the windows crate. To that end, this update brings another batch of small improvements to the reader.

I have also switched the windows-metadata crate to use standalone code generation for its internal definitions to ease maintenance and improve clarity. Many numeric literals have been replaced by generated constants.

The standalone code generation functions will now assert if they can't find the requested type, constant, or function.

Finally, riddle and metadata generation still have a long way to go but this update is the first to support pretty rich metadata generation of both WinRT and Win32 metadata. It's not quite ready to kick the tires but it's getting close!

This update also deals with a few new warnings raised by the latest Rust toolchain updates.

@kennykerr kennykerr merged commit aaf3d0d into master May 18, 2023
@kennykerr kennykerr deleted the riddle2 branch May 18, 2023 20:36
pub type Result<T> = std::result::Result<T, Error>;

#[derive(Default, Debug)]
pub struct Error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::error::Error is not implemented for this type, are we supposed to convert it to std::io::Error (and loose the span info)?

This for example prevents using the ? operator to bubble the error up in an anyhow::Result chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants