Add warn(unreachable_pub)
to rustc_smir
.
This commit is contained in:
parent
19ff6e6e63
commit
b457ab3186
@ -15,6 +15,7 @@
|
||||
)]
|
||||
#![doc(rust_logo)]
|
||||
#![feature(rustdoc_internals)]
|
||||
#![warn(unreachable_pub)]
|
||||
// tidy-alphabetical-end
|
||||
|
||||
pub mod rustc_internal;
|
||||
|
@ -20,7 +20,7 @@ fn new_empty_allocation(align: rustc_target::abi::Align) -> Allocation {
|
||||
// because we need to get `Ty` of the const we are trying to create, to do that
|
||||
// we need to have access to `ConstantKind` but we can't access that inside Stable impl.
|
||||
#[allow(rustc::usage_of_qualified_ty)]
|
||||
pub fn new_allocation<'tcx>(
|
||||
pub(crate) fn new_allocation<'tcx>(
|
||||
ty: rustc_middle::ty::Ty<'tcx>,
|
||||
const_value: ConstValue<'tcx>,
|
||||
tables: &mut Tables<'tcx>,
|
||||
@ -30,7 +30,7 @@ pub fn new_allocation<'tcx>(
|
||||
}
|
||||
|
||||
#[allow(rustc::usage_of_qualified_ty)]
|
||||
pub fn try_new_allocation<'tcx>(
|
||||
pub(crate) fn try_new_allocation<'tcx>(
|
||||
ty: rustc_middle::ty::Ty<'tcx>,
|
||||
const_value: ConstValue<'tcx>,
|
||||
tables: &mut Tables<'tcx>,
|
||||
|
@ -12,13 +12,13 @@
|
||||
use crate::rustc_smir::{Stable, Tables};
|
||||
|
||||
/// Builds a monomorphic body for a given instance.
|
||||
pub struct BodyBuilder<'tcx> {
|
||||
pub(crate) struct BodyBuilder<'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
instance: ty::Instance<'tcx>,
|
||||
}
|
||||
|
||||
impl<'tcx> BodyBuilder<'tcx> {
|
||||
pub fn new(tcx: TyCtxt<'tcx>, instance: ty::Instance<'tcx>) -> Self {
|
||||
pub(crate) fn new(tcx: TyCtxt<'tcx>, instance: ty::Instance<'tcx>) -> Self {
|
||||
let instance = match instance.def {
|
||||
// To get the fallback body of an intrinsic, we need to convert it to an item.
|
||||
ty::InstanceKind::Intrinsic(def_id) => ty::Instance::new(def_id, instance.args),
|
||||
@ -30,7 +30,7 @@ pub fn new(tcx: TyCtxt<'tcx>, instance: ty::Instance<'tcx>) -> Self {
|
||||
/// Build a stable monomorphic body for a given instance based on the MIR body.
|
||||
///
|
||||
/// All constants are also evaluated.
|
||||
pub fn build(mut self, tables: &mut Tables<'tcx>) -> stable_mir::mir::Body {
|
||||
pub(crate) fn build(mut self, tables: &mut Tables<'tcx>) -> stable_mir::mir::Body {
|
||||
let body = tables.tcx.instance_mir(self.instance.def).clone();
|
||||
let mono_body = if !self.instance.args.is_empty()
|
||||
// Without the `generic_const_exprs` feature gate, anon consts in signatures do not
|
||||
|
@ -784,7 +784,7 @@ fn unop_ty(&self, un_op: UnOp, arg: Ty) -> Ty {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TablesWrapper<'tcx>(pub RefCell<Tables<'tcx>>);
|
||||
pub(crate) struct TablesWrapper<'tcx>(pub RefCell<Tables<'tcx>>);
|
||||
|
||||
/// Implement error handling for extracting function ABI information.
|
||||
impl<'tcx> FnAbiOfHelpers<'tcx> for Tables<'tcx> {
|
||||
|
@ -9,7 +9,7 @@
|
||||
mod mir;
|
||||
mod ty;
|
||||
|
||||
pub use ty::mir_const_from_ty_const;
|
||||
pub(crate) use ty::mir_const_from_ty_const;
|
||||
|
||||
impl<'tcx> Stable<'tcx> for rustc_hir::Safety {
|
||||
type T = stable_mir::mir::Safety;
|
||||
|
@ -411,7 +411,7 @@ fn stable(&self, tables: &mut Tables<'_>) -> Self::T {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn mir_const_from_ty_const<'tcx>(
|
||||
pub(crate) fn mir_const_from_ty_const<'tcx>(
|
||||
tables: &mut Tables<'tcx>,
|
||||
ty_const: ty::Const<'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
|
Loading…
Reference in New Issue
Block a user