@@ -82,7 +82,7 @@ pub enum InstantiationMode {
82
82
}
83
83
84
84
pub trait MonoItemExt < ' a , ' tcx > : fmt:: Debug {
85
- fn as_trans_item ( & self ) -> & MonoItem < ' tcx > ;
85
+ fn as_mono_item ( & self ) -> & MonoItem < ' tcx > ;
86
86
87
87
fn instantiation_mode ( & self ,
88
88
tcx : TyCtxt < ' a , ' tcx , ' tcx > )
@@ -92,7 +92,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug {
92
92
tcx. sess . opts . optimize != OptLevel :: No
93
93
} ) ;
94
94
95
- match * self . as_trans_item ( ) {
95
+ match * self . as_mono_item ( ) {
96
96
MonoItem :: Fn ( ref instance) => {
97
97
// If this function isn't inlined or otherwise has explicit
98
98
// linkage, then we'll be creating a globally shared version.
@@ -132,7 +132,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug {
132
132
}
133
133
134
134
fn explicit_linkage ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> Option < Linkage > {
135
- let def_id = match * self . as_trans_item ( ) {
135
+ let def_id = match * self . as_mono_item ( ) {
136
136
MonoItem :: Fn ( ref instance) => instance. def_id ( ) ,
137
137
MonoItem :: Static ( node_id) => tcx. hir . local_def_id ( node_id) ,
138
138
MonoItem :: GlobalAsm ( ..) => return None ,
@@ -182,7 +182,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug {
182
182
/// which will never be accessed) in its place.
183
183
fn is_instantiable ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> bool {
184
184
debug ! ( "is_instantiable({:?})" , self ) ;
185
- let ( def_id, substs) = match * self . as_trans_item ( ) {
185
+ let ( def_id, substs) = match * self . as_mono_item ( ) {
186
186
MonoItem :: Fn ( ref instance) => ( instance. def_id ( ) , instance. substs ) ,
187
187
MonoItem :: Static ( node_id) => ( tcx. hir . local_def_id ( node_id) , Substs :: empty ( ) ) ,
188
188
// global asm never has predicates
@@ -196,7 +196,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug {
196
196
fn to_string ( & self , tcx : TyCtxt < ' a , ' tcx , ' tcx > ) -> String {
197
197
let hir_map = & tcx. hir ;
198
198
199
- return match * self . as_trans_item ( ) {
199
+ return match * self . as_mono_item ( ) {
200
200
MonoItem :: Fn ( instance) => {
201
201
to_string_internal ( tcx, "fn " , instance)
202
202
} ,
@@ -224,7 +224,7 @@ pub trait MonoItemExt<'a, 'tcx>: fmt::Debug {
224
224
}
225
225
226
226
impl < ' a , ' tcx > MonoItemExt < ' a , ' tcx > for MonoItem < ' tcx > {
227
- fn as_trans_item ( & self ) -> & MonoItem < ' tcx > {
227
+ fn as_mono_item ( & self ) -> & MonoItem < ' tcx > {
228
228
self
229
229
}
230
230
}
0 commit comments