Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Remove pub/#[no_mangle] decorators on lang items #11

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

alexcrichton
Copy link
Contributor

I was poking around this wasm project to double check that the wasm module is
appropriately sized, but to my surprise there were some stray symbols exported
from the wasm module! Specifically the wasm module currently exports
rust_begin_unwind and rust_oom symbols, but neither of these should be
exported.

The #[panic_implementation] and #[alloc_error_handler] attributes should
render the pub and #[no_mangle] annotations unnecessary, however, and the
compiler manages the symbol business internally with the wrapper it generates.

I was poking around this wasm project to double check that the wasm module is
appropriately sized, but to my surprise there were some stray symbols exported
from the wasm module! Specifically the wasm module currently exports
`rust_begin_unwind` and `rust_oom` symbols, but neither of these should be
exported.

The `#[panic_implementation]` and `#[alloc_error_handler]` attributes should
render the `pub` and `#[no_mangle]` annotations unnecessary, however, and the
compiler manages the symbol business internally with the wrapper it generates.
@alexcrichton
Copy link
Contributor Author

There's still some stray symbols, but they should be fixed by rust-lang/rust#52993!

@Hywan
Copy link
Owner

Hywan commented Aug 21, 2018

Sorry, I did not see the notifications about your PR… Post-holidays effect probably.

Anyway, thank you very much, that's true #[no_mangle] are useless!

@Hywan Hywan self-assigned this Aug 21, 2018
@Hywan Hywan added the enhancement New feature or request label Aug 21, 2018
@Hywan Hywan merged commit 7669260 into Hywan:master Aug 21, 2018
@Hywan
Copy link
Owner

Hywan commented Aug 21, 2018

Hmm, Github erases the author when I modify the commit message, 7669260. I'm gonna fix that.

@Hywan
Copy link
Owner

Hywan commented Aug 21, 2018

Author fixed, 69c0609.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants