Auto merge of #79012 - tgnottingham:span_data_to_lines_and_cols, r=estebank
rustc_span: add span_data_to_lines_and_cols to caching source map view
This commit is contained in:
commit
fe531d5a5f
3 changed files with 221 additions and 55 deletions
|
@ -12,7 +12,7 @@ use rustc_hir::definitions::{DefPathHash, Definitions};
|
|||
use rustc_session::Session;
|
||||
use rustc_span::source_map::SourceMap;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::{BytePos, CachingSourceMapView, SourceFile};
|
||||
use rustc_span::{BytePos, CachingSourceMapView, SourceFile, SpanData};
|
||||
|
||||
use rustc_span::def_id::{CrateNum, CRATE_DEF_INDEX};
|
||||
use smallvec::SmallVec;
|
||||
|
@ -248,6 +248,13 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
|
|||
) -> Option<(Lrc<SourceFile>, usize, BytePos)> {
|
||||
self.source_map().byte_pos_to_line_and_col(byte)
|
||||
}
|
||||
|
||||
fn span_data_to_lines_and_cols(
|
||||
&mut self,
|
||||
span: &SpanData,
|
||||
) -> Option<(Lrc<SourceFile>, usize, BytePos, usize, BytePos)> {
|
||||
self.source_map().span_data_to_lines_and_cols(span)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn hash_stable_trait_impls<'a>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue