about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2018-05-29 17:49:35 +0200
committerMichael Woerister <michaelwoerister@posteo>2018-06-27 14:00:34 +0200
commit3497138634bf58a7c29ef35f1f677dbde0633af8 (patch)
tree55d8150541740a2ed964a4b298995625c8c88e91 /src/libsyntax
parent04d4da1bf9df23f1bc2ad22115642735bda8b39e (diff)
downloadrust-3497138634bf58a7c29ef35f1f677dbde0633af8.tar.gz
rust-3497138634bf58a7c29ef35f1f677dbde0633af8.zip
Use u32 instead of usize of encoding byte count of multi-byte chars.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/codemap.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 2aa2564b097..68882c4f063 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -822,14 +822,14 @@ impl CodeMap {
                 total_extra_bytes += mbc.bytes - 1;
                 // We should never see a byte position in the middle of a
                 // character
-                assert!(bpos.to_usize() >= mbc.pos.to_usize() + mbc.bytes);
+                assert!(bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes);
             } else {
                 break;
             }
         }
 
-        assert!(map.start_pos.to_usize() + total_extra_bytes <= bpos.to_usize());
-        CharPos(bpos.to_usize() - map.start_pos.to_usize() - total_extra_bytes)
+        assert!(map.start_pos.to_u32() + total_extra_bytes <= bpos.to_u32());
+        CharPos(bpos.to_usize() - map.start_pos.to_usize() - total_extra_bytes as usize)
     }
 
     // Return the index of the filemap (in self.files) which contains pos.