// SPDX-License-Identifier: MIT OR Apache-2.0
//! `trybuild` UI tests — compile-time enforcement that the typed-newtype
//! handle wrappers can't be silently confused with each other.
//!
//! These are *compile-fail* tests: each `tests/ui/*.rs` file must FAIL to
//! compile, and its captured diagnostic must match `tests/ui/*.stderr`.
//! Run with `TRYBUILD=overwrite cargo test -p gpu-handle-types --test compile_fail`
//! to regenerate the `.stderr` snapshots after an intentional change.
//!
//! The `NtHandle` ≠ `KmtToken` invariant is part of the
//! handle-newtype contract — `NtHandle` wraps an `Arc<OwnedHandle>` (NT
//! kernel-object reference, `CloseHandle` on last drop); `KmtToken` is
//! a `u32` DXGI table id with no `CloseHandle` semantics. Conflating
//! them at any consumer site would leak a kernel handle or close an
//! unrelated one, so the type system must reject implicit conversions
//! between them. This test pins that guarantee against future drift —
//! if the two ever became interchangeable (say, one turned into a type
//! alias of the other), the UI files would compile, and trybuild reports
//! a compile-fail case that compiles as a failure.