Mercurial > hg
comparison rust/hg-core/src/dirstate_tree/on_disk.rs @ 48568:440972d2175d stable
rust: fix build errors on darwin
I'm not all _that_ versed in Rust, but I think the root cause is that
some constants are u16 rather than u32 on Darwin. I checked that the
code still compiles on the latest Ubuntu.
Differential Revision: https://phab.mercurial-scm.org/D11955
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Thu, 30 Dec 2021 13:25:44 +0100 |
parents | 749946b6a641 |
children | f13fb742e1d8 |
comparison
equal
deleted
inserted
replaced
48551:f98d4d0a299a | 48568:440972d2175d |
---|---|
351 let permisions = if self.flags().contains(Flags::MODE_EXEC_PERM) { | 351 let permisions = if self.flags().contains(Flags::MODE_EXEC_PERM) { |
352 0o755 | 352 0o755 |
353 } else { | 353 } else { |
354 0o644 | 354 0o644 |
355 }; | 355 }; |
356 file_type | permisions | 356 (file_type | permisions).into() |
357 } | 357 } |
358 | 358 |
359 fn assume_entry(&self) -> Result<DirstateEntry, DirstateV2ParseError> { | 359 fn assume_entry(&self) -> Result<DirstateEntry, DirstateV2ParseError> { |
360 // TODO: convert through raw bits instead? | 360 // TODO: convert through raw bits instead? |
361 let wdir_tracked = self.flags().contains(Flags::WDIR_TRACKED); | 361 let wdir_tracked = self.flags().contains(Flags::WDIR_TRACKED); |
452 let mut flags = Flags::empty(); | 452 let mut flags = Flags::empty(); |
453 flags.set(Flags::WDIR_TRACKED, wdir_tracked); | 453 flags.set(Flags::WDIR_TRACKED, wdir_tracked); |
454 flags.set(Flags::P1_TRACKED, p1_tracked); | 454 flags.set(Flags::P1_TRACKED, p1_tracked); |
455 flags.set(Flags::P2_INFO, p2_info); | 455 flags.set(Flags::P2_INFO, p2_info); |
456 let size = if let Some((m, s)) = mode_size_opt { | 456 let size = if let Some((m, s)) = mode_size_opt { |
457 let exec_perm = m & libc::S_IXUSR != 0; | 457 let exec_perm = m & (libc::S_IXUSR as u32) != 0; |
458 let is_symlink = m & libc::S_IFMT == libc::S_IFLNK; | 458 let is_symlink = m & (libc::S_IFMT as u32) == libc::S_IFLNK as u32; |
459 flags.set(Flags::MODE_EXEC_PERM, exec_perm); | 459 flags.set(Flags::MODE_EXEC_PERM, exec_perm); |
460 flags.set(Flags::MODE_IS_SYMLINK, is_symlink); | 460 flags.set(Flags::MODE_IS_SYMLINK, is_symlink); |
461 flags.insert(Flags::HAS_MODE_AND_SIZE); | 461 flags.insert(Flags::HAS_MODE_AND_SIZE); |
462 s.into() | 462 s.into() |
463 } else { | 463 } else { |