parsec-cloud icon indicating copy to clipboard operation
parsec-cloud copied to clipboard

Deny undocumented unsafe block in Rust

Open FirelightFlagboy opened this issue 3 years ago • 1 comments

Set the clippy flag undocumented_unsafe_block to deny. Thus it require us to document unsafe block to explain:

Why the unsafe block is OK here.

To simplify the development, you may update your clippy configuration. On VScode with rust-analyzer extension, open .vscode/settings.json and add the following:

"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.checkOnSave.extraArgs": [
    "--",
    "--deny=clippy::self_named_module_files",
    "--deny=clippy::undocumented_unsafe_blocks"
],

FirelightFlagboy avatar Oct 18 '22 14:10 FirelightFlagboy

Can you wait my PR that add unsafe block #3219 ?

TimeEngineer avatar Oct 18 '22 15:10 TimeEngineer

Can you wait my PR that add unsafe block #3219 ?

You just need to add SAFETY: in front of the comment you've added for the unsafe block

FirelightFlagboy avatar Oct 19 '22 07:10 FirelightFlagboy