1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-12-23 15:01:49 +02:00

Add safety comments and use consistent format for existing ones. (#1981)

We should have safety comments on all `unsafe` blocks, to set a good
example.
This commit is contained in:
Andrew Walbran
2024-04-12 18:19:19 +01:00
committed by GitHub
parent 8433ad9a3d
commit b808887006
18 changed files with 65 additions and 53 deletions

View File

@@ -28,7 +28,7 @@ pub unsafe trait AsBytes {
}
}
// Safe because u32 has a defined representation and no padding.
// SAFETY: `u32` has a defined representation and no padding.
unsafe impl AsBytes for u32 {}
```