Skip to content

Conversation

alexcrichton
Copy link
Member

  • Minor preparations for hopeful inclusion into libstd
  • Reexport the new bitflags feature

* Minor preparations for hopeful inclusion into libstd
* Reexport the new `bitflags` feature
@alexcrichton
Copy link
Member Author

Opening as a draft to test things before publishing a new wit-bindgen.

@alexcrichton
Copy link
Member Author

I've also included a monstrosity of a sed script for #112

sed -z -i 's/#\[unsafe(\n link_section = "\(.*\)"\n)\]/\
#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "\1-in-libstd"))]\
#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "\1"))]\
/' $file
Copy link
Member

Choose a reason for hiding this comment

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

Can you use wit-bindgen's --type-section-suffix flag to add the suffix?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh we actually already use it but the problem here is that it needs a different suffix depending on whether rustc-dep-of-std is enabled or not (to have one name when depended on by libstd and another name when normally used from crates.io)

@alexcrichton alexcrichton marked this pull request as ready for review August 27, 2025 18:36
Copy link
Collaborator

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

Thats a nasty sed script but I can't really think of a better way

@alexcrichton alexcrichton merged commit 453ae5d into bytecodealliance:main Aug 27, 2025
4 checks passed
@alexcrichton alexcrichton deleted the update-wit-bindgen branch August 27, 2025 19:44
alexcrichton added a commit to alexcrichton/rust-wasi that referenced this pull request Aug 27, 2025
Mostly looking to integrate bytecodealliance#113 into the Rust standard library.
@alexcrichton alexcrichton mentioned this pull request Aug 27, 2025
alexcrichton added a commit that referenced this pull request Aug 28, 2025
Mostly looking to integrate #113 into the Rust standard library.
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.

3 participants