Add warn(unreachable_pub) to rustc_sanitizers.

This commit is contained in:
Nicholas Nethercote 2024-08-30 10:28:52 +10:00
parent bd53aa3bf7
commit 19843bba64
3 changed files with 7 additions and 6 deletions

View File

@ -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>),
@ -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,

View File

@ -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() }
}
}

View File

@ -5,6 +5,7 @@
// tidy-alphabetical-start
#![feature(let_chains)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end
pub mod cfi;