Skip to content

library: Normalize safety-for-unsafe-block comments - #82467

Merged
bors merged 1 commit into
rust-lang:masterfrom
ojeda:tidy-normalize-safety-comments
Feb 26, 2021
Merged

library: Normalize safety-for-unsafe-block comments#82467
bors merged 1 commit into
rust-lang:masterfrom
ojeda:tidy-normalize-safety-comments

Conversation

@ojeda

Copy link
Copy Markdown
Contributor

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

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>
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 24, 2021
@kennytm

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Feb 25, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit eefec8a has been approved by kennytm

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 25, 2021
@Aaron1011Aaron1011 mentioned this pull request Feb 25, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 25, 2021
Rollup of 11 pull requests
Successful merges:
- rust-lang#82269 (Cleanup `PpMode` and friends)
- rust-lang#82431 (Set RUST_BACKTRACE=0 when running `treat-err-as-bug` tests)
- rust-lang#82441 (Fix typo in sanitizer flag in unstable book.)
- rust-lang#82463 (panic_bounds_checks should be panic_bounds_check)
- rust-lang#82464 (Update outdated comment in unix Command.)
- rust-lang#82467 (library: Normalize safety-for-unsafe-block comments)
- rust-lang#82468 (Move pick_by_value_method docs above function header)
- rust-lang#82484 (rustdoc: Remove duplicate "List of all items")
- rust-lang#82502 (Only look for HTML `tidy` when running rustdoc tests)
- rust-lang#82503 (fix typo in `pre-commit.sh`)
- rust-lang#82510 (Fix typo in `param_env_reveal_all_normalized`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit befa2df into rust-lang:masterFeb 26, 2021
@rustbotrustbot added this to the 1.52.0 milestone Feb 26, 2021
@ojeda
ojeda deleted the tidy-normalize-safety-comments branch April 14, 2021 10:53
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ojeda@rust-highfive@kennytm@bors@rustbot