"incompatible arm" diagnostic span tweak

Use span label instead of span note for single line spans in
"incompatible arm" diagnostic.
This commit is contained in:
Esteban Küber
2017-12-22 15:55:44 -08:00
parent 4a7c072fa6
commit fed4fcb318
6 changed files with 23 additions and 22 deletions

View File

@@ -446,6 +446,12 @@ impl CodeMap {
.expect("CodeMap::span_to_unmapped_path called for imported FileMap?")
}
pub fn is_multiline(&self, sp: Span) -> bool {
let lo = self.lookup_char_pos(sp.lo());
let hi = self.lookup_char_pos(sp.hi());
lo.line != hi.line
}
pub fn span_to_lines(&self, sp: Span) -> FileLinesResult {
debug!("span_to_lines(sp={:?})", sp);