//! Tests for the lt_list module's api. //! //! The lt_list module is all type level constructs so the tests in //! this module may look very strange. /* use std::panic::{RefUnwindSafe, UnwindSafe}; use supply::lt_list::*; // LtList const _: () = { // LtList must not be object safe. trait AssertSuper: Sized + Send + Sync + Unpin + RefUnwindSafe + UnwindSafe {} #[allow(clippy::needless_maybe_sized)] impl AssertSuper for L {} fn with_l() { // The tail of a list is always a list. fn assert_head() {} assert_head::(); // The tail of a list is always a list. fn assert_list() {} assert_list::(); // Lt has a head of 'a and a tail of something. fn assert_chain<'a, T: LtList, Tail = L>, L: LtList>() {} assert_chain::, L>(); } fn assert() { // () has a head of 'static and a tail of itself. fn assert_base, Tail = ()>>() {} // assert_base::<()>(); } }; // Lt const _: () = { fn _with_t() { // Static always implements all the auto traits. fn assert_auto() {} assert_auto::>(); } // Lt's LtList properties are tested above. }; // LtX const _: () = { #[allow(clippy::extra_unused_lifetimes)] fn with_t<'l0, 'l1, 'l2, 'l3, 'l4, 'l5, L: LtList>() { fn assert, U>() {} assert::(); assert::, L>(); assert::, Lt<'l0, ()>>(); assert::, Lt<'l0, L>>(); assert::, Lt<'l0, Lt<'l1, ()>>>(); assert::, Lt<'l0, Lt<'l1, L>>>(); assert::, Lt<'l0, Lt<'l1, Lt<'l2, ()>>>>(); assert::, Lt<'l0, Lt<'l1, Lt<'l2, L>>>>(); assert::, Lt<'l0, Lt<'l1, Lt<'l2, Lt<'l3, ()>>>>>(); assert::, Lt<'l0, Lt<'l1, Lt<'l2, Lt<'l3, L>>>>>(); assert::, Lt<'l0, Lt<'l1, Lt<'l2, Lt<'l3, Lt<'l4, ()>>>>>>(); assert::, Lt<'l0, Lt<'l1, Lt<'l2, Lt<'l3, Lt<'l4, L>>>>>>(); assert::< Lt6<'l0, 'l1, 'l2, 'l3, 'l4, 'l5>, Lt<'l0, Lt<'l1, Lt<'l2, Lt<'l3, Lt<'l4, Lt<'l5, ()>>>>>>, >(); assert::< Lt6<'l0, 'l1, 'l2, 'l3, 'l4, 'l5, L>, Lt<'l0, Lt<'l1, Lt<'l2, Lt<'l3, Lt<'l4, Lt<'l5, L>>>>>>, >(); } }; // Head/Tail const _: () = { fn with_l() { fn assert, U>() {} // Head gets the head of the list. assert::>(); // Tail gets the tail of the list. assert::>(); } }; #[allow(unused)] trait Is {} impl Is for T {} */