stable_mir/unstable/internal_cx/
traits.rs

1//! A set of traits that define a stable interface to rustc's internals.
2//!
3//! These traits are primarily used to clarify the behavior of different
4//! functions that share the same name across various contexts.
5
6use rustc_middle::ty;
7
8pub(crate) trait SmirExistentialProjection<'tcx> {
9    fn new_from_args(
10        &self,
11        def_id: rustc_span::def_id::DefId,
12        args: ty::GenericArgsRef<'tcx>,
13        term: ty::Term<'tcx>,
14    ) -> ty::ExistentialProjection<'tcx>;
15}
16
17pub(crate) trait SmirExistentialTraitRef<'tcx> {
18    fn new_from_args(
19        &self,
20        trait_def_id: rustc_span::def_id::DefId,
21        args: ty::GenericArgsRef<'tcx>,
22    ) -> ty::ExistentialTraitRef<'tcx>;
23}
24
25pub(crate) trait SmirTraitRef<'tcx> {
26    fn new_from_args(
27        &self,
28        trait_def_id: rustc_span::def_id::DefId,
29        args: ty::GenericArgsRef<'tcx>,
30    ) -> ty::TraitRef<'tcx>;
31}