Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #130163

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1d42d6a
Revert warning empty patterns as unreachable
Nadrieril Aug 28, 2024
46115fd
fix ICE in CMSE type validation
folkertdev Sep 6, 2024
a6c6eda
Remove now redundant check in symlink_hard_link test
madsmtm Sep 7, 2024
6af470e
Reduce visibilities, and add `warn(unreachable_pub)`.
nnethercote Aug 27, 2024
cd9fd27
Factor out some more repetitive code.
nnethercote Aug 28, 2024
a6735e4
Add an explicit ignore message for "up-to-date" tests
Zalathar Sep 9, 2024
ec6fe4e
Streamline `AbortUnwindingCalls`.
nnethercote Aug 28, 2024
cc09ab3
Simplify `verify_candidate_branch`.
nnethercote Aug 29, 2024
181fbd5
Use `let`/`else` to de-indent `ElaborateBoxDerefs::run_pass`.
nnethercote Sep 8, 2024
4f2588f
Remove an unnecessary `continue`.
nnethercote Aug 30, 2024
9cf90b9
Remove some unnecessary dereferences.
nnethercote Aug 30, 2024
7adde3f
Make `CallSite` non-`Copy`.
nnethercote Aug 30, 2024
751c8b4
Use `LocalDecls` in a couple of places.
nnethercote Aug 30, 2024
5445953
Improve consistency in `LowerIntrinsics`.
nnethercote Sep 3, 2024
acccb39
Print a helpful message if any tests were skipped for being up-to-date
Zalathar Sep 9, 2024
3fe7dd6
Remove unnecessary lifetimes in dataflow structs.
nnethercote Sep 5, 2024
bed91f5
Remove unnecessary lifetime in `PlaceCollector`.
nnethercote Sep 6, 2024
1aafeb2
Remove unnecessary lifetime from `OperandCollector`.
nnethercote Sep 6, 2024
28a6dc4
Rename some lifetimes.
nnethercote Sep 6, 2024
dc62f07
Remove `Gatherer`.
nnethercote Sep 6, 2024
0b032f8
Remove `Elaborator`.
nnethercote Sep 6, 2024
5c35027
Remove unnecessary lifetime from `StorageConflictVisitor`.
nnethercote Sep 6, 2024
0f8efb3
Fix ICE caused by missing span in a region error
gurry Sep 9, 2024
e186cc6
do `PolyFnSig` -> `FnSig` conversion later
folkertdev Sep 9, 2024
19b8f9e
use verbose flag as a default value for `rust.verbose-tests`
onur-ozkan Sep 9, 2024
bc70fa2
Stabilize `char::MIN`
okaneco Sep 9, 2024
13ea104
update `rust.verbose-tests` doc in `config.example.toml`
onur-ozkan Sep 9, 2024
59fe4e9
Rollup merge of #129103 - Nadrieril:dont-warn-empty-unreachable, r=co…
matthiaskrgr Sep 9, 2024
1c4c089
Rollup merge of #129929 - nnethercote:rustc_mir_transform-cleanups-2,…
matthiaskrgr Sep 9, 2024
4b41fa6
Rollup merge of #130022 - nnethercote:dataflow-borrowck-lifetimes, r=…
matthiaskrgr Sep 9, 2024
58c8e12
Rollup merge of #130064 - folkertdev:fix-issue-129983, r=compiler-errors
matthiaskrgr Sep 9, 2024
d2f98de
Rollup merge of #130067 - madsmtm:clean-up-fs-test, r=ChrisDenton
matthiaskrgr Sep 9, 2024
c50de21
Rollup merge of #130131 - Zalathar:up-to-date, r=Kobzol
matthiaskrgr Sep 9, 2024
45e315d
Rollup merge of #130137 - gurry:master, r=cjgillot
matthiaskrgr Sep 9, 2024
76247b0
Rollup merge of #130153 - onur-ozkan:verbose-to-verbose-tests, r=Kobzol
matthiaskrgr Sep 9, 2024
f5cc9c8
Rollup merge of #130154 - okaneco:stabilize_char_min, r=cuviper
matthiaskrgr Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
nnethercote committed Sep 8, 2024
commit 6af470e360b775a9079bd0e6634488d7a1936290
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/abort_unwinding_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_target::spec::PanicStrategy;
/// This forces all unwinds, in panic=abort mode happening in foreign code, to
/// trigger a process abort.
#[derive(PartialEq)]
pub struct AbortUnwindingCalls;
pub(super) struct AbortUnwindingCalls;

impl<'tcx> crate::MirPass<'tcx> for AbortUnwindingCalls {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/add_call_guards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use rustc_middle::ty::TyCtxt;
use tracing::debug;

#[derive(PartialEq)]
pub enum AddCallGuards {
pub(super) enum AddCallGuards {
AllCallEdges,
CriticalCallEdges,
}
pub use self::AddCallGuards::*;
pub(super) use self::AddCallGuards::*;

/**
* Breaks outgoing critical edges for call terminators in the MIR.
Expand Down Expand Up @@ -37,7 +37,7 @@ impl<'tcx> crate::MirPass<'tcx> for AddCallGuards {
}

impl AddCallGuards {
pub fn add_call_guards(&self, body: &mut Body<'_>) {
pub(super) fn add_call_guards(&self, body: &mut Body<'_>) {
let mut pred_count: IndexVec<_, _> =
body.basic_blocks.predecessors().iter().map(|ps| ps.len()).collect();
pred_count[START_BLOCK] += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::util;
///
/// The storage instructions are required to avoid stack space
/// blowup.
pub struct AddMovesForPackedDrops;
pub(super) struct AddMovesForPackedDrops;

impl<'tcx> crate::MirPass<'tcx> for AddMovesForPackedDrops {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
Expand All @@ -44,7 +44,7 @@ impl<'tcx> crate::MirPass<'tcx> for AddMovesForPackedDrops {
}
}

pub fn add_moves_for_packed_drops<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
fn add_moves_for_packed_drops<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let patch = add_moves_for_packed_drops_patch(tcx, body);
patch.apply(body);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/add_retag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_hir::LangItem;
use rustc_middle::mir::*;
use rustc_middle::ty::{self, Ty, TyCtxt};

pub struct AddRetag;
pub(super) struct AddRetag;

/// Determine whether this type may contain a reference (or box), and thus needs retagging.
/// We will only recurse `depth` times into Tuples/ADTs to bound the cost of this.
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/add_subtyping_projections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use rustc_middle::mir::visit::MutVisitor;
use rustc_middle::mir::*;
use rustc_middle::ty::TyCtxt;

pub struct Subtyper;
pub(super) struct Subtyper;

pub struct SubTypeChecker<'a, 'tcx> {
struct SubTypeChecker<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
patcher: MirPatch<'tcx>,
local_decls: &'a IndexVec<Local, LocalDecl<'tcx>>,
Expand Down Expand Up @@ -52,7 +52,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for SubTypeChecker<'a, 'tcx> {
// // gets transformed to
// let temp: rval_ty = rval;
// let place: place_ty = temp as place_ty;
pub fn subtype_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
fn subtype_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let patch = MirPatch::new(body);
let mut checker = SubTypeChecker { tcx, patcher: patch, local_decls: &body.local_decls };

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/check_alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt};
use rustc_session::Session;
use tracing::{debug, trace};

pub struct CheckAlignment;
pub(super) struct CheckAlignment;

impl<'tcx> crate::MirPass<'tcx> for CheckAlignment {
fn is_enabled(&self, sess: &Session) -> bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_span::Span;

use crate::errors;

pub struct CheckConstItemMutation;
pub(super) struct CheckConstItemMutation;

impl<'tcx> crate::MirLint<'tcx> for CheckConstItemMutation {
fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/check_packed_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_middle::ty::{self, TyCtxt};

use crate::{errors, util};

pub struct CheckPackedRef;
pub(super) struct CheckPackedRef;

impl<'tcx> crate::MirLint<'tcx> for CheckPackedRef {
fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use rustc_middle::mir::{Body, BorrowKind, CastKind, Rvalue, StatementKind, Termi
use rustc_middle::ty::adjustment::PointerCoercion;
use rustc_middle::ty::TyCtxt;

pub struct CleanupPostBorrowck;
pub(super) struct CleanupPostBorrowck;

impl<'tcx> crate::MirPass<'tcx> for CleanupPostBorrowck {
fn run_pass(&self, _tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/copy_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::ssa::SsaLocals;
/// where each of the locals is only assigned once.
///
/// We want to replace all those locals by `_a`, either copied or moved.
pub struct CopyProp;
pub(super) struct CopyProp;

impl<'tcx> crate::MirPass<'tcx> for CopyProp {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
mod by_move_body;
use std::{iter, ops};

pub use by_move_body::coroutine_by_move_body_def_id;
pub(super) use by_move_body::coroutine_by_move_body_def_id;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::pluralize;
use rustc_hir as hir;
Expand Down Expand Up @@ -85,7 +85,7 @@ use tracing::{debug, instrument, trace};
use crate::deref_separator::deref_finder;
use crate::{abort_unwinding_calls, errors, pass_manager as pm, simplify};

pub struct StateTransform;
pub(super) struct StateTransform;

struct RenameLocalVisitor<'tcx> {
from: Local,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/coroutine/by_move_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::symbol::kw;
use rustc_target::abi::{FieldIdx, VariantIdx};

pub fn coroutine_by_move_body_def_id<'tcx>(
pub(crate) fn coroutine_by_move_body_def_id<'tcx>(
tcx: TyCtxt<'tcx>,
coroutine_def_id: LocalDefId,
) -> DefId {
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_mir_transform/src/cost_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const CONST_SWITCH_BONUS: usize = 10;

/// Verify that the callee body is compatible with the caller.
#[derive(Clone)]
pub(crate) struct CostChecker<'b, 'tcx> {
pub(super) struct CostChecker<'b, 'tcx> {
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
penalty: usize,
Expand All @@ -22,7 +22,7 @@ pub(crate) struct CostChecker<'b, 'tcx> {
}

impl<'b, 'tcx> CostChecker<'b, 'tcx> {
pub fn new(
pub(super) fn new(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
instance: Option<ty::Instance<'tcx>>,
Expand All @@ -36,7 +36,7 @@ impl<'b, 'tcx> CostChecker<'b, 'tcx> {
/// Needed because the `CostChecker` is used sometimes for just blocks,
/// and even the full `Inline` doesn't call `visit_body`, so there's nowhere
/// to put this logic in the visitor.
pub fn add_function_level_costs(&mut self) {
pub(super) fn add_function_level_costs(&mut self) {
fn is_call_like(bbd: &BasicBlockData<'_>) -> bool {
use TerminatorKind::*;
match bbd.terminator().kind {
Expand Down Expand Up @@ -64,7 +64,7 @@ impl<'b, 'tcx> CostChecker<'b, 'tcx> {
}
}

pub fn cost(&self) -> usize {
pub(super) fn cost(&self) -> usize {
usize::saturating_sub(self.penalty, self.bonus)
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/coverage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub mod query;
pub(super) mod query;

mod counters;
mod graph;
Expand Down Expand Up @@ -32,7 +32,7 @@ use crate::coverage::mappings::ExtractedMappings;
/// Inserts `StatementKind::Coverage` statements that either instrument the binary with injected
/// counters, via intrinsic `llvm.instrprof.increment`, and/or inject metadata used during codegen
/// to construct the coverage map.
pub struct InstrumentCoverage;
pub(super) struct InstrumentCoverage;

impl<'tcx> crate::MirPass<'tcx> for InstrumentCoverage {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/cross_crate_inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_span::sym;

use crate::{inline, pass_manager as pm};

pub fn provide(providers: &mut Providers) {
pub(super) fn provide(providers: &mut Providers) {
providers.cross_crate_inlinable = cross_crate_inlinable;
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/ctfe_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_middle::mir::{
use rustc_middle::ty::TyCtxt;
use tracing::instrument;

pub struct CtfeLimit;
pub(super) struct CtfeLimit;

impl<'tcx> crate::MirPass<'tcx> for CtfeLimit {
#[instrument(skip(self, _tcx, body))]
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/dataflow_const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use tracing::{debug, debug_span, instrument};
const BLOCK_LIMIT: usize = 100;
const PLACE_LIMIT: usize = 100;

pub struct DataflowConstProp;
pub(super) struct DataflowConstProp;

impl<'tcx> crate::MirPass<'tcx> for DataflowConstProp {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down Expand Up @@ -332,7 +332,7 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'_, 'tcx> {
}

impl<'a, 'tcx> ConstAnalysis<'a, 'tcx> {
pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, map: Map<'tcx>) -> Self {
fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, map: Map<'tcx>) -> Self {
let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id());
Self {
map,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/dead_store_elimination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::util::is_within_packed;
///
/// The `borrowed` set must be a `BitSet` of all the locals that are ever borrowed in this body. It
/// can be generated via the [`borrowed_locals`] function.
pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let borrowed_locals = borrowed_locals(body);

// If the user requests complete debuginfo, mark the locals that appear in it as live, so
Expand Down Expand Up @@ -127,7 +127,7 @@ pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
}
}

pub enum DeadStoreElimination {
pub(super) enum DeadStoreElimination {
Initial,
Final,
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/deduce_param_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn type_will_always_be_passed_directly(ty: Ty<'_>) -> bool {
/// body of the function instead of just the signature. These can be useful for optimization
/// purposes on a best-effort basis. We compute them here and store them into the crate metadata so
/// dependent crates can use them.
pub fn deduced_param_attrs<'tcx>(
pub(super) fn deduced_param_attrs<'tcx>(
tcx: TyCtxt<'tcx>,
def_id: LocalDefId,
) -> &'tcx [DeducedParamAttrs] {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/deduplicate_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tracing::debug;

use super::simplify::simplify_cfg;

pub struct DeduplicateBlocks;
pub(super) struct DeduplicateBlocks;

impl<'tcx> crate::MirPass<'tcx> for DeduplicateBlocks {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/deref_separator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use rustc_middle::mir::visit::{MutVisitor, PlaceContext};
use rustc_middle::mir::*;
use rustc_middle::ty::TyCtxt;

pub struct Derefer;
pub(super) struct Derefer;

pub struct DerefChecker<'a, 'tcx> {
struct DerefChecker<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
patcher: MirPatch<'tcx>,
local_decls: &'a IndexVec<Local, LocalDecl<'tcx>>,
Expand Down Expand Up @@ -67,7 +67,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for DerefChecker<'a, 'tcx> {
}
}

pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
pub(super) fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let patch = MirPatch::new(body);
let mut checker = DerefChecker { tcx, patcher: patch, local_decls: &body.local_decls };

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/dest_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ use rustc_mir_dataflow::points::{save_as_intervals, DenseLocationMap, PointIndex
use rustc_mir_dataflow::Analysis;
use tracing::{debug, trace};

pub struct DestinationPropagation;
pub(super) struct DestinationPropagation;

impl<'tcx> crate::MirPass<'tcx> for DestinationPropagation {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/dump_mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_middle::mir::{write_mir_pretty, Body};
use rustc_middle::ty::TyCtxt;
use rustc_session::config::{OutFileName, OutputType};

pub struct Marker(pub &'static str);
pub(super) struct Marker(pub &'static str);

impl<'tcx> crate::MirPass<'tcx> for Marker {
fn name(&self) -> &'static str {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/early_otherwise_branch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ use super::simplify::simplify_cfg;
/// | ... |
/// =================
/// ```
pub struct EarlyOtherwiseBranch;
pub(super) struct EarlyOtherwiseBranch;

impl<'tcx> crate::MirPass<'tcx> for EarlyOtherwiseBranch {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/elaborate_box_derefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_middle::ty::{Ty, TyCtxt};
use rustc_target::abi::FieldIdx;

/// Constructs the types used when accessing a Box's pointer
pub fn build_ptr_tys<'tcx>(
fn build_ptr_tys<'tcx>(
tcx: TyCtxt<'tcx>,
pointee: Ty<'tcx>,
unique_did: DefId,
Expand All @@ -26,7 +26,7 @@ pub fn build_ptr_tys<'tcx>(
}

/// Constructs the projection needed to access a Box's pointer
pub fn build_projection<'tcx>(
pub(super) fn build_projection<'tcx>(
unique_ty: Ty<'tcx>,
nonnull_ty: Ty<'tcx>,
ptr_ty: Ty<'tcx>,
Expand Down Expand Up @@ -88,7 +88,7 @@ impl<'tcx, 'a> MutVisitor<'tcx> for ElaborateBoxDerefVisitor<'tcx, 'a> {
}
}

pub struct ElaborateBoxDerefs;
pub(super) struct ElaborateBoxDerefs;

impl<'tcx> crate::MirPass<'tcx> for ElaborateBoxDerefs {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/elaborate_drops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use crate::deref_separator::deref_finder;
/// }
/// }
/// ```
pub struct ElaborateDrops;
pub(super) struct ElaborateDrops;

impl<'tcx> crate::MirPass<'tcx> for ElaborateDrops {
#[instrument(level = "trace", skip(self, tcx, body))]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl<'a, P: std::fmt::Debug> LintDiagnostic<'a, ()> for AssertLint<P> {
}

impl AssertLintKind {
pub fn lint(&self) -> &'static Lint {
pub(crate) fn lint(&self) -> &'static Lint {
match self {
AssertLintKind::ArithmeticOverflow => lint::builtin::ARITHMETIC_OVERFLOW,
AssertLintKind::UnconditionalPanic => lint::builtin::UNCONDITIONAL_PANIC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_target::spec::abi::Abi;

use crate::errors;

pub struct FunctionItemReferences;
pub(super) struct FunctionItemReferences;

impl<'tcx> crate::MirLint<'tcx> for FunctionItemReferences {
fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ use tracing::{debug, instrument, trace};

use crate::ssa::{AssignedValue, SsaLocals};

pub struct GVN;
pub(super) struct GVN;

impl<'tcx> crate::MirPass<'tcx> for GVN {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_mir_transform/src/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pub(crate) mod cycle;

const TOP_DOWN_DEPTH_LIMIT: usize = 5;

// Made public so that `mir_drops_elaborated_and_const_checked` can be overridden
// by custom rustc drivers, running all the steps by themselves. See #114628.
pub struct Inline;

#[derive(Copy, Clone, Debug)]
Expand Down
Loading