mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-06 00:44:23 +02:00
Add safety comment (#1553)
``` error: unsafe block missing a safety comment --> interoperability/bindgen/main.rs:11:5 | 11 | unsafe { | ^^^^^^^^ | = help: consider adding a safety comment on the preceding line = help: for further information visit https://rust-lang.github.io/rust-clippy /master/index.html#undocumented_unsafe_blocks = note: requested on the command line with `-D clippy::undocumented-unsafe-bl ocks` ```
This commit is contained in:
parent
30f8e50b43
commit
a9eaa129cf
@ -23,6 +23,7 @@ fn main() {
|
||||
name: name.as_ptr(),
|
||||
years: 42,
|
||||
};
|
||||
// SAFETY: `print_card` is safe to call with a valid `card` pointer.
|
||||
unsafe {
|
||||
print_card(&card as *const card);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user