mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
s/file_map/source_map
This commit is contained in:
parent
1d5108c264
commit
c4b08a5b0c
@ -413,9 +413,9 @@ pub fn snippet_block<'a, 'b, T: LintContext<'b>>(cx: &T, span: Span, default: &'
|
||||
|
||||
/// Returns a new Span that covers the full last line of the given Span
|
||||
pub fn last_line_of_span<'a, T: LintContext<'a>>(cx: &T, span: Span) -> Span {
|
||||
let file_map_and_line = cx.sess().source_map().lookup_line(span.lo()).unwrap();
|
||||
let line_no = file_map_and_line.line;
|
||||
let line_start = &file_map_and_line.sf.lines[line_no];
|
||||
let source_map_and_line = cx.sess().source_map().lookup_line(span.lo()).unwrap();
|
||||
let line_no = source_map_and_line.line;
|
||||
let line_start = &source_map_and_line.sf.lines[line_no];
|
||||
Span::new(*line_start, span.hi(), span.ctxt())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user