about summary refs log tree commit diff
path: root/compiler/rustc_public_bridge/src/context/impls.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-21 19:48:22 +0000
committerbors <bors@rust-lang.org>2025-07-21 19:48:22 +0000
commit9748d87dc70a9a6725c5dbd76ce29d04752b4f90 (patch)
tree4cffbc92abe5995b0348e464ffe6a256f973e653 /compiler/rustc_public_bridge/src/context/impls.rs
parent3f9f20f71dd945fe7d044e274094a53c90788269 (diff)
parent6628a4afb5d08555f09878a48f0c4179e7582aa2 (diff)
downloadrust-9748d87dc70a9a6725c5dbd76ce29d04752b4f90.tar.gz
rust-9748d87dc70a9a6725c5dbd76ce29d04752b4f90.zip
Auto merge of #144269 - jieyouxu:rollup-137ysl2, r=jieyouxu
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#142097 (gpu offload host code generation)
 - rust-lang/rust#143430 (Lower extra lifetimes before normal generic params.)
 - rust-lang/rust#143768 (Constify Try, From, TryFrom and relevant traits)
 - rust-lang/rust#143816 (Implement `check` for compiletest and RA using tool macro)
 - rust-lang/rust#143985 (rustc_public: de-StableMIR-ize)
 - rust-lang/rust#144027 (clippy: make tests work in stage 1)
 - rust-lang/rust#144080 (Mitigate `#[align]` name resolution ambiguity regression with a rename)
 - rust-lang/rust#144176 (Add approval blocking labels for new bors)
 - rust-lang/rust#144187 (fix handling of base address for TypeId allocations)
 - rust-lang/rust#144212 (Remove the ptr_unique lang item)
 - rust-lang/rust#144243 (Subtree update of `rust-analyzer`)
 - rust-lang/rust#144246 (Don't use another main test file as auxiliary)
 - rust-lang/rust#144251 (rustc-dev-guide subtree update)
 - rust-lang/rust#144254 (opt-dist: make `artifact-dir` an absolute path for `opt-dist local`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_public_bridge/src/context/impls.rs')
-rw-r--r--compiler/rustc_public_bridge/src/context/impls.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs
index fdefad2821b..612e44b56b1 100644
--- a/compiler/rustc_public_bridge/src/context/impls.rs
+++ b/compiler/rustc_public_bridge/src/context/impls.rs
@@ -1,4 +1,4 @@
-//! Implementation of StableMIR Context.
+//! Implementation of CompilerCtxt.
 
 #![allow(rustc::usage_of_qualified_ty)]
 
@@ -24,23 +24,23 @@ use rustc_span::def_id::{CrateNum, DefId, LOCAL_CRATE};
 use rustc_span::{FileNameDisplayPreference, Span, Symbol};
 use rustc_target::callconv::FnAbi;
 
-use super::{SmirAllocRange, SmirCtxt, SmirTy, SmirTypingEnv};
+use super::{AllocRangeHelpers, CompilerCtxt, TyHelpers, TypingEnvHelpers};
 use crate::builder::BodyBuilder;
-use crate::{Bridge, SmirError, Tables, filter_def_ids};
+use crate::{Bridge, Error, Tables, filter_def_ids};
 
-impl<'tcx, B: Bridge> SmirTy<'tcx> for SmirCtxt<'tcx, B> {
+impl<'tcx, B: Bridge> TyHelpers<'tcx> for CompilerCtxt<'tcx, B> {
     fn new_foreign(&self, def_id: DefId) -> ty::Ty<'tcx> {
         ty::Ty::new_foreign(self.tcx, def_id)
     }
 }
 
-impl<'tcx, B: Bridge> SmirTypingEnv<'tcx> for SmirCtxt<'tcx, B> {
+impl<'tcx, B: Bridge> TypingEnvHelpers<'tcx> for CompilerCtxt<'tcx, B> {
     fn fully_monomorphized(&self) -> ty::TypingEnv<'tcx> {
         ty::TypingEnv::fully_monomorphized()
     }
 }
 
-impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B> {
+impl<'tcx, B: Bridge> AllocRangeHelpers<'tcx> for CompilerCtxt<'tcx, B> {
     fn alloc_range(
         &self,
         offset: rustc_abi::Size,
@@ -50,7 +50,7 @@ impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B> {
     }
 }
 
-impl<'tcx, B: Bridge> SmirCtxt<'tcx, B> {
+impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> {
     pub fn lift<T: ty::Lift<TyCtxt<'tcx>>>(&self, value: T) -> Option<T::Lifted> {
         self.tcx.lift(value)
     }
@@ -85,7 +85,7 @@ impl<'tcx, B: Bridge> SmirCtxt<'tcx, B> {
     /// Return whether the item has a body defined by the user.
     ///
     /// Note that intrinsics may have a placeholder body that shouldn't be used in practice.
-    /// In StableMIR, we handle this case as if the body is not available.
+    /// In rustc_public, we handle this case as if the body is not available.
     pub(crate) fn item_has_body(&self, def_id: DefId) -> bool {
         let must_override = if let Some(intrinsic) = self.tcx.intrinsic(def_id) {
             intrinsic.must_be_overridden
@@ -426,7 +426,7 @@ impl<'tcx, B: Bridge> SmirCtxt<'tcx, B> {
 
     /// Evaluate constant as a target usize.
     pub fn eval_target_usize(&self, cnst: MirConst<'tcx>) -> Result<u64, B::Error> {
-        use crate::context::SmirTypingEnv;
+        use crate::context::TypingEnvHelpers;
         cnst.try_eval_target_usize(self.tcx, self.fully_monomorphized())
             .ok_or_else(|| B::Error::new(format!("Const `{cnst:?}` cannot be encoded as u64")))
     }