Skip to content

Commit

Permalink
Add warn(unreachable_pub) to rustc_sanitizers.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Sep 2, 2024
1 parent bd53aa3 commit 19843bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ use crate::cfi::typeid::itanium_cxx_abi::transform::{TransformTy, TransformTyOpt
use crate::cfi::typeid::TypeIdOptions;

/// Options for encode_ty.
pub type EncodeTyOptions = TypeIdOptions;
pub(crate) type EncodeTyOptions = TypeIdOptions;

/// Substitution dictionary key.
#[derive(Eq, Hash, PartialEq)]
pub enum DictKey<'tcx> {
pub(crate) enum DictKey<'tcx> {
Ty(Ty<'tcx>, TyQ),
Region(Region<'tcx>),
Const(Const<'tcx>),
Expand All @@ -39,7 +39,7 @@ pub enum DictKey<'tcx> {

/// Type and extended type qualifiers.
#[derive(Eq, Hash, PartialEq)]
pub enum TyQ {
pub(crate) enum TyQ {
None,
Const,
Mut,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ use crate::cfi::typeid::itanium_cxx_abi::encode::EncodeTyOptions;
use crate::cfi::typeid::TypeIdOptions;

/// Options for transform_ty.
pub type TransformTyOptions = TypeIdOptions;
pub(crate) type TransformTyOptions = TypeIdOptions;

pub struct TransformTy<'tcx> {
pub(crate) struct TransformTy<'tcx> {
tcx: TyCtxt<'tcx>,
options: TransformTyOptions,
parents: Vec<Ty<'tcx>>,
}

impl<'tcx> TransformTy<'tcx> {
pub fn new(tcx: TyCtxt<'tcx>, options: TransformTyOptions) -> Self {
pub(crate) fn new(tcx: TyCtxt<'tcx>, options: TransformTyOptions) -> Self {
TransformTy { tcx, options, parents: Vec::new() }
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_sanitizers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// tidy-alphabetical-start
#![feature(let_chains)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end

pub mod cfi;
Expand Down

0 comments on commit 19843bb

Please sign in to comment.