File tree 5 files changed +17
-9
lines changed
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> {
484
484
} else {
485
485
PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" )
486
486
} )
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 ( ) ) ;
489
489
if let Some ( n) = self . config . rust_codegen_units {
490
490
cargo. env ( "RUSTC_CODEGEN_UNITS" , n. to_string ( ) ) ;
491
491
}
Original file line number Diff line number Diff line change @@ -980,7 +980,8 @@ impl Step for ErrorIndex {
980
980
build. run ( builder. tool_cmd ( Tool :: ErrorIndex )
981
981
. arg ( "markdown" )
982
982
. arg ( & output)
983
- . env ( "CFG_BUILD" , & build. build ) ) ;
983
+ . env ( "CFG_BUILD" , & build. build )
984
+ . env ( "RUSTC_ERROR_METADATA_DST" , build. extended_error_dir ( ) ) ) ;
984
985
985
986
markdown_test ( builder, compiler, & output) ;
986
987
}
Original file line number Diff line number Diff line change @@ -671,7 +671,8 @@ impl Step for ErrorIndex {
671
671
index. arg ( out. join ( "error-index.html" ) ) ;
672
672
673
673
// 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 ( ) ) ;
675
676
676
677
build. run ( & mut index) ;
677
678
}
Original file line number Diff line number Diff line change @@ -721,6 +721,11 @@ impl Build {
721
721
self . config . python . as_ref ( ) . unwrap ( )
722
722
}
723
723
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
+
724
729
/// Tests whether the `compiler` compiling for `target` should be forced to
725
730
/// use a stage1 compiler instead.
726
731
///
Original file line number Diff line number Diff line change 14
14
//! currently always a crate name.
15
15
16
16
use std:: collections:: BTreeMap ;
17
- use std:: path :: PathBuf ;
17
+ use std:: env ;
18
18
use std:: fs:: { remove_file, create_dir_all, File } ;
19
19
use std:: io:: Write ;
20
+ use std:: path:: PathBuf ;
20
21
use std:: error:: Error ;
21
22
use rustc_serialize:: json:: as_json;
22
23
23
24
use syntax_pos:: { Span , FileName } ;
24
25
use ext:: base:: ExtCtxt ;
25
26
use diagnostics:: plugin:: { ErrorMap , ErrorInfo } ;
26
27
27
- // Default metadata directory to use for extended error JSON.
28
- const ERROR_METADATA_PREFIX : & ' static str = "tmp/extended-errors" ;
29
-
30
28
/// JSON encodable/decodable version of `ErrorInfo`.
31
29
#[ derive( PartialEq , RustcDecodable , RustcEncodable ) ]
32
30
pub struct ErrorMetadata {
@@ -59,7 +57,10 @@ impl ErrorLocation {
59
57
///
60
58
/// See `output_metadata`.
61
59
pub 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)
63
64
}
64
65
65
66
/// Map `name` to a path in the given directory: <directory>/<name>.json
You can’t perform that action at this time.
0 commit comments