From 54f9778003be6eddf5efc037030b9012c95d9a42 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 5 Mar 2025 13:01:12 +0100 Subject: [PATCH] Backout new assertion to support old Rust error[E0015]: cannot call non-const fn `zeroed::` in constants --> src/path.rs:712:35 | 712 | let f_type = unsafe { mem::zeroed::() }.f_type; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants error: `std::mem::size_of_val` is not yet stable as a const fn --> src/path.rs:713:13 | 713 | mem::size_of_val(&f_type) <= mem::size_of::() | ^^^^^^^^^^^^^^^^^^^^^^^^^ --- src/path.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/path.rs b/src/path.rs index f4d75d3b8..0183f1739 100644 --- a/src/path.rs +++ b/src/path.rs @@ -707,11 +707,6 @@ fn path_remoteness(path: &wstr) -> DirRemoteness { // these are in varying headers. Simply hard code them. // Note that we treat FUSE filesystems as remote, which means we lock less on such filesystems. // NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER - const _: () = assert!({ - use std::mem; - let f_type = unsafe { mem::zeroed::() }.f_type; - mem::size_of_val(&f_type) <= mem::size_of::() - }); match buf.f_type as usize { 0x5346414F | // AFS_SUPER_MAGIC - Andrew File System 0x6B414653 | // AFS_FS_MAGIC - Kernel AFS and AuriStorFS