From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 363D51FF136 for ; Mon, 26 Jan 2026 15:11:57 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2535AF251; Mon, 26 Jan 2026 15:12:19 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Mon, 26 Jan 2026 15:12:11 +0100 Message-ID: <20260126141215.401447-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769436672383 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.088 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox] lang: Remove offsetof macro X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" With rust 1.90 this will crash while running cargo test with $ RUST_BACKTRACE=1 cargo test null pointer dereference occurred stack backtrace: 0: __rustc::rust_begin_unwind at /usr/src/rustc-1.90.0/library/std/src/panicking.rs:697:5 1: core::panicking::panic_nounwind_fmt::runtime at /usr/src/rustc-1.90.0/library/core/src/panicking.rs:117:22 2: core::panicking::panic_nounwind_fmt at /usr/src/rustc-1.90.0/library/core/src/intrinsics/mod.rs:2367:9 3: core::panicking::panic_null_pointer_dereference at /usr/src/rustc-1.90.0/library/core/src/panicking.rs:311:5 4: rust_out::main::_doctest_main_proxmox_lang_src_lib_rs_71_0 5: rust_out::main 6: core::ops::function::FnOnce::call_once Note that the deref_nullptr lint is going to be denied by default on 1.93. Signed-off-by: Maximiliano Sandoval --- As far as my greeping was able to tell, there should be no other users than the docstring. proxmox-lang/src/lib.rs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/proxmox-lang/src/lib.rs b/proxmox-lang/src/lib.rs index 0abfd507..0c33710b 100644 --- a/proxmox-lang/src/lib.rs +++ b/proxmox-lang/src/lib.rs @@ -66,28 +66,6 @@ macro_rules! static_assert_size { }; } -/// Evaluates to the offset (in bytes) of a given member within a struct -/// -/// ``` -/// # use proxmox_lang::offsetof; -/// -/// #[repr(C)] -/// struct Stuff { -/// first: u32, -/// second: u32, -/// } -/// -/// assert_eq!(offsetof!(Stuff, second), 4); -/// -/// ``` -#[deprecated = "use std::mem::offset_of! instead"] -#[macro_export] -macro_rules! offsetof { - ($ty:ty, $field:ident) => { - unsafe { &(*(std::ptr::null::<$ty>())).$field as *const _ as usize } - }; -} - /// Shortcut for generating an `&'static CStr`. /// /// This takes a *string* (*not* a *byte-string*), appends a terminating zero, and calls -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel