@@ -100,7 +100,7 @@ fn run_pretty_test(cx: &cx, props: &test_props, testfile: &str) {
100
100
compare_source ( expected, actual) ;
101
101
102
102
// Finally, let's make sure it actually appears to remain valid code
103
- let procres = typecheck_source ( cx, actual) ;
103
+ let procres = typecheck_source ( cx, testfile , actual) ;
104
104
105
105
if procres. status != 0 {
106
106
fatal_procres ( "pretty-printed source does not typecheck" ,
@@ -139,9 +139,15 @@ actual:\n\
139
139
}
140
140
}
141
141
142
- fn typecheck_source ( cx : & cx , src : & str ) -> procres {
143
- // FIXME
144
- ret { status : 0 , stdout : src, stderr : "" , cmdline : "" } ;
142
+ fn typecheck_source ( cx : & cx , testfile : & str , src : & str ) -> procres {
143
+ compose_and_run ( cx, testfile, make_typecheck_args,
144
+ cx. config . compile_lib_path , option:: some ( src) )
145
+ }
146
+
147
+ fn make_typecheck_args ( config : & config , testfile : & str ) -> procargs {
148
+ let prog = config. rustc_path ;
149
+ let args = [ "-" , "--no-trans" ] ;
150
+ ret { prog : prog, args : args} ;
145
151
}
146
152
}
147
153
0 commit comments