summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/metadata.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-02-27 16:44:59 +0000
committerbors <bors@rust-lang.org>2018-02-27 16:44:59 +0000
commitd3ae9a9e08edf12de0ed82af57ba2a56c26496ea (patch)
treede72b3163b47f646b717f1f809d1315b9bf49da9 /src/libsyntax/diagnostics/metadata.rs
parent4d90ac38c0b61bb69470b61ea2cccea0df48d9e5 (diff)
parent9853d20e4d054207c54b62e3fb700106652bcac9 (diff)
downloadrust-1.24.1.tar.gz
rust-1.24.1.zip
Auto merge of #48445 - Mark-Simulacrum:stable-next, r=alexcrichton 1.24.1
[stable] 1.24.1 stable release

The includes the following commits:
 - 6a600f827b632fb798b9ca52345130748fe86a30: Fixes #48251, unwinding through FFI no longer aborts
 - https://github.com/cuviper/rust/commit/b445a52ea322758fb7b60fab5f890ef8c0f8df9c: Fixes https://github.com/rust-lang/rust/issues/48308, fixing the error index generator
 - f8e00d0dc221564701ecdbb6dde57e0e9dd12900: Fixes https://github.com/rust-lang/rust/issues/48318 by emitting UTF-16 output on MSVC targets.
 - 2a0af8c448: Bumps the version number to 1.24.1.
 - 93220f0f45: Release notes
 - 6031718d8836f95bbfeddfaa63f1ee1d66e53f26: Cargo TLS warnings on Windows.
Diffstat (limited to 'src/libsyntax/diagnostics/metadata.rs')
-rw-r--r--src/libsyntax/diagnostics/metadata.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libsyntax/diagnostics/metadata.rs b/src/libsyntax/diagnostics/metadata.rs
index 5f06475919f..dc01a79190b 100644
--- a/src/libsyntax/diagnostics/metadata.rs
+++ b/src/libsyntax/diagnostics/metadata.rs
@@ -14,9 +14,10 @@
 //! currently always a crate name.
 
 use std::collections::BTreeMap;
-use std::path::PathBuf;
+use std::env;
 use std::fs::{remove_file, create_dir_all, File};
 use std::io::Write;
+use std::path::PathBuf;
 use std::error::Error;
 use rustc_serialize::json::as_json;
 
@@ -24,9 +25,6 @@ use syntax_pos::{Span, FileName};
 use ext::base::ExtCtxt;
 use diagnostics::plugin::{ErrorMap, ErrorInfo};
 
-// Default metadata directory to use for extended error JSON.
-const ERROR_METADATA_PREFIX: &'static str = "tmp/extended-errors";
-
 /// JSON encodable/decodable version of `ErrorInfo`.
 #[derive(PartialEq, RustcDecodable, RustcEncodable)]
 pub struct ErrorMetadata {
@@ -59,7 +57,10 @@ impl ErrorLocation {
 ///
 /// See `output_metadata`.
 pub fn get_metadata_dir(prefix: &str) -> PathBuf {
-    PathBuf::from(ERROR_METADATA_PREFIX).join(prefix)
+    env::var_os("RUSTC_ERROR_METADATA_DST")
+        .map(PathBuf::from)
+        .expect("env var `RUSTC_ERROR_METADATA_DST` isn't set")
+        .join(prefix)
 }
 
 /// Map `name` to a path in the given directory: <directory>/<name>.json