-
Notifications
You must be signed in to change notification settings - Fork 927
don't convert implict ABI when doing so could fail to preserve semantics #4293
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,20 @@ libc::c_long; | |
extern { | ||
|
||
} | ||
|
||
// #2908 - https://github.com/rust-lang/rustfmt/issues/2908 | ||
#[wasm_bindgen(module = "child_process", version = "*")] | ||
extern { | ||
#[wasm_bindgen(js_name = execSync)] | ||
fn exec_sync(cmd: &str) -> Buffer; | ||
|
||
fn foo() -> Bar; | ||
} | ||
|
||
// Users that have an existing explicit ABI would need to convert to implicit | ||
// manually, as rustfmt will be conservative and not attempt to convert explicit | ||
// to implicit in the wasm case. | ||
#[wasm_bindgen] | ||
extern "C" { | ||
fn foo() -> Bar; | ||
} | ||
Comment on lines
+76
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately I believe that an explicit C ABI became common practice with wasm_bindgen at least in part because of rustfmt 1.x behavior. However, I don't think we should attempt to help those users convert back to an implicit ABI as it seems to risky/error prone IMO; with this change, rustfmt 2.0 by default would permit users to do what they want and will no longer force Explicit ABIs. |
Uh oh!
There was an error while loading. Please reload this page.