about summary refs log tree commit diff
path: root/compiler/rustc_span
diff options
context:
space:
mode:
authorJames Whaley <juicy66173@gmail.com>2020-09-21 19:42:43 +0100
committerJames Whaley <juicy66173@gmail.com>2020-09-21 19:42:43 +0100
commit9a1f1777d3602b267c78229e1d5de68fe7eab57a (patch)
tree415b2a52ba32dacffd32132cbf5570950f5bf04e /compiler/rustc_span
parentb4b4a2f0927d2d1d838da1e128472ff8bf64e98b (diff)
downloadrust-9a1f1777d3602b267c78229e1d5de68fe7eab57a.tar.gz
rust-9a1f1777d3602b267c78229e1d5de68fe7eab57a.zip
Remove cast to usize for BytePos and CharPos
The case shouldn't be necessary and implicitly truncating BytePos is not
desirable.
Diffstat (limited to 'compiler/rustc_span')
-rw-r--r--compiler/rustc_span/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index ad3a866463d..4b02a2d4076 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -1596,7 +1596,7 @@ macro_rules! impl_pos {
 
                 #[inline(always)]
                 fn add(self, rhs: $ident) -> $ident {
-                    $ident((self.to_usize() + rhs.to_usize()) as $inner_ty)
+                    $ident(self.0 + rhs.0)
                 }
             }
 
@@ -1605,7 +1605,7 @@ macro_rules! impl_pos {
 
                 #[inline(always)]
                 fn sub(self, rhs: $ident) -> $ident {
-                    $ident((self.to_usize() - rhs.to_usize()) as $inner_ty)
+                    $ident(self.0 - rhs.0)
                 }
             }
         )*