about summary refs log tree commit diff
path: root/compiler/rustc_public/src/unstable/internal_cx/helpers.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-07-22 00:54:27 +0800
committerGitHub <noreply@github.com>2025-07-22 00:54:27 +0800
commit2e0748b1858079062284e116d0730a8156a1dab7 (patch)
treef2b876b2b5cfe346eb7a73f9ded4e8d92edefb4a /compiler/rustc_public/src/unstable/internal_cx/helpers.rs
parent38efe3875aac14e282e64623e241acdf973d0f63 (diff)
parent20a7f722d824ebc4e733ec848d797088363624e9 (diff)
downloadrust-2e0748b1858079062284e116d0730a8156a1dab7.tar.gz
rust-2e0748b1858079062284e116d0730a8156a1dab7.zip
Rollup merge of #143985 - makai410:rp-rename, r=oli-obk
rustc_public: de-StableMIR-ize

This PR updates relevant docs about StableMIR, basically just rewording StableMIR/SMIR to rustc_public/rustc_public's IR.

The README.md in the `rustc_public` crate is out-dated. I plan to rewrite it after we fork rustc_public into its own repository.

This PR doesn't change the fact that we still use `-Z unpretty=stable-mir` as a rustc parameter for printing the IR, since I feel it's a bit verbose and weird if we use `-Z unpretty=rustc-public-ir`. I was wondering if we can have a short and easy alias for rustc_public's IR.
Diffstat (limited to 'compiler/rustc_public/src/unstable/internal_cx/helpers.rs')
-rw-r--r--compiler/rustc_public/src/unstable/internal_cx/helpers.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler/rustc_public/src/unstable/internal_cx/helpers.rs b/compiler/rustc_public/src/unstable/internal_cx/helpers.rs
new file mode 100644
index 00000000000..da635c04d74
--- /dev/null
+++ b/compiler/rustc_public/src/unstable/internal_cx/helpers.rs
@@ -0,0 +1,31 @@
+//! A set of traits that define a stable interface to rustc's internals.
+//!
+//! These traits are primarily used to clarify the behavior of different
+//! functions that share the same name across various contexts.
+
+use rustc_middle::ty;
+
+pub(crate) trait ExistentialProjectionHelpers<'tcx> {
+    fn new_from_args(
+        &self,
+        def_id: rustc_span::def_id::DefId,
+        args: ty::GenericArgsRef<'tcx>,
+        term: ty::Term<'tcx>,
+    ) -> ty::ExistentialProjection<'tcx>;
+}
+
+pub(crate) trait ExistentialTraitRefHelpers<'tcx> {
+    fn new_from_args(
+        &self,
+        trait_def_id: rustc_span::def_id::DefId,
+        args: ty::GenericArgsRef<'tcx>,
+    ) -> ty::ExistentialTraitRef<'tcx>;
+}
+
+pub(crate) trait TraitRefHelpers<'tcx> {
+    fn new_from_args(
+        &self,
+        trait_def_id: rustc_span::def_id::DefId,
+        args: ty::GenericArgsRef<'tcx>,
+    ) -> ty::TraitRef<'tcx>;
+}