@@ -25,44 +25,10 @@ use rustc_span::def_id::{CrateNum, DefId, LOCAL_CRATE};
25
25
use rustc_span:: { FileNameDisplayPreference , Span , Symbol } ;
26
26
use rustc_target:: callconv:: FnAbi ;
27
27
28
- use super :: {
29
- SmirAllocRange , SmirCtxt , SmirExistentialProjection , SmirExistentialTraitRef , SmirRegion ,
30
- SmirTraitRef , SmirTy , SmirTypingEnv ,
31
- } ;
28
+ use super :: { SmirAllocRange , SmirCtxt , SmirTy , SmirTypingEnv } ;
32
29
use crate :: rustc_smir:: builder:: BodyBuilder ;
33
30
use crate :: rustc_smir:: { Bridge , SmirError , Tables , filter_def_ids} ;
34
31
35
- impl < ' tcx , B : Bridge > SmirExistentialProjection < ' tcx > for SmirCtxt < ' tcx , B > {
36
- fn new_from_args (
37
- & self ,
38
- def_id : rustc_span:: def_id:: DefId ,
39
- args : ty:: GenericArgsRef < ' tcx > ,
40
- term : ty:: Term < ' tcx > ,
41
- ) -> ty:: ExistentialProjection < ' tcx > {
42
- ty:: ExistentialProjection :: new_from_args ( self . tcx , def_id, args, term)
43
- }
44
- }
45
-
46
- impl < ' tcx , B : Bridge > SmirExistentialTraitRef < ' tcx > for SmirCtxt < ' tcx , B > {
47
- fn new_from_args (
48
- & self ,
49
- trait_def_id : DefId ,
50
- args : ty:: GenericArgsRef < ' tcx > ,
51
- ) -> ty:: ExistentialTraitRef < ' tcx > {
52
- ty:: ExistentialTraitRef :: new_from_args ( self . tcx , trait_def_id, args)
53
- }
54
- }
55
-
56
- impl < ' tcx , B : Bridge > SmirTraitRef < ' tcx > for SmirCtxt < ' tcx , B > {
57
- fn new_from_args (
58
- & self ,
59
- trait_def_id : DefId ,
60
- args : ty:: GenericArgsRef < ' tcx > ,
61
- ) -> ty:: TraitRef < ' tcx > {
62
- ty:: TraitRef :: new_from_args ( self . tcx , trait_def_id, args)
63
- }
64
- }
65
-
66
32
impl < ' tcx , B : Bridge > SmirTy < ' tcx > for SmirCtxt < ' tcx , B > {
67
33
fn new_foreign ( & self , def_id : DefId ) -> ty:: Ty < ' tcx > {
68
34
ty:: Ty :: new_foreign ( self . tcx , def_id)
@@ -85,52 +51,11 @@ impl<'tcx, B: Bridge> SmirAllocRange<'tcx> for SmirCtxt<'tcx, B> {
85
51
}
86
52
}
87
53
88
- impl < ' tcx , B : Bridge > SmirRegion < ' tcx > for SmirCtxt < ' tcx , B > {
89
- fn lifetimes_re_erased ( & self ) -> ty:: Region < ' tcx > {
90
- self . tcx . lifetimes . re_erased
91
- }
92
- }
93
-
94
54
impl < ' tcx , B : Bridge > SmirCtxt < ' tcx , B > {
95
55
pub fn lift < T : ty:: Lift < TyCtxt < ' tcx > > > ( & self , value : T ) -> Option < T :: Lifted > {
96
56
self . tcx . lift ( value)
97
57
}
98
58
99
- pub fn mk_args_from_iter < I , T > ( & self , iter : I ) -> T :: Output
100
- where
101
- I : Iterator < Item = T > ,
102
- T : ty:: CollectAndApply < ty:: GenericArg < ' tcx > , ty:: GenericArgsRef < ' tcx > > ,
103
- {
104
- self . tcx . mk_args_from_iter ( iter)
105
- }
106
-
107
- pub fn mk_pat ( & self , v : ty:: PatternKind < ' tcx > ) -> ty:: Pattern < ' tcx > {
108
- self . tcx . mk_pat ( v)
109
- }
110
-
111
- pub fn mk_poly_existential_predicates (
112
- & self ,
113
- eps : & [ ty:: PolyExistentialPredicate < ' tcx > ] ,
114
- ) -> & ' tcx List < ty:: PolyExistentialPredicate < ' tcx > > {
115
- self . tcx . mk_poly_existential_predicates ( eps)
116
- }
117
-
118
- pub fn mk_type_list ( & self , v : & [ Ty < ' tcx > ] ) -> & ' tcx List < Ty < ' tcx > > {
119
- self . tcx . mk_type_list ( v)
120
- }
121
-
122
- pub fn mk_bound_variable_kinds_from_iter < I , T > ( & self , iter : I ) -> T :: Output
123
- where
124
- I : Iterator < Item = T > ,
125
- T : ty:: CollectAndApply < ty:: BoundVariableKind , & ' tcx List < ty:: BoundVariableKind > > ,
126
- {
127
- self . tcx . mk_bound_variable_kinds_from_iter ( iter)
128
- }
129
-
130
- pub fn mk_place_elems ( & self , v : & [ mir:: PlaceElem < ' tcx > ] ) -> & ' tcx List < mir:: PlaceElem < ' tcx > > {
131
- self . tcx . mk_place_elems ( v)
132
- }
133
-
134
59
pub fn adt_def ( & self , def_id : DefId ) -> AdtDef < ' tcx > {
135
60
self . tcx . adt_def ( def_id)
136
61
}
0 commit comments