mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 14:13:38 +00:00
Fix checking of command line expansion spans (fixes #20747)
This commit is contained in:
parent
8c6bd81196
commit
4a7b710031
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user