File tree Expand file tree Collapse file tree 5 files changed +17
-9
lines changed Expand file tree Collapse file tree 5 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -484,8 +484,8 @@ impl<'a> Builder<'a> {
484484 } else {
485485 PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" )
486486 } )
487- . env ( "TEST_MIRI" , self . config . test_miri . to_string ( ) ) ;
488-
487+ . env ( "TEST_MIRI" , self . config . test_miri . to_string ( ) )
488+ . env ( "RUSTC_ERROR_METADATA_DST" , self . extended_error_dir ( ) ) ;
489489 if let Some ( n) = self . config . rust_codegen_units {
490490 cargo. env ( "RUSTC_CODEGEN_UNITS" , n. to_string ( ) ) ;
491491 }
Original file line number Diff line number Diff line change @@ -980,7 +980,8 @@ impl Step for ErrorIndex {
980980 build. run ( builder. tool_cmd ( Tool :: ErrorIndex )
981981 . arg ( "markdown" )
982982 . arg ( & output)
983- . env ( "CFG_BUILD" , & build. build ) ) ;
983+ . env ( "CFG_BUILD" , & build. build )
984+ . env ( "RUSTC_ERROR_METADATA_DST" , build. extended_error_dir ( ) ) ) ;
984985
985986 markdown_test ( builder, compiler, & output) ;
986987 }
Original file line number Diff line number Diff line change @@ -671,7 +671,8 @@ impl Step for ErrorIndex {
671671 index. arg ( out. join ( "error-index.html" ) ) ;
672672
673673 // FIXME: shouldn't have to pass this env var
674- index. env ( "CFG_BUILD" , & build. build ) ;
674+ index. env ( "CFG_BUILD" , & build. build )
675+ . env ( "RUSTC_ERROR_METADATA_DST" , build. extended_error_dir ( ) ) ;
675676
676677 build. run ( & mut index) ;
677678 }
Original file line number Diff line number Diff line change @@ -721,6 +721,11 @@ impl Build {
721721 self . config . python . as_ref ( ) . unwrap ( )
722722 }
723723
724+ /// Temporary directory that extended error information is emitted to.
725+ fn extended_error_dir ( & self ) -> PathBuf {
726+ self . out . join ( "tmp/extended-error-metadata" )
727+ }
728+
724729 /// Tests whether the `compiler` compiling for `target` should be forced to
725730 /// use a stage1 compiler instead.
726731 ///
Original file line number Diff line number Diff line change 1414//! currently always a crate name.
1515
1616use std:: collections:: BTreeMap ;
17- use std:: path :: PathBuf ;
17+ use std:: env ;
1818use std:: fs:: { remove_file, create_dir_all, File } ;
1919use std:: io:: Write ;
20+ use std:: path:: PathBuf ;
2021use std:: error:: Error ;
2122use rustc_serialize:: json:: as_json;
2223
2324use syntax_pos:: { Span , FileName } ;
2425use ext:: base:: ExtCtxt ;
2526use diagnostics:: plugin:: { ErrorMap , ErrorInfo } ;
2627
27- // Default metadata directory to use for extended error JSON.
28- const ERROR_METADATA_PREFIX : & ' static str = "tmp/extended-errors" ;
29-
3028/// JSON encodable/decodable version of `ErrorInfo`.
3129#[ derive( PartialEq , RustcDecodable , RustcEncodable ) ]
3230pub struct ErrorMetadata {
@@ -59,7 +57,10 @@ impl ErrorLocation {
5957///
6058/// See `output_metadata`.
6159pub fn get_metadata_dir ( prefix : & str ) -> PathBuf {
62- PathBuf :: from ( ERROR_METADATA_PREFIX ) . join ( prefix)
60+ env:: var_os ( "RUSTC_ERROR_METADATA_DST" )
61+ . map ( PathBuf :: from)
62+ . expect ( "env var `RUSTC_ERROR_METADATA_DST` isn't set" )
63+ . join ( prefix)
6364}
6465
6566/// Map `name` to a path in the given directory: <directory>/<name>.json
You can’t perform that action at this time.
0 commit comments