Skip to content

Commit 6887927

Browse files
committed
Add warn(unreachable_pub) to rustc_infer.
1 parent 46fe09f commit 6887927

File tree

10 files changed

+12
-11
lines changed

10 files changed

+12
-11
lines changed

compiler/rustc_infer/src/errors/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_span::Span;
33

44
#[derive(Diagnostic)]
55
#[diag(infer_opaque_hidden_type)]
6-
pub struct OpaqueHiddenTypeDiag {
6+
pub(crate) struct OpaqueHiddenTypeDiag {
77
#[primary_span]
88
#[label]
99
pub span: Span,

compiler/rustc_infer/src/infer/free_regions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ pub(crate) struct RegionRelations<'a, 'tcx> {
1818
}
1919

2020
impl<'a, 'tcx> RegionRelations<'a, 'tcx> {
21-
pub fn new(tcx: TyCtxt<'tcx>, free_regions: &'a FreeRegionMap<'tcx>) -> Self {
21+
pub(crate) fn new(tcx: TyCtxt<'tcx>, free_regions: &'a FreeRegionMap<'tcx>) -> Self {
2222
Self { tcx, free_regions }
2323
}
2424

25-
pub fn lub_param_regions(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> Region<'tcx> {
25+
pub(crate) fn lub_param_regions(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> Region<'tcx> {
2626
self.free_regions.lub_param_regions(self.tcx, r_a, r_b)
2727
}
2828
}
@@ -80,7 +80,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
8080
/// cases, this is more conservative than necessary, in order to
8181
/// avoid making arbitrary choices. See
8282
/// `TransitiveRelation::postdom_upper_bound` for more details.
83-
pub fn lub_param_regions(
83+
pub(crate) fn lub_param_regions(
8484
&self,
8585
tcx: TyCtxt<'tcx>,
8686
r_a: Region<'tcx>,

compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub(crate) fn resolve<'tcx>(
4343
/// Contains the result of lexical region resolution. Offers methods
4444
/// to lookup up the final value of a region variable.
4545
#[derive(Clone)]
46-
pub struct LexicalRegionResolutions<'tcx> {
46+
pub(crate) struct LexicalRegionResolutions<'tcx> {
4747
pub(crate) values: IndexVec<RegionVid, VarValue<'tcx>>,
4848
}
4949

compiler/rustc_infer/src/infer/relate/generalize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
705705
/// not only the generalized type, but also a bool flag
706706
/// indicating whether further WF checks are needed.
707707
#[derive(Debug)]
708-
pub struct Generalization<T> {
708+
struct Generalization<T> {
709709
/// When generalizing `<?0 as Trait>::Assoc` or
710710
/// `<T as Bar<<?0 as Foo>::Assoc>>::Assoc`
711711
/// for `?0` generalization returns an inference

compiler/rustc_infer/src/infer/relate/lattice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::traits::ObligationCause;
2929
///
3030
/// GLB moves "down" the lattice (to smaller values); LUB moves
3131
/// "up" the lattice (to bigger values).
32-
pub trait LatticeDir<'f, 'tcx>: PredicateEmittingRelation<InferCtxt<'tcx>> {
32+
pub(crate) trait LatticeDir<'f, 'tcx>: PredicateEmittingRelation<InferCtxt<'tcx>> {
3333
fn infcx(&self) -> &'f InferCtxt<'tcx>;
3434

3535
fn cause(&self) -> &ObligationCause<'tcx>;

compiler/rustc_infer/src/infer/snapshot/fudge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<'tcx> InferCtxt<'tcx> {
170170
}
171171
}
172172

173-
pub struct InferenceFudger<'a, 'tcx> {
173+
struct InferenceFudger<'a, 'tcx> {
174174
infcx: &'a InferCtxt<'tcx>,
175175
type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>),
176176
int_vars: Range<IntVid>,

compiler/rustc_infer/src/infer/snapshot/undo_log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<'tcx> InferCtxtInner<'tcx> {
158158
}
159159

160160
impl<'tcx> InferCtxtUndoLogs<'tcx> {
161-
pub fn start_snapshot(&mut self) -> Snapshot<'tcx> {
161+
pub(crate) fn start_snapshot(&mut self) -> Snapshot<'tcx> {
162162
self.num_open_snapshots += 1;
163163
Snapshot { undo_len: self.logs.len(), _marker: PhantomData }
164164
}

compiler/rustc_infer/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#![feature(let_chains)]
2929
#![feature(rustdoc_internals)]
3030
#![recursion_limit = "512"] // For rustdoc
31+
#![warn(unreachable_pub)]
3132
// tidy-alphabetical-end
3233

3334
#[macro_use]

compiler/rustc_infer/src/traits/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub use self::engine::{FromSolverError, ScrubbedTraitError, TraitEngine};
2222
pub(crate) use self::project::UndoLog;
2323
pub use self::project::{
2424
MismatchedProjectionTypes, Normalized, NormalizedTerm, ProjectionCache, ProjectionCacheEntry,
25-
ProjectionCacheKey, ProjectionCacheStorage, Reveal,
25+
ProjectionCacheKey, ProjectionCacheStorage,
2626
};
2727
pub use self::ImplSource::*;
2828
pub use self::SelectionError::*;

compiler/rustc_infer/src/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use rustc_data_structures::snapshot_map::{self, SnapshotMapRef, SnapshotMapStorage};
44
use rustc_data_structures::undo_log::Rollback;
5-
pub use rustc_middle::traits::{EvaluationResult, Reveal};
5+
use rustc_middle::traits::EvaluationResult;
66
use rustc_middle::ty;
77

88
use super::PredicateObligation;

0 commit comments

Comments
 (0)