diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-04-29 21:13:42 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-05-02 11:49:26 -0400 |
| commit | 95576b8ec40538fc311029dd838d2a22c0e9af7f (patch) | |
| tree | f020be7921415e50f681a9232d48f16c4fdb2e74 /src/libsyntax/errors/mod.rs | |
| parent | 2ba5fac1a460de9936b85f9459668b0992f21f06 (diff) | |
| download | rust-95576b8ec40538fc311029dd838d2a22c0e9af7f.tar.gz rust-95576b8ec40538fc311029dd838d2a22c0e9af7f.zip | |
update unit tests
Diffstat (limited to 'src/libsyntax/errors/mod.rs')
| -rw-r--r-- | src/libsyntax/errors/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libsyntax/errors/mod.rs b/src/libsyntax/errors/mod.rs index feac8aadc1e..4ade537c8ce 100644 --- a/src/libsyntax/errors/mod.rs +++ b/src/libsyntax/errors/mod.rs @@ -683,3 +683,20 @@ pub fn expect<T, M>(diag: &Handler, opt: Option<T>, msg: M) -> T where None => diag.bug(&msg()), } } + +/// True if we should use the old-skool error format style. This is +/// the default setting until the new errors are deemed stable enough +/// for general use. +/// +/// FIXME(#33240) +#[cfg(not(test))] +fn check_old_skool() -> bool { + use std::env; + env::var("RUST_NEW_ERROR_FORMAT").is_err() +} + +/// For unit tests, use the new format. +#[cfg(test)] +fn check_old_skool() -> bool { + false +} |
