We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 947579e commit e53b4ddCopy full SHA for e53b4dd
src/librustc_metadata/decoder.rs
@@ -1106,6 +1106,10 @@ impl<'a, 'tcx> CrateMetadata {
1106
}
1107
1108
fn are_equal_modulo_startpos(fm1: &syntax_pos::FileMap, fm2: &syntax_pos::FileMap) -> bool {
1109
+ if fm1.byte_length() != fm2.byte_length() {
1110
+ return false;
1111
+ }
1112
+
1113
if fm1.name != fm2.name {
1114
return false;
1115
src/libsyntax_pos/lib.rs
@@ -481,6 +481,9 @@ impl FileMap {
481
self.src.is_none()
482
483
484
+ pub fn byte_length(&self) -> u32 {
485
+ self.end_pos.0 - self.start_pos.0
486
487
pub fn count_lines(&self) -> usize {
488
self.lines.borrow().len()
489
0 commit comments