[Updated] D11955: rust: fix build errors on darwin

Phabricator phabricator at mercurial-scm.org
Tue Jan 4 19:59:01 UTC 2022


Closed by commit rHGd6c53b40b078: rust: fix build errors on darwin (authored by Dan Villiom Podlaski Christiansen <danchr at gmail.com>).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D11955?vs=31584&id=31585#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11955?vs=31584&id=31585

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11955/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11955

AFFECTED FILES
  rust/hg-core/src/dirstate_tree/on_disk.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/dirstate_tree/on_disk.rs b/rust/hg-core/src/dirstate_tree/on_disk.rs
--- a/rust/hg-core/src/dirstate_tree/on_disk.rs
+++ b/rust/hg-core/src/dirstate_tree/on_disk.rs
@@ -399,7 +399,7 @@
         } else {
             0o644
         };
-        file_type | permisions
+        (file_type | permisions).into()
     }
 
     fn mtime(&self) -> Result<TruncatedTimestamp, DirstateV2ParseError> {
@@ -505,8 +505,8 @@
         flags.set(Flags::P1_TRACKED, p1_tracked);
         flags.set(Flags::P2_INFO, p2_info);
         let size = if let Some((m, s)) = mode_size_opt {
-            let exec_perm = m & libc::S_IXUSR != 0;
-            let is_symlink = m & libc::S_IFMT == libc::S_IFLNK;
+            let exec_perm = m & (libc::S_IXUSR as u32) != 0;
+            let is_symlink = m & (libc::S_IFMT as u32) == libc::S_IFLNK as u32;
             flags.set(Flags::MODE_EXEC_PERM, exec_perm);
             flags.set(Flags::MODE_IS_SYMLINK, is_symlink);
             flags.insert(Flags::HAS_MODE_AND_SIZE);



To: danchr, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20220104/f778f92d/attachment-0001.html>


More information about the Mercurial-patches mailing list