-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Use try_from
instead of the cast crate.
#172
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! It looks like there are 2 more crates which could use converting from cast
to try_from
: wasmtime-wasi-c
and wasmtime-runtime
. Do you think you'd be able to make those changes in this PR? :-)
`try_from` is stable now, so cast is unnecessary.
@kubkon I've converted those two crates too! #[cfg(target_pointer_width = "32")]
let sig_id = VMSharedSignatureIndex::new(cast::u32(len));
#[cfg(target_pointer_width = "64")]
let sig_id = VMSharedSignatureIndex::new(cast::u32(len).unwrap()); I assume that this is written as such because the |
Correct!
None at all. To the best of my knowledge, we can safely chuck away the |
Alright, then this should be ready to merge 😁 I made sure to |
Looks great, thanks! For the future, you can run |
* delete adapter src/main.o: this was accidentally left out of bytecodealliance#165 * move adapter, byte-array, and verify to a new workspace * rename byte-array crate to a name available on crates.io * add a readme for verify, also give it a slightly better name * CI: wit dep check in its own step, verify before publish, trim down publication * reactor-tests: delete deps symlinks * reactor-tests: manage wit with wit-deps * test: dont set default toolchain to nightly * wit-deps lock adapter * wit-deps lock reactor-tests wit-deps doesnt manage these for some reason
* delete adapter src/main.o: this was accidentally left out of bytecodealliance#165 * move adapter, byte-array, and verify to a new workspace * rename byte-array crate to a name available on crates.io * add a readme for verify, also give it a slightly better name * CI: wit dep check in its own step, verify before publish, trim down publication * reactor-tests: delete deps symlinks * reactor-tests: manage wit with wit-deps * test: dont set default toolchain to nightly * wit-deps lock adapter * wit-deps lock reactor-tests wit-deps doesnt manage these for some reason
Model the `Reg` type on AArch64 as unknown bitvector width. Reverses bytecodealliance#108. The motivation for this is the need to model vector intructions, where `Reg` is also used to represent ARM `Z` 128-bit registers. The type inference problems that necessitated the 64-bit type before have now been fixed by a combination of bytecodealliance#167 and bytecodealliance#171. Updates avanhatt#46 avanhatt#34
Model the `Reg` type on AArch64 as unknown bitvector width. Reverses bytecodealliance#108. The motivation for this is the need to model vector intructions, where `Reg` is also used to represent ARM `Z` 128-bit registers. The type inference problems that necessitated the 64-bit type before have now been fixed by a combination of bytecodealliance#167 and bytecodealliance#171. Updates avanhatt#46 avanhatt#34
Fixes bytecodealliance#172 Co-authored-by: Luke Wagner <mail@lukewagner.name> Signed-off-by: Joel Dice <joel.dice@fermyon.com>
try_from
is stable now, so cast is unnecessary.This closes #169