mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-14 07:36:01 +00:00
auth-api: fix types compilefail
test
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 <s.sterz@proxmox.com>
This commit is contained in:
parent
eef12f91a1
commit
5b4cb9b124
@ -111,6 +111,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
|
||||
/// }
|
||||
@ -332,21 +333,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 _ = <Username as PartialEq>::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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user