-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fix clippy lints #2942
Merged
syrusakbary
merged 1 commit into
wasmerio:master
from
silwol:dev/2926-fix-clippy-warnings-in-wasmer3
Jun 9, 2022
Merged
Fix clippy lints #2942
syrusakbary
merged 1 commit into
wasmerio:master
from
silwol:dev/2926-fix-clippy-warnings-in-wasmer3
Jun 9, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
silwol
force-pushed
the
dev/2926-fix-clippy-warnings-in-wasmer3
branch
4 times, most recently
from
June 9, 2022 10:54
3503fc9
to
bd90bfc
Compare
|
silwol
force-pushed
the
dev/2926-fix-clippy-warnings-in-wasmer3
branch
from
June 9, 2022 11:09
bd90bfc
to
b80466d
Compare
syrusakbary
approved these changes
Jun 9, 2022
silwol
force-pushed
the
dev/2926-fix-clippy-warnings-in-wasmer3
branch
2 times, most recently
from
June 9, 2022 13:44
1537dea
to
6aad82c
Compare
Fixes: wasmerio#2926
silwol
force-pushed
the
dev/2926-fix-clippy-warnings-in-wasmer3
branch
from
June 9, 2022 14:06
2ebb905
to
5339f7c
Compare
epilys
approved these changes
Jun 9, 2022
bors r+ |
bors bot
added a commit
that referenced
this pull request
Jun 9, 2022
2942: Fix clippy lints r=syrusakbary a=silwol Fixes: #2926 # Description * Fix all clippy lints * Adjust `Makefile` so that the `cargo clippy` commands exit with non-zero when warnings are found # TODO before this is ready - [x] Describe safety in [lib/engine/src/tunables.rs:67](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/engine/src/tunables.rs#L67) - [x] Describe safety in [lib/types/src/values.rs:70](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/types/src/values.rs#L70) - [x] Describe safety in [lib/types/src/values.rs:76](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/types/src/values.rs#L76) - [x] Describe safety in [lib/emscripten/src/utils.rs:126](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/emscripten/src/utils.rs#L126) I don't know why it needs to be unsafe, can you research why? - The reason is the call to `unsafe slice::from_raw_parts_mut(addr, count as usize)` in line 135. Not sure if this function actually encapsulates the behavior good enough, but if it does, we could just put a `unsafe{…}` around this call and remove the `unsafe` from the function. (silwol) - [x] Describe safety in [lib/emscripten/src/utils.rs:141](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/emscripten/src/utils.rs#L141) We need to double check the safety of the previous method, as this one depends on it (and I believe that's why it's unsafe) - That appears to be the case, once the previous method is no longer marked unsafe, the `unsafe` here is no longer required either. (silwol) - [x] Describe safety in [lib/c-api/src/wasm_c_api/wat.rs:13](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/c-api/src/wasm_c_api/wat.rs#L13) Not sure why it's unsafe, can you research? - Ok, `extern "C"`, that's why. No idea why I missed that initially. :-) (silwol) - [x] Describe safety in [lib/api/src/sys/externals/function.rs:866](https://github.com/silwol/wasmer/blob/dev/2926-fix-clippy-warnings-in-wasmer3/lib/api/src/sys/externals/function.rs#L866) Not sure why it's unsafe, can you research? - I have no clear idea, just the gut feeling that it has something to do with handling the native types. Really would appreciate if we had a better description than what I could guess. (silwol) # Review - [x] Add a short description of the change to the CHANGELOG.md file Co-authored-by: Wolfgang Silbermayr <[email protected]>
This PR was included in a batch that successfully built, but then failed to merge into master (it was a non-fast-forward update). It will be automatically retried. |
epilys
added a commit
that referenced
this pull request
Jun 13, 2022
`Fix clippy lints #2942` changed the `gen_import_call_trampoline_arm64()` code because clippy emitted a lint about the loop logic. However, the fix was wrong and was causing incorrect binary generation on arm64. More precisely, this was caught by test serialize::test_deserialize::singlepass::* on macos M1 (arm64)
epilys
added a commit
that referenced
this pull request
Jun 13, 2022
Fix clippy lints #2942 changed the `gen_import_call_trampoline_arm64()` code because clippy emitted a lint about the loop logic. However, the fix was wrong and was causing incorrect binary generation on arm64. More specifically, this was caught by test `serialize::test_deserialize::singlepass::*` on macos M1 (arm64)
bors bot
added a commit
that referenced
this pull request
Jun 13, 2022
2948: Fix regression on gen_import_call_trampoline_arm64() r=epilys a=epilys Fix clippy lints #2942 changed the `gen_import_call_trampoline_arm64()` code because clippy emitted a lint about the loop logic. However, the fix was wrong and was causing incorrect binary generation on arm64. More precisely, this was caught by test `serialize::test_deserialize::singlepass::*` on macos M1 (arm64) This regression was not caught because **tests are not run on ARM64 on Github Actions CI runners**. Co-authored-by: Manos Pitsidianakis <[email protected]>
ptitSeb
pushed a commit
that referenced
this pull request
Oct 20, 2022
Fix clippy lints #2942 changed the `gen_import_call_trampoline_arm64()` code because clippy emitted a lint about the loop logic. However, the fix was wrong and was causing incorrect binary generation on arm64. More specifically, this was caught by test `serialize::test_deserialize::singlepass::*` on macos M1 (arm64)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #2926
Description
Makefile
so that thecargo clippy
commands exit with non-zero when warnings are foundTODO before this is ready
I don't know why it needs to be unsafe, can you research why?
unsafe slice::from_raw_parts_mut(addr, count as usize)
in line 135. Not sure if this function actually encapsulates the behavior good enough, but if it does, we could just put aunsafe{…}
around this call and remove theunsafe
from the function. (silwol)We need to double check the safety of the previous method, as this one depends on it (and I believe that's why it's unsafe)
unsafe
here is no longer required either. (silwol)Not sure why it's unsafe, can you research?
extern "C"
, that's why. No idea why I missed that initially. :-) (silwol)Not sure why it's unsafe, can you research?
Review