about summary refs log tree commit diff
path: root/compiler/rustc_public/src/unstable/internal_cx/helpers.rs
blob: da635c04d7442bf8a5b77fe81b67bdea9f960bc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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>;
}