1
Fork 0

Reduce visibilities, and add warn(unreachable_pub).

Lots of unnecessary `pub`s in this crate. Most are downgraded to
`pub(super)`, though some don't need any visibility.
This commit is contained in:
Nicholas Nethercote 2024-08-28 09:39:59 +10:00
parent adf8d168af
commit 6af470e360
65 changed files with 125 additions and 120 deletions

View file

@ -26,7 +26,7 @@ use tracing::{debug, instrument, trace};
use crate::errors::{AssertLint, AssertLintKind};
pub struct KnownPanicsLint;
pub(super) struct KnownPanicsLint;
impl<'tcx> crate::MirLint<'tcx> for KnownPanicsLint {
fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
@ -852,7 +852,7 @@ const MAX_ALLOC_LIMIT: u64 = 1024;
/// The mode that `ConstProp` is allowed to run in for a given `Local`.
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ConstPropMode {
enum ConstPropMode {
/// The `Local` can be propagated into and reads of this `Local` can also be propagated.
FullConstProp,
/// The `Local` can only be propagated into and from its own block.
@ -864,7 +864,7 @@ pub enum ConstPropMode {
/// A visitor that determines locals in a MIR body
/// that can be const propagated
pub struct CanConstProp {
struct CanConstProp {
can_const_prop: IndexVec<Local, ConstPropMode>,
// False at the beginning. Once set, no more assignments are allowed to that local.
found_assignment: BitSet<Local>,
@ -872,7 +872,7 @@ pub struct CanConstProp {
impl CanConstProp {
/// Returns true if `local` can be propagated
pub fn check<'tcx>(
fn check<'tcx>(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
body: &Body<'tcx>,