Rollup merge of #82467 - ojeda:tidy-normalize-safety-comments, r=kennytm
library: Normalize safety-for-unsafe-block comments Almost all safety comments are of the form `// SAFETY:`, so normalize the rest and fix a few of them that should have been a `/// # Safety` section instead. Furthermore, make `tidy` only allow the uppercase form. While currently `tidy` only checks `core`, it is a good idea to prevent `core` from drifting to non-uppercase comments, so that later we can start checking `alloc` etc. too. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
commit
befa2dffda
7 changed files with 26 additions and 19 deletions
|
|
@ -289,7 +289,7 @@ pub fn check(path: &Path, bad: &mut bool) {
|
|||
suppressible_tidy_err!(err, skip_undocumented_unsafe, "undocumented unsafe");
|
||||
}
|
||||
}
|
||||
if line.contains("// SAFETY:") || line.contains("// Safety:") {
|
||||
if line.contains("// SAFETY:") {
|
||||
last_safety_comment = true;
|
||||
} else if line.trim().starts_with("//") || line.trim().is_empty() {
|
||||
// keep previous value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue