-
Notifications
You must be signed in to change notification settings - Fork 50
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
Document unsafe
blocks
#228
Comments
I started to look into that, but we have a looooot of |
I think we have to rely on reviews for making sure all new |
This is to prevent undocumented unsafe blocks from growing before we add comments for all of them and manage to enable `clippy::undocumented_unsafe_blocks` lint. Progress documented at coconut-svsm#228. When we fix that issue, we may remove this pipeline. Signed-off-by: Stefano Garzarella <[email protected]>
This is to prevent undocumented unsafe blocks from growing before we add comments for all of them and manage to enable `clippy::undocumented_unsafe_blocks` lint. Progress documented at coconut-svsm#228. When we fix that issue, we may remove this pipeline. Signed-off-by: Stefano Garzarella <[email protected]>
Yes, but we are human, and it can be missed, so I added a new pipeline for that, see #535 For example, we have recently added several with the work for user space (I will send another PR tomorrow to fix some of them, but I need help with some that I don't know how to document). |
Hi @stefano-garzarella, I am able to repro missing
|
@vijaydhanraj I already have a patch here stefano-garzarella@5c2fb54 I'm going to post a PR with multiple SAFETY comments (not all, because they are too much for a single PR). Just a note, instead of modifying the Makefile, you can just uncomment this line in Cargo.toml: diff --git a/Cargo.toml b/Cargo.toml
index 1d3a7bf2..a1fe07a3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -91,7 +91,7 @@ rest_pat_in_fully_bound_structs = "warn"
string_to_string = "warn"
suboptimal_flops = "warn"
# TODO: fires many times, fix then enable.
-# undocumented_unsafe_blocks = "warn"
+undocumented_unsafe_blocks = "warn"
unnecessary_box_returns = "warn"
[workspace.metadata.scripts] |
Thanks @stefano-garzarella for the suggestion and the patch! The changes here stefano-garzarella@5c2fb54 look good to me. |
This is to prevent undocumented unsafe blocks from growing before we add comments for all of them and manage to enable `clippy::undocumented_unsafe_blocks` lint. Progress documented at coconut-svsm#228. When we fix that issue, we may remove this pipeline. Signed-off-by: Stefano Garzarella <[email protected]>
Just reopen this, not sure why GH decided to close it. |
We should document all
unsafe
blocks in the codebase, explaining the rationale for why using the keyword is safe (i.e.// SAFETY:
comments). This will allow us to enable theundocumented_unsafe_blocks
clippy lint (e.g.cargo clippy -- -D clippy::undocumented_unsafe_blocks
), and emit an error on new undocumented unsafe blocks.The text was updated successfully, but these errors were encountered: