@@ -260,7 +260,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
260260 let old = io:: set_panic ( Some ( box Sink ( data. clone ( ) ) ) ) ;
261261 let _bomb = Bomb ( data. clone ( ) , old. unwrap_or ( box io:: stdout ( ) ) ) ;
262262
263- let ( libdir, outdir) = driver:: spawn_thread_pool ( sessopts, |sessopts| {
263+ let ( libdir, outdir, compile_result ) = driver:: spawn_thread_pool ( sessopts, |sessopts| {
264264 let codemap = Lrc :: new ( CodeMap :: new_doctest (
265265 sessopts. file_path_mapping ( ) , filename. clone ( ) , line as isize - line_offset as isize
266266 ) ) ;
@@ -312,28 +312,28 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
312312 Err ( _) | Ok ( Err ( CompileIncomplete :: Errored ( _) ) ) => Err ( ( ) )
313313 } ;
314314
315- match ( compile_result, compile_fail) {
316- ( Ok ( ( ) ) , true ) => {
317- panic ! ( "test compiled while it wasn't supposed to" )
318- }
319- ( Ok ( ( ) ) , false ) => { }
320- ( Err ( ( ) ) , true ) => {
321- if error_codes. len ( ) > 0 {
322- let out = String :: from_utf8 ( data. lock ( ) . unwrap ( ) . to_vec ( ) ) . unwrap ( ) ;
323- error_codes. retain ( |err| !out. contains ( err) ) ;
324- }
325- }
326- ( Err ( ( ) ) , false ) => {
327- panic ! ( "couldn't compile the test" )
315+ ( libdir, outdir, compile_result)
316+ } ) ;
317+
318+ match ( compile_result, compile_fail) {
319+ ( Ok ( ( ) ) , true ) => {
320+ panic ! ( "test compiled while it wasn't supposed to" )
321+ }
322+ ( Ok ( ( ) ) , false ) => { }
323+ ( Err ( ( ) ) , true ) => {
324+ if error_codes. len ( ) > 0 {
325+ let out = String :: from_utf8 ( data. lock ( ) . unwrap ( ) . to_vec ( ) ) . unwrap ( ) ;
326+ error_codes. retain ( |err| !out. contains ( err) ) ;
328327 }
329328 }
330-
331- if error_codes. len ( ) > 0 {
332- panic ! ( "Some expected error codes were not found: {:?}" , error_codes) ;
329+ ( Err ( ( ) ) , false ) => {
330+ panic ! ( "couldn't compile the test" )
333331 }
332+ }
334333
335- ( libdir, outdir)
336- } ) ;
334+ if error_codes. len ( ) > 0 {
335+ panic ! ( "Some expected error codes were not found: {:?}" , error_codes) ;
336+ }
337337
338338 if no_run { return }
339339
0 commit comments