@@ -121,7 +121,7 @@ pub fn sizing_type_of(cx: &CrateContext, t: ty::t) -> Type {
121
121
ty:: ty_ptr( ..) => Type :: i8p ( cx) ,
122
122
ty:: ty_rptr( _, mt) => {
123
123
match ty:: get ( mt. ty ) . sty {
124
- ty:: ty_vec( _, None ) | ty:: ty_str( None ) => {
124
+ ty:: ty_vec( _, None ) | ty:: ty_str => {
125
125
Type :: struct_ ( cx, [ Type :: i8p ( cx) , Type :: i8p ( cx) ] , false )
126
126
}
127
127
_ => Type :: i8p ( cx) ,
@@ -132,7 +132,6 @@ pub fn sizing_type_of(cx: &CrateContext, t: ty::t) -> Type {
132
132
ty:: ty_closure( ..) => Type :: struct_ ( cx, [ Type :: i8p ( cx) , Type :: i8p ( cx) ] , false ) ,
133
133
ty:: ty_trait( ..) => Type :: opaque_trait ( cx) ,
134
134
135
- ty:: ty_str( Some ( size) ) => Type :: array ( & Type :: i8 ( cx) , size as u64 ) ,
136
135
ty:: ty_vec( mt, Some ( size) ) => {
137
136
Type :: array ( & sizing_type_of ( cx, mt. ty ) , size as u64 )
138
137
}
@@ -154,7 +153,7 @@ pub fn sizing_type_of(cx: &CrateContext, t: ty::t) -> Type {
154
153
}
155
154
156
155
ty:: ty_self( _) | ty:: ty_infer( ..) | ty:: ty_param( ..) |
157
- ty:: ty_err( ..) | ty:: ty_vec( _, None ) | ty:: ty_str( None ) => {
156
+ ty:: ty_err( ..) | ty:: ty_vec( _, None ) | ty:: ty_str => {
158
157
cx. sess ( ) . bug ( format ! ( "fictitious type {:?} in sizing_type_of()" ,
159
158
ty:: get( t) . sty) )
160
159
}
@@ -215,7 +214,7 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type {
215
214
ty:: ty_uniq( typ) => {
216
215
match ty:: get ( typ) . sty {
217
216
ty:: ty_vec( mt, None ) => Type :: vec ( cx, & type_of ( cx, mt. ty ) ) . ptr_to ( ) ,
218
- ty:: ty_str( None ) => Type :: vec ( cx, & Type :: i8 ( cx) ) . ptr_to ( ) ,
217
+ ty:: ty_str => Type :: vec ( cx, & Type :: i8 ( cx) ) . ptr_to ( ) ,
219
218
_ => type_of ( cx, typ) . ptr_to ( ) ,
220
219
}
221
220
}
@@ -227,18 +226,14 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type {
227
226
let u_ty = Type :: uint_from_ty ( cx, ast:: TyU ) ;
228
227
Type :: struct_ ( cx, [ p_ty, u_ty] , false )
229
228
}
230
- ty:: ty_str( None ) => {
229
+ ty:: ty_str => {
231
230
// This means we get a nicer name in the output
232
231
cx. tn . find_type ( "str_slice" ) . unwrap ( )
233
232
}
234
233
_ => type_of ( cx, mt. ty ) . ptr_to ( ) ,
235
234
}
236
235
}
237
236
238
- ty:: ty_str( Some ( n) ) => {
239
- Type :: array ( & Type :: i8 ( cx) , ( n + 1 u) as u64 )
240
- }
241
-
242
237
ty:: ty_vec( ref mt, Some ( n) ) => {
243
238
Type :: array ( & type_of ( cx, mt. ty ) , n as u64 )
244
239
}
@@ -274,7 +269,7 @@ pub fn type_of(cx: &CrateContext, t: ty::t) -> Type {
274
269
}
275
270
276
271
ty:: ty_vec( _, None ) => cx. sess ( ) . bug ( "type_of with unsized ty_vec" ) ,
277
- ty:: ty_str( None ) => cx. sess ( ) . bug ( "type_of with unsized ty_str" ) ,
272
+ ty:: ty_str => cx. sess ( ) . bug ( "type_of with unsized (bare) ty_str" ) ,
278
273
ty:: ty_self( ..) => cx. sess ( ) . unimpl ( "type_of with ty_self" ) ,
279
274
ty:: ty_infer( ..) => cx. sess ( ) . bug ( "type_of with ty_infer" ) ,
280
275
ty:: ty_param( ..) => cx. sess ( ) . bug ( "type_of with ty_param" ) ,
0 commit comments