diff options
| author | bors <bors@rust-lang.org> | 2015-01-10 14:15:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-10 14:15:09 +0000 |
| commit | ac0c2fb5f12277617834e1e55b2960e05740139d (patch) | |
| tree | 2111b73697e7694b81d325099a79c8d4187dfdcc /src/libsyntax | |
| parent | c0ca57a6fb176d8082eac0ba1de4690f4c0eb0bb (diff) | |
| parent | 4a7b710031de43c2d126ea42ac5f8b9c23201803 (diff) | |
| download | rust-ac0c2fb5f12277617834e1e55b2960e05740139d.tar.gz rust-ac0c2fb5f12277617834e1e55b2960e05740139d.zip | |
Merge pull request #20808 from Manishearth/span_fix
Fix checking of command line expansion spans Reviewed-by: alexcrichton
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 64fdb61f2ec..3f81dac2b0d 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -13,7 +13,7 @@ pub use self::RenderSpan::*; pub use self::ColorConfig::*; use self::Destination::*; -use codemap::{COMMAND_LINE_SP, Pos, Span}; +use codemap::{COMMAND_LINE_SP, COMMAND_LINE_EXPN, Pos, Span}; use codemap; use diagnostics; @@ -393,7 +393,10 @@ impl Emitter for EmitterWriter { fn emit(dst: &mut EmitterWriter, cm: &codemap::CodeMap, rsp: RenderSpan, msg: &str, code: Option<&str>, lvl: Level, custom: bool) -> io::IoResult<()> { let sp = rsp.span(); - let ss = if sp == COMMAND_LINE_SP { + + // We cannot check equality directly with COMMAND_LINE_SP + // since PartialEq is manually implemented to ignore the ExpnId + let ss = if sp.expn_id == COMMAND_LINE_EXPN { "<command line option>".to_string() } else { cm.span_to_string(sp) |
