Removed a few #[allow(dead_code)]
#4299
Merged
+73
−82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
nargs
field inAuxImport::Closure
. The field wasn't used because the generated JS code used...args
to capture any number of arguments. If this information is necessary in the future,AuxImport::Closure
already includes the adapter ID of the closure function and the number of args can be retrieved from that.hole
field inInstruction::OptionWasmToStringEnum
. The bindings have a comment explaining how the hole is handled implicitly as an "invalid" value, so it doesn't need to know the actual value of the hole.So about the integer conversion: Instead of removing the unused fields, I realized that
Instruction::IntToWasm
andInstruction::WasmToInt
were kind of busted. The main issue is that they not only carried redundant data, but could also carry invalid data.To fix this, I first split both into 64 and 32 variants. This immediately makes the JS -> WASM conversions nops. The WASM -> JS directions are also simpler, because they just need a single
bool
of data to select the correct conversion.This also fixes a minor bug in
representable_without_js_glue
. The function previously incorrectly determined thatWASM -> JS u64
andWASM -> JS NonNull
did not require glue code. This was trivial to fix with the new representation.This PR should not affect the output of the CLI in any way.