@@ -123,7 +123,8 @@ pub fn run(input_path: &Path,
123123 maybe_sysroot,
124124 Some ( codemap) ,
125125 None ,
126- linker) ;
126+ linker,
127+ edition) ;
127128
128129 {
129130 let map = hir:: map:: map_crate ( & sess, & cstore, & mut hir_forest, & defs) ;
@@ -183,8 +184,7 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
183184 externs : Externs ,
184185 should_panic : bool , no_run : bool , as_test_harness : bool ,
185186 compile_fail : bool , mut error_codes : Vec < String > , opts : & TestOptions ,
186- maybe_sysroot : Option < PathBuf > ,
187- linker : Option < PathBuf > ) {
187+ maybe_sysroot : Option < PathBuf > , linker : Option < PathBuf > , edition : Edition ) {
188188 // the test harness wants its own `main` & top level functions, so
189189 // never wrap the test in `fn main() { ... }`
190190 let ( test, line_offset) = make_test ( test, Some ( cratename) , as_test_harness, opts) ;
@@ -210,6 +210,10 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
210210 } ,
211211 test : as_test_harness,
212212 unstable_features : UnstableFeatures :: from_environment ( ) ,
213+ debugging_opts : config:: DebuggingOptions {
214+ edition,
215+ ..config:: basic_debugging_options ( )
216+ } ,
213217 ..config:: basic_options ( ) . clone ( )
214218 } ;
215219
@@ -473,13 +477,14 @@ pub struct Collector {
473477 codemap : Option < Lrc < CodeMap > > ,
474478 filename : Option < PathBuf > ,
475479 linker : Option < PathBuf > ,
480+ edition : Edition ,
476481}
477482
478483impl Collector {
479484 pub fn new ( cratename : String , cfgs : Vec < String > , libs : SearchPaths , externs : Externs ,
480485 use_headers : bool , opts : TestOptions , maybe_sysroot : Option < PathBuf > ,
481486 codemap : Option < Lrc < CodeMap > > , filename : Option < PathBuf > ,
482- linker : Option < PathBuf > ) -> Collector {
487+ linker : Option < PathBuf > , edition : Edition ) -> Collector {
483488 Collector {
484489 tests : Vec :: new ( ) ,
485490 names : Vec :: new ( ) ,
@@ -494,6 +499,7 @@ impl Collector {
494499 codemap,
495500 filename,
496501 linker,
502+ edition,
497503 }
498504 }
499505
@@ -513,6 +519,7 @@ impl Collector {
513519 let opts = self . opts . clone ( ) ;
514520 let maybe_sysroot = self . maybe_sysroot . clone ( ) ;
515521 let linker = self . linker . clone ( ) ;
522+ let edition = self . edition ;
516523 debug ! ( "Creating test {}: {}" , name, test) ;
517524 self . tests . push ( testing:: TestDescAndFn {
518525 desc : testing:: TestDesc {
@@ -543,7 +550,8 @@ impl Collector {
543550 error_codes,
544551 & opts,
545552 maybe_sysroot,
546- linker)
553+ linker,
554+ edition)
547555 } ) )
548556 } {
549557 Ok ( ( ) ) => ( ) ,
0 commit comments