Addressing reviewer comments

This commit is contained in:
Renato Lochetti 2023-06-05 08:55:39 +01:00
parent 520228b377
commit e2e6a02445
No known key found for this signature in database
GPG key ID: FB2DDFF8C164FA5E
6 changed files with 52 additions and 5 deletions

View file

@ -513,10 +513,22 @@ pub unsafe fn a_function_with_a_very_long_name_to_break_the_line() -> u32 {
1
}
pub const unsafe fn a_const_function_with_a_very_long_name_to_break_the_line() -> u32 {
2
}
fn issue_10832() {
// Safety: A safety comment. But it will warn anyways
let _some_variable_with_a_very_long_name_to_break_the_line =
unsafe { a_function_with_a_very_long_name_to_break_the_line() };
// Safety: Another safety comment. But it will warn anyways
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. But it will warn anyways
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() };
}
fn main() {}

View file

@ -319,12 +319,28 @@ LL | let bar = unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:519:9
--> $DIR/undocumented_unsafe_blocks.rs:523:9
|
LL | unsafe { a_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a safety comment on the preceding line
error: aborting due to 37 previous errors
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:527:9
|
LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:531:9
|
LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a safety comment on the preceding line
error: aborting due to 39 previous errors