Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 110c3df

Browse files
authoredAug 26, 2024
Rollup merge of rust-lang#126013 - nnethercote:unreachable_pub, r=Urgau
Add `#[warn(unreachable_pub)]` to a bunch of compiler crates By default `unreachable_pub` identifies things that need not be `pub` and tells you to make them `pub(crate)`. But sometimes those things don't need any kind of visibility. So they way I did these was to remove the visibility entirely for each thing the lint identifies, and then add `pub(crate)` back in everywhere the compiler said it was necessary. (Or occasionally `pub(super)` when context suggested that was appropriate.) Tedious, but results in more `pub` removal. There are plenty more crates to do but this seems like enough for a first PR. r? `@compiler-errors`
2 parents 515395a + cc84442 commit 110c3df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+503
-464
lines changed
 

‎compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![cfg_attr(feature = "nightly", doc(rust_logo))]
44
#![cfg_attr(feature = "nightly", feature(rustdoc_internals))]
55
#![cfg_attr(feature = "nightly", feature(step_trait))]
6+
#![warn(unreachable_pub)]
67
// tidy-alphabetical-end
78

89
use std::fmt;

‎compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#![feature(rustc_attrs)]
2626
#![feature(rustdoc_internals)]
2727
#![feature(strict_provenance)]
28+
#![warn(unreachable_pub)]
2829
// tidy-alphabetical-end
2930

3031
use std::alloc::Layout;

0 commit comments

Comments
 (0)
Please sign in to comment.