File tree 3 files changed +5
-8
lines changed
3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
206
206
let len = s. as_str ( ) . len ( ) ;
207
207
let cs = consts:: ptrcast (
208
208
self . const_cstr ( s, false ) ,
209
- self . type_ptr_to ( self . layout_of ( self . tcx . mk_str ( ) ) . llvm_type ( self ) ) ,
209
+ self . type_ptr_to ( self . layout_of ( self . tcx . types . str_ ) . llvm_type ( self ) ) ,
210
210
) ;
211
211
( cs, self . const_usize ( len as u64 ) )
212
212
}
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ pub struct CommonTypes<'tcx> {
156
156
pub u128 : Ty < ' tcx > ,
157
157
pub f32 : Ty < ' tcx > ,
158
158
pub f64 : Ty < ' tcx > ,
159
+ pub str_ : Ty < ' tcx > ,
159
160
pub never : Ty < ' tcx > ,
160
161
pub self_param : Ty < ' tcx > ,
161
162
pub err : Ty < ' tcx > ,
@@ -832,6 +833,7 @@ impl<'tcx> CommonTypes<'tcx> {
832
833
u128 : mk ( Uint ( ast:: UintTy :: U128 ) ) ,
833
834
f32 : mk ( Float ( ast:: FloatTy :: F32 ) ) ,
834
835
f64 : mk ( Float ( ast:: FloatTy :: F64 ) ) ,
836
+ str_ : mk ( Str ) ,
835
837
self_param : mk ( ty:: Param ( ty:: ParamTy { index : 0 , name : kw:: SelfUpper } ) ) ,
836
838
837
839
trait_object_dummy_self : mk ( Infer ( ty:: FreshTy ( 0 ) ) ) ,
@@ -2121,14 +2123,9 @@ impl<'tcx> TyCtxt<'tcx> {
2121
2123
}
2122
2124
}
2123
2125
2124
- #[ inline]
2125
- pub fn mk_str ( self ) -> Ty < ' tcx > {
2126
- self . mk_ty ( Str )
2127
- }
2128
-
2129
2126
#[ inline]
2130
2127
pub fn mk_static_str ( self ) -> Ty < ' tcx > {
2131
- self . mk_imm_ref ( self . lifetimes . re_static , self . mk_str ( ) )
2128
+ self . mk_imm_ref ( self . lifetimes . re_static , self . types . str_ )
2132
2129
}
2133
2130
2134
2131
#[ inline]
Original file line number Diff line number Diff line change @@ -2698,7 +2698,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2698
2698
hir:: PrimTy :: Int ( it) => tcx. mk_mach_int ( it) ,
2699
2699
hir:: PrimTy :: Uint ( uit) => tcx. mk_mach_uint ( uit) ,
2700
2700
hir:: PrimTy :: Float ( ft) => tcx. mk_mach_float ( ft) ,
2701
- hir:: PrimTy :: Str => tcx. mk_str ( ) ,
2701
+ hir:: PrimTy :: Str => tcx. types . str_ ,
2702
2702
}
2703
2703
}
2704
2704
Res :: Err => {
You can’t perform that action at this time.
0 commit comments