Skip to content

Commit e4b1e28

Browse files
committed
Add warn(unreachable_pub) to rustc_transmute.
1 parent 2e358e6 commit e4b1e28

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Diff for: compiler/rustc_transmute/src/layout/tree.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub(crate) mod rustc {
204204
}
205205

206206
impl<'tcx> Tree<Def<'tcx>, Ref<'tcx>> {
207-
pub fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, Err> {
207+
pub(crate) fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx, TyCtxt<'tcx>>) -> Result<Self, Err> {
208208
use rustc_target::abi::HasDataLayout;
209209
let layout = layout_of(cx, ty)?;
210210

Diff for: compiler/rustc_transmute/src/layout/tree/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::Tree;
22

33
#[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
4-
pub enum Def {
4+
enum Def {
55
NoSafetyInvariants,
66
HasSafetyInvariants,
77
}

Diff for: compiler/rustc_transmute/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![allow(unused_variables)]
33
#![feature(alloc_layout_extra)]
44
#![feature(never_type)]
5+
#![warn(unreachable_pub)]
56
// tidy-alphabetical-end
67

78
pub(crate) use rustc_data_structures::fx::{FxIndexMap as Map, FxIndexSet as Set};

Diff for: compiler/rustc_transmute/src/maybe_transmutable/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,13 @@ where
366366
}
367367
}
368368

369-
pub enum Quantifier {
369+
enum Quantifier {
370370
ThereExists,
371371
ForAll,
372372
}
373373

374374
impl Quantifier {
375-
pub fn apply<R, I>(&self, iter: I) -> Answer<R>
375+
fn apply<R, I>(&self, iter: I) -> Answer<R>
376376
where
377377
R: layout::Ref,
378378
I: IntoIterator<Item = Answer<R>>,

0 commit comments

Comments
 (0)