@@ -196,16 +196,16 @@ fn T_array(TypeRef t, uint n) -> TypeRef {
196
196
ret llvm. LLVMArrayType ( t, n) ;
197
197
}
198
198
199
- fn T_vec ( TypeRef t, uint n ) -> TypeRef {
200
- ret T_struct ( vec ( T_int ( ) , // Refcount
201
- T_int ( ) , // Alloc
202
- T_int ( ) , // Fill
203
- T_array ( t, n ) // Body elements
199
+ fn T_vec ( TypeRef t) -> TypeRef {
200
+ ret T_struct ( vec ( T_int ( ) , // Refcount
201
+ T_int ( ) , // Alloc
202
+ T_int ( ) , // Fill
203
+ T_array ( t, 0 u ) // Body elements
204
204
) ) ;
205
205
}
206
206
207
- fn T_str ( uint n ) -> TypeRef {
208
- ret T_vec ( T_i8 ( ) , n ) ;
207
+ fn T_str ( ) -> TypeRef {
208
+ ret T_vec ( T_i8 ( ) ) ;
209
209
}
210
210
211
211
fn T_box ( TypeRef t) -> TypeRef {
@@ -265,12 +265,12 @@ fn type_of_inner(@crate_ctxt cx, @typeck.ty t) -> TypeRef {
265
265
}
266
266
}
267
267
case ( typeck. ty_char ) { ret T_char ( ) ; }
268
- case ( typeck. ty_str ) { ret T_str ( 0 u ) ; }
268
+ case ( typeck. ty_str ) { ret T_ptr ( T_str ( ) ) ; }
269
269
case ( typeck. ty_box ( ?t) ) {
270
270
ret T_ptr ( T_box ( type_of ( cx, t) ) ) ;
271
271
}
272
272
case ( typeck. ty_vec ( ?t) ) {
273
- ret T_ptr ( T_vec ( type_of ( cx, t) , 0 u ) ) ;
273
+ ret T_ptr ( T_vec ( type_of ( cx, t) ) ) ;
274
274
}
275
275
case ( typeck. ty_tup ( ?elts) ) {
276
276
let vec[ TypeRef ] tys = vec ( ) ;
@@ -544,7 +544,7 @@ impure fn trans_lit(@block_ctxt cx, &ast.lit lit) -> result {
544
544
vec ( p2i ( C_str ( cx. fcx . ccx , s) ) ,
545
545
C_int ( len) ) ) ;
546
546
sub. val = sub. bcx . build . IntToPtr ( sub. val ,
547
- T_ptr ( T_str ( len as uint ) ) ) ;
547
+ T_ptr ( T_str ( ) ) ) ;
548
548
cx. cleanups += vec ( clean ( bind trans_drop_str ( _, sub. val ) ) ) ;
549
549
ret sub;
550
550
}
0 commit comments