Add warn(unreachable_pub) to rustc_transmute.

This commit is contained in:
Nicholas Nethercote 2024-08-30 16:15:56 +10:00
parent 2e358e633d
commit e4b1e28033
4 changed files with 5 additions and 4 deletions

View File

@ -204,7 +204,7 @@ fn from(err: &LayoutError<'tcx>) -> Self {
}
impl<'tcx> Tree<Def<'tcx>, Ref<'tcx>> {
pub fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, Err> {
pub(crate) fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, Err> {
use rustc_target::abi::HasDataLayout;
let layout = layout_of(cx, ty)?;

View File

@ -1,7 +1,7 @@
use super::Tree;
#[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
pub enum Def {
enum Def {
NoSafetyInvariants,
HasSafetyInvariants,
}

View File

@ -2,6 +2,7 @@
#![allow(unused_variables)]
#![feature(alloc_layout_extra)]
#![feature(never_type)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end
pub(crate) use rustc_data_structures::fx::{FxIndexMap as Map, FxIndexSet as Set};

View File

@ -366,13 +366,13 @@ fn or<R>(lhs: Answer<R>, rhs: Answer<R>) -> Answer<R>
}
}
pub enum Quantifier {
enum Quantifier {
ThereExists,
ForAll,
}
impl Quantifier {
pub fn apply<R, I>(&self, iter: I) -> Answer<R>
fn apply<R, I>(&self, iter: I) -> Answer<R>
where
R: layout::Ref,
I: IntoIterator<Item = Answer<R>>,