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

Rust: avoid emitting trailing whitespace #878

Conversation

sunfishcode
Copy link
Member

This works around what appears to be a bug in rustfmt when generating bindings for wasi-http. If the code is too complex, rustfmt appears to stops formatting, and then abort when it leaves behind trailing whitespace.

This works around what appears to be a bug in rustfmt when generating
bindings for wasi-http. If the code is too complex, rustfmt appears to stops
formatting, and then abort when it leaves behind trailing whitespace.
@sunfishcode
Copy link
Member Author

This is hitting some errors that I don't yet understand.

@alexcrichton
Copy link
Member

My guess is that the issue lies somewhere around here where the custom section literal is being emitted. The string literal with escapes may be getting mangled in the wrong way with the new logic in Source?

@sunfishcode
Copy link
Member Author

Thanks, that was indeed the spot!

@alexcrichton alexcrichton enabled auto-merge March 4, 2024 17:00
@alexcrichton alexcrichton added this pull request to the merge queue Mar 4, 2024
Merged via the queue into bytecodealliance:main with commit 3418759 Mar 4, 2024
12 checks passed
sunfishcode added a commit to sunfishcode/cargo-component that referenced this pull request Mar 4, 2024
Among other things, this pulls in bytecodealliance/wit-bindgen#878,
which fixes a bug I'm hitting when using cargo component with wasi-http.
@sunfishcode sunfishcode deleted the sunfishcode/trailing-whitespace branch March 4, 2024 23:19
peterhuene pushed a commit to bytecodealliance/cargo-component that referenced this pull request Mar 5, 2024
Among other things, this pulls in bytecodealliance/wit-bindgen#878,
which fixes a bug I'm hitting when using cargo component with wasi-http.
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