rust/tests/ui-toml/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs

25 lines
830 B
Rust
Raw Normal View History

#![deny(clippy::undocumented_unsafe_blocks)]
#![allow(clippy::missing_safety_doc)]
fn main() {
// Safety: A safety comment
let _some_variable_with_a_very_long_name_to_break_the_line =
unsafe { a_function_with_a_very_long_name_to_break_the_line() };
2023-06-05 02:55:39 -05:00
// Safety: Another safety comment
const _SOME_CONST_WITH_A_VERY_LONG_NAME_TO_BREAK_THE_LINE: u32 =
unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
// Safety: Yet another safety comment
static _SOME_STATIC_WITH_A_VERY_LONG_NAME_TO_BREAK_THE_LINE: u32 =
unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
}
pub unsafe fn a_function_with_a_very_long_name_to_break_the_line() -> u32 {
1
}
2023-06-05 02:55:39 -05:00
pub const unsafe fn a_const_function_with_a_very_long_name_to_break_the_line() -> u32 {
2
}