mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
Add warn(unreachable_pub)
to rustc_infer
.
This commit is contained in:
parent
46fe09f3f3
commit
688792715b
@ -3,7 +3,7 @@ use rustc_span::Span;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(infer_opaque_hidden_type)]
|
||||
pub struct OpaqueHiddenTypeDiag {
|
||||
pub(crate) struct OpaqueHiddenTypeDiag {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
|
@ -18,11 +18,11 @@ pub(crate) struct RegionRelations<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> RegionRelations<'a, 'tcx> {
|
||||
pub fn new(tcx: TyCtxt<'tcx>, free_regions: &'a FreeRegionMap<'tcx>) -> Self {
|
||||
pub(crate) fn new(tcx: TyCtxt<'tcx>, free_regions: &'a FreeRegionMap<'tcx>) -> Self {
|
||||
Self { tcx, free_regions }
|
||||
}
|
||||
|
||||
pub fn lub_param_regions(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> Region<'tcx> {
|
||||
pub(crate) fn lub_param_regions(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> Region<'tcx> {
|
||||
self.free_regions.lub_param_regions(self.tcx, r_a, r_b)
|
||||
}
|
||||
}
|
||||
@ -80,7 +80,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
|
||||
/// cases, this is more conservative than necessary, in order to
|
||||
/// avoid making arbitrary choices. See
|
||||
/// `TransitiveRelation::postdom_upper_bound` for more details.
|
||||
pub fn lub_param_regions(
|
||||
pub(crate) fn lub_param_regions(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
r_a: Region<'tcx>,
|
||||
|
@ -43,7 +43,7 @@ pub(crate) fn resolve<'tcx>(
|
||||
/// Contains the result of lexical region resolution. Offers methods
|
||||
/// to lookup up the final value of a region variable.
|
||||
#[derive(Clone)]
|
||||
pub struct LexicalRegionResolutions<'tcx> {
|
||||
pub(crate) struct LexicalRegionResolutions<'tcx> {
|
||||
pub(crate) values: IndexVec<RegionVid, VarValue<'tcx>>,
|
||||
}
|
||||
|
||||
|
@ -705,7 +705,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
|
||||
/// not only the generalized type, but also a bool flag
|
||||
/// indicating whether further WF checks are needed.
|
||||
#[derive(Debug)]
|
||||
pub struct Generalization<T> {
|
||||
struct Generalization<T> {
|
||||
/// When generalizing `<?0 as Trait>::Assoc` or
|
||||
/// `<T as Bar<<?0 as Foo>::Assoc>>::Assoc`
|
||||
/// for `?0` generalization returns an inference
|
||||
|
@ -29,7 +29,7 @@ use crate::traits::ObligationCause;
|
||||
///
|
||||
/// GLB moves "down" the lattice (to smaller values); LUB moves
|
||||
/// "up" the lattice (to bigger values).
|
||||
pub trait LatticeDir<'f, 'tcx>: PredicateEmittingRelation<InferCtxt<'tcx>> {
|
||||
pub(crate) trait LatticeDir<'f, 'tcx>: PredicateEmittingRelation<InferCtxt<'tcx>> {
|
||||
fn infcx(&self) -> &'f InferCtxt<'tcx>;
|
||||
|
||||
fn cause(&self) -> &ObligationCause<'tcx>;
|
||||
|
@ -170,7 +170,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct InferenceFudger<'a, 'tcx> {
|
||||
struct InferenceFudger<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'tcx>,
|
||||
type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>),
|
||||
int_vars: Range<IntVid>,
|
||||
|
@ -158,7 +158,7 @@ impl<'tcx> InferCtxtInner<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> InferCtxtUndoLogs<'tcx> {
|
||||
pub fn start_snapshot(&mut self) -> Snapshot<'tcx> {
|
||||
pub(crate) fn start_snapshot(&mut self) -> Snapshot<'tcx> {
|
||||
self.num_open_snapshots += 1;
|
||||
Snapshot { undo_len: self.logs.len(), _marker: PhantomData }
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#![feature(let_chains)]
|
||||
#![feature(rustdoc_internals)]
|
||||
#![recursion_limit = "512"] // For rustdoc
|
||||
#![warn(unreachable_pub)]
|
||||
// tidy-alphabetical-end
|
||||
|
||||
#[macro_use]
|
||||
|
@ -22,7 +22,7 @@ pub use self::engine::{FromSolverError, ScrubbedTraitError, TraitEngine};
|
||||
pub(crate) use self::project::UndoLog;
|
||||
pub use self::project::{
|
||||
MismatchedProjectionTypes, Normalized, NormalizedTerm, ProjectionCache, ProjectionCacheEntry,
|
||||
ProjectionCacheKey, ProjectionCacheStorage, Reveal,
|
||||
ProjectionCacheKey, ProjectionCacheStorage,
|
||||
};
|
||||
pub use self::ImplSource::*;
|
||||
pub use self::SelectionError::*;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use rustc_data_structures::snapshot_map::{self, SnapshotMapRef, SnapshotMapStorage};
|
||||
use rustc_data_structures::undo_log::Rollback;
|
||||
pub use rustc_middle::traits::{EvaluationResult, Reveal};
|
||||
use rustc_middle::traits::EvaluationResult;
|
||||
use rustc_middle::ty;
|
||||
|
||||
use super::PredicateObligation;
|
||||
|
Loading…
Reference in New Issue
Block a user