@@ -165,7 +165,7 @@ fn nospan[T](&T t) -> ast::spanned[T] {
165
165
}
166
166
167
167
fn mk_tests ( & test_ctxt cx) -> @ast:: item {
168
- auto ret_ty = mk_test_desc_ivec_ty ( ) ;
168
+ auto ret_ty = mk_test_desc_ivec_ty ( cx ) ;
169
169
170
170
let ast:: fn_decl decl = rec ( inputs = ~[ ] ,
171
171
output = ret_ty,
@@ -204,23 +204,16 @@ fn empty_fn_ty() -> ast::ty {
204
204
ret nospan ( ast:: ty_fn ( proto, input_ty, ret_ty, cf, constrs) ) ;
205
205
}
206
206
207
- // The ast::ty of std::test::test_desc
208
- fn mk_test_desc_ivec_ty ( ) -> @ast:: ty {
209
- // Oh this is brutal to build by hand
210
- let ast:: mt name_mt = rec ( ty = @nospan ( ast:: ty_str) ,
211
- mut = ast:: imm) ;
212
- let ast:: mt fn_mt = rec ( ty = @empty_fn_ty ( ) ,
213
- mut = ast:: imm) ;
214
-
215
- let ast:: ty_field_ name_ty_field_ = rec ( ident = "name" ,
216
- mt = name_mt) ;
207
+ // The ast::ty of std::test::test_desc[]
208
+ fn mk_test_desc_ivec_ty ( & test_ctxt cx) -> @ast:: ty {
209
+ let ast:: path test_desc_ty_path = nospan ( rec ( global = false ,
210
+ idents = ~[ "std" ,
211
+ "test" ,
212
+ "test_desc" ] ,
213
+ types = ~[ ] ) ) ;
217
214
218
- let ast:: ty_field_ fn_ty_field_ = rec ( ident = "fn" ,
219
- mt = fn_mt) ;
220
-
221
- let ast:: ty_field[ ] test_desc_fields = ~[ nospan ( name_ty_field_) ,
222
- nospan ( fn_ty_field_) ] ;
223
- let ast:: ty test_desc_ty = nospan ( ast:: ty_rec ( test_desc_fields) ) ;
215
+ let ast:: ty test_desc_ty = nospan ( ast:: ty_path ( test_desc_ty_path,
216
+ cx. next_node_id ( ) ) ) ;
224
217
225
218
let ast:: mt ivec_mt = rec ( ty = @test_desc_ty,
226
219
mut = ast:: imm) ;
0 commit comments