From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 568EE97D70 for ; Wed, 6 Mar 2024 13:36:49 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 35E2616ED2 for ; Wed, 6 Mar 2024 13:36:19 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 6 Mar 2024 13:36:18 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5431148852 for ; Wed, 6 Mar 2024 13:36:18 +0100 (CET) From: Stefan Sterz To: pbs-devel@lists.proxmox.com Date: Wed, 6 Mar 2024 13:36:05 +0100 Message-Id: <20240306123609.164021-9-s.sterz@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240306123609.164021-1-s.sterz@proxmox.com> References: <20240306123609.164021-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.075 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox v2 08/12] auth-api: fix types `compilefail` test 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: , X-List-Received-Date: Wed, 06 Mar 2024 12:36:49 -0000 due to missing `use` statements they failed, as they should, but for the wrong reasons. also adapt a test case that presumably was meant to test whether `TokennameRef` can be compared, but instead duplicated the `UsernameRef` test case. Signed-off-by: Stefan Sterz --- proxmox-auth-api/src/types.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/proxmox-auth-api/src/types.rs b/proxmox-auth-api/src/types.rs index 319ac4b..18b1793 100644 --- a/proxmox-auth-api/src/types.rs +++ b/proxmox-auth-api/src/types.rs @@ -137,6 +137,7 @@ pub const PROXMOX_AUTH_REALM_SCHEMA: Schema = PROXMOX_AUTH_REALM_STRING_SCHEMA.s /// `.as_str()`. /// /// ```compile_fail +/// # use proxmox_auth_api::types::Username; /// fn test(a: Username, b: Username) -> bool { /// a == b // illegal and does not compile /// } @@ -346,21 +347,24 @@ pub struct TokennameRef(str); #[doc(hidden)] /// ```compile_fail +/// # use proxmox_auth_api::types::Username; /// let a: Username = unsafe { std::mem::zeroed() }; /// let b: Username = unsafe { std::mem::zeroed() }; /// let _ = ::eq(&a, &b); /// ``` /// /// ```compile_fail +/// # use proxmox_auth_api::types::UsernameRef; /// let a: &UsernameRef = unsafe { std::mem::zeroed() }; /// let b: &UsernameRef = unsafe { std::mem::zeroed() }; /// let _ = <&UsernameRef as PartialEq>::eq(a, b); /// ``` /// /// ```compile_fail -/// let a: &UsernameRef = unsafe { std::mem::zeroed() }; -/// let b: &UsernameRef = unsafe { std::mem::zeroed() }; -/// let _ = <&UsernameRef as PartialEq>::eq(&a, &b); +/// # use proxmox_auth_api::types::TokennameRef; +/// let a: &TokennameRef = unsafe { std::mem::zeroed() }; +/// let b: &TokennameRef = unsafe { std::mem::zeroed() }; +/// let _ = <&TokennameRef as PartialEq>::eq(&a, &b); /// ``` struct _AssertNoEqImpl; -- 2.39.2