Skip to content

Commit

Permalink
Add warn(unreachable_pub) to rustc_transmute.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Sep 2, 2024
1 parent 2e358e6 commit e4b1e28
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_transmute/src/layout/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ pub(crate) mod rustc {
}

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)?;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_transmute/src/layout/tree/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::Tree;

#[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
pub enum Def {
enum Def {
NoSafetyInvariants,
HasSafetyInvariants,
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_transmute/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_transmute/src/maybe_transmutable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,13 @@ where
}
}

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>>,
Expand Down

0 comments on commit e4b1e28

Please sign in to comment.