use "helper" as a more descriptive name
This commit is contained in:
@@ -59,7 +59,7 @@ pub(crate) fn try_new_allocation<'tcx>(
|
||||
}
|
||||
ConstValue::Indirect { alloc_id, offset } => {
|
||||
let alloc = alloc::try_new_indirect(alloc_id, cx);
|
||||
use rustc_public_bridge::context::SmirAllocRange;
|
||||
use rustc_public_bridge::context::AllocRangeHelpers;
|
||||
Ok(allocation_filter(&alloc.0, cx.alloc_range(offset, layout.size), tables, cx))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ impl<'tcx> CompilerInterface for Container<'tcx, BridgeTys> {
|
||||
DefKind::Fn => ForeignItemKind::Fn(tables.fn_def(def_id)),
|
||||
DefKind::Static { .. } => ForeignItemKind::Static(tables.static_def(def_id)),
|
||||
DefKind::ForeignTy => {
|
||||
use rustc_public_bridge::context::SmirTy;
|
||||
use rustc_public_bridge::context::TyHelpers;
|
||||
ForeignItemKind::Type(tables.intern_ty(cx.new_foreign(def_id)))
|
||||
}
|
||||
def_kind => unreachable!("Unexpected kind for a foreign item: {:?}", def_kind),
|
||||
|
||||
@@ -504,7 +504,7 @@ impl RustcInternal for ExistentialProjection {
|
||||
tables: &mut Tables<'_, BridgeTys>,
|
||||
tcx: impl InternalCx<'tcx>,
|
||||
) -> Self::T<'tcx> {
|
||||
use crate::unstable::internal_cx::SmirExistentialProjection;
|
||||
use crate::unstable::internal_cx::ExistentialProjectionHelpers;
|
||||
tcx.new_from_args(
|
||||
self.def_id.0.internal(tables, tcx),
|
||||
self.generic_args.internal(tables, tcx),
|
||||
@@ -536,7 +536,7 @@ impl RustcInternal for ExistentialTraitRef {
|
||||
tables: &mut Tables<'_, BridgeTys>,
|
||||
tcx: impl InternalCx<'tcx>,
|
||||
) -> Self::T<'tcx> {
|
||||
use crate::unstable::internal_cx::SmirExistentialTraitRef;
|
||||
use crate::unstable::internal_cx::ExistentialTraitRefHelpers;
|
||||
tcx.new_from_args(
|
||||
self.def_id.0.internal(tables, tcx),
|
||||
self.generic_args.internal(tables, tcx),
|
||||
@@ -552,7 +552,7 @@ impl RustcInternal for TraitRef {
|
||||
tables: &mut Tables<'_, BridgeTys>,
|
||||
tcx: impl InternalCx<'tcx>,
|
||||
) -> Self::T<'tcx> {
|
||||
use crate::unstable::internal_cx::SmirTraitRef;
|
||||
use crate::unstable::internal_cx::TraitRefHelpers;
|
||||
tcx.new_from_args(self.def_id.0.internal(tables, tcx), self.args().internal(tables, tcx))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,7 +821,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::Allocation {
|
||||
tables: &mut Tables<'cx, BridgeTys>,
|
||||
cx: &CompilerCtxt<'cx, BridgeTys>,
|
||||
) -> Self::T {
|
||||
use rustc_public_bridge::context::SmirAllocRange;
|
||||
use rustc_public_bridge::context::AllocRangeHelpers;
|
||||
alloc::allocation_filter(
|
||||
self,
|
||||
cx.alloc_range(rustc_abi::Size::ZERO, self.size()),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
use rustc_middle::ty;
|
||||
|
||||
pub(crate) trait SmirExistentialProjection<'tcx> {
|
||||
pub(crate) trait ExistentialProjectionHelpers<'tcx> {
|
||||
fn new_from_args(
|
||||
&self,
|
||||
def_id: rustc_span::def_id::DefId,
|
||||
@@ -14,7 +14,7 @@ pub(crate) trait SmirExistentialProjection<'tcx> {
|
||||
) -> ty::ExistentialProjection<'tcx>;
|
||||
}
|
||||
|
||||
pub(crate) trait SmirExistentialTraitRef<'tcx> {
|
||||
pub(crate) trait ExistentialTraitRefHelpers<'tcx> {
|
||||
fn new_from_args(
|
||||
&self,
|
||||
trait_def_id: rustc_span::def_id::DefId,
|
||||
@@ -22,7 +22,7 @@ pub(crate) trait SmirExistentialTraitRef<'tcx> {
|
||||
) -> ty::ExistentialTraitRef<'tcx>;
|
||||
}
|
||||
|
||||
pub(crate) trait SmirTraitRef<'tcx> {
|
||||
pub(crate) trait TraitRefHelpers<'tcx> {
|
||||
fn new_from_args(
|
||||
&self,
|
||||
trait_def_id: rustc_span::def_id::DefId,
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
use rustc_middle::ty::{List, Ty, TyCtxt};
|
||||
use rustc_middle::{mir, ty};
|
||||
pub(crate) use traits::*;
|
||||
pub(crate) use helpers::*;
|
||||
|
||||
use super::InternalCx;
|
||||
|
||||
pub(crate) mod traits;
|
||||
pub(crate) mod helpers;
|
||||
|
||||
impl<'tcx, T: InternalCx<'tcx>> SmirExistentialProjection<'tcx> for T {
|
||||
impl<'tcx, T: InternalCx<'tcx>> ExistentialProjectionHelpers<'tcx> for T {
|
||||
fn new_from_args(
|
||||
&self,
|
||||
def_id: rustc_span::def_id::DefId,
|
||||
@@ -19,7 +19,7 @@ impl<'tcx, T: InternalCx<'tcx>> SmirExistentialProjection<'tcx> for T {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, T: InternalCx<'tcx>> SmirExistentialTraitRef<'tcx> for T {
|
||||
impl<'tcx, T: InternalCx<'tcx>> ExistentialTraitRefHelpers<'tcx> for T {
|
||||
fn new_from_args(
|
||||
&self,
|
||||
trait_def_id: rustc_span::def_id::DefId,
|
||||
@@ -29,7 +29,7 @@ impl<'tcx, T: InternalCx<'tcx>> SmirExistentialTraitRef<'tcx> for T {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, T: InternalCx<'tcx>> SmirTraitRef<'tcx> for T {
|
||||
impl<'tcx, T: InternalCx<'tcx>> TraitRefHelpers<'tcx> for T {
|
||||
fn new_from_args(
|
||||
&self,
|
||||
trait_def_id: rustc_span::def_id::DefId,
|
||||
|
||||
Reference in New Issue
Block a user