pub mod doc_typle { #![allow(dead_code)] use typle::typle; struct MyStruct { pub t: T, } impl MyStruct<(u32,)> { fn max(&self) -> Option { #[allow(unused_mut)] let mut max = self.t.0; Some(max) } } impl MyStruct<(u32, u32)> { fn max(&self) -> Option { let mut max = self.t.0; loop { { if self.t.1 > max { max = self.t.1; } } break; } Some(max) } } impl MyStruct<(u32, u32, u32)> { fn max(&self) -> Option { let mut max = self.t.0; loop { { if self.t.1 > max { max = self.t.1; } } { if self.t.2 > max { max = self.t.2; } } break; } Some(max) } } mod tuple { pub trait Extract { type State; type Output; fn extract(&self, state: Option) -> Self::Output; } impl Extract for () { type State = (); type Output = (); fn extract(&self, _state: Option) -> Self::Output {} } pub enum TupleSequenceState where T0: Extract, T1: Extract, T2: Extract, T3: Extract, { S0((), Option<::State>), S1((::Output,), Option<::State>), S2((::Output, ::Output), Option<::State>), S3((::Output, ::Output, ::Output), Option<::State>), } pub struct TupleSequence { tuple: T, } impl Extract for TupleSequence<(T0,)> where T0: Extract, { type State = TupleSequenceState; type Output = (::Output,); fn extract(&self, state: Option) -> Self::Output { #[allow(unused_mut)] let mut state = state.unwrap_or(Self::State::S0((), None)); loop { { #[allow(irrefutable_let_patterns)] #[allow(unused_variables)] if let Self::State::S0(output, inner_state) = state { let matched = self.tuple.0.extract(inner_state); let output = ({ matched },); { return output; } } } break; } ::core::panicking::panic("internal error: entered unreachable code"); } } impl Extract for TupleSequence<(T0, T1)> where T0: Extract, T1: Extract, { type State = TupleSequenceState; type Output = (::Output, ::Output); fn extract(&self, state: Option) -> Self::Output { let mut state = state.unwrap_or(Self::State::S0((), None)); loop { { #[allow(unused_variables)] if let Self::State::S0(output, inner_state) = state { let matched = self.tuple.0.extract(inner_state); let output = ({ matched },); { state = Self::State::S1(output, None); } } } { if let Self::State::S1(output, inner_state) = state { let matched = self.tuple.1.extract(inner_state); let output = ({ output.0 }, { matched }); { return output; } } } break; } ::core::panicking::panic("internal error: entered unreachable code"); } } impl Extract for TupleSequence<(T0, T1, T2)> where T0: Extract, T1: Extract, T2: Extract, { type State = TupleSequenceState; type Output = ( ::Output, ::Output, ::Output, ); fn extract(&self, state: Option) -> Self::Output { let mut state = state.unwrap_or(Self::State::S0((), None)); loop { { #[allow(unused_variables)] if let Self::State::S0(output, inner_state) = state { let matched = self.tuple.0.extract(inner_state); let output = ({ matched },); { state = Self::State::S1(output, None); } } } { if let Self::State::S1(output, inner_state) = state { let matched = self.tuple.1.extract(inner_state); let output = ({ output.0 }, { matched }); { state = Self::State::S2(output, None); } } } { if let Self::State::S2(output, inner_state) = state { let matched = self.tuple.2.extract(inner_state); let output = ({ output.0 }, { output.1 }, { matched }); { return output; } } } break; } ::core::panicking::panic("internal error: entered unreachable code"); } } impl Extract for TupleSequence<(T0, T1, T2, T3)> where T0: Extract, T1: Extract, T2: Extract, T3: Extract, { type State = TupleSequenceState; type Output = ( ::Output, ::Output, ::Output, ::Output, ); fn extract(&self, state: Option) -> Self::Output { let mut state = state.unwrap_or(Self::State::S0((), None)); loop { { #[allow(unused_variables)] if let Self::State::S0(output, inner_state) = state { let matched = self.tuple.0.extract(inner_state); let output = ({ matched },); { state = Self::State::S1(output, None); } } } { if let Self::State::S1(output, inner_state) = state { let matched = self.tuple.1.extract(inner_state); let output = ({ output.0 }, { matched }); { state = Self::State::S2(output, None); } } } { if let Self::State::S2(output, inner_state) = state { let matched = self.tuple.2.extract(inner_state); let output = ({ output.0 }, { output.1 }, { matched }); { state = Self::State::S3(output, None); } } } { if let Self::State::S3(output, inner_state) = state { let matched = self.tuple.3.extract(inner_state); let output = ( { output.0 }, { output.1 }, { output.2 }, { matched }, ); { return output; } } } break; } ::core::panicking::panic("internal error: entered unreachable code"); } } } } pub mod for_loop { #![allow(unreachable_code, unused)] use typle::typle; struct Looper { t: T, } #[allow(clippy::never_loop)] impl Looper<(T0, T1, T2, T3, T4, T5, T6, T7)> { fn for_loop(&self) { loop { { { let _x = 0; } {} } { { let _x = 2; break; } {} } let mut _typle_break = false; loop { if _typle_break { _typle_break = false; break; } _typle_break = true; { { let _x = 3; continue; } {} } } 'label: loop { if _typle_break { _typle_break = false; break; } _typle_break = true; { { let _x = 4; break 'label; } {} } } if _typle_break { break; } { { for _j in 0..2 { continue; } while 5 == 3 { continue; } loop { break; } } } break; } } } #[allow(non_camel_case_types)] pub trait _typle_fn_do_continue { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_do_continue for ((T0, T1, T2, T3),) { type Return = Vec; fn apply(self) -> Self::Return { let (t,) = self; { let mut output = Vec::new(); loop { { output.push(0); } { output.push(1); } let mut _typle_break = false; loop { if _typle_break { _typle_break = false; break; } _typle_break = true; { { continue; } output.push(2); } } { output.push(3); } break; } output } } } pub fn do_continue(t: T) -> <(T,) as _typle_fn_do_continue>::Return where (T,): _typle_fn_do_continue, { <(T,) as _typle_fn_do_continue>::apply((t,)) } #[allow(non_camel_case_types)] pub trait _typle_fn_do_continue_labelled { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_do_continue_labelled for ((T0, T1, T2, T3),) { type Return = Vec; #[allow(clippy::never_loop)] fn apply(self) -> Self::Return { let (t,) = self; { let mut output = Vec::new(); loop { { loop { output.push(0); break; } } { loop { output.push(1); break; } } let mut _typle_break = false; 'label: loop { if _typle_break { _typle_break = false; break; } _typle_break = true; { loop { { continue 'label; } output.push(2); break; } } } if _typle_break { break; } { loop { output.push(3); break; } } break; } output } } } pub fn do_continue_labelled( t: T, ) -> <(T,) as _typle_fn_do_continue_labelled>::Return where (T,): _typle_fn_do_continue_labelled, { <(T,) as _typle_fn_do_continue_labelled>::apply((t,)) } #[allow(non_camel_case_types)] pub trait _typle_fn_do_break { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_do_break for ((T0, T1, T2, T3),) { type Return = Vec; fn apply(self) -> Self::Return { let (t,) = self; { let mut output = Vec::new(); loop { { output.push(0); } { output.push(1); } { { break; } output.push(2); } { output.push(3); } break; } output } } } pub fn do_break(t: T) -> <(T,) as _typle_fn_do_break>::Return where (T,): _typle_fn_do_break, { <(T,) as _typle_fn_do_break>::apply((t,)) } #[allow(non_camel_case_types)] pub trait _typle_fn_do_break_labelled { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_do_break_labelled for ((T0, T1, T2, T3),) { type Return = Vec; #[allow(clippy::never_loop)] fn apply(self) -> Self::Return { let (t,) = self; { let mut output = Vec::new(); loop { { loop { output.push(0); break; } } { loop { output.push(1); break; } } let mut _typle_break = false; 'label: loop { if _typle_break { _typle_break = false; break; } _typle_break = true; { loop { { break 'label; } output.push(2); break; } } } if _typle_break { break; } { loop { output.push(3); break; } } break; } output } } } pub fn do_break_labelled(t: T) -> <(T,) as _typle_fn_do_break_labelled>::Return where (T,): _typle_fn_do_break_labelled, { <(T,) as _typle_fn_do_break_labelled>::apply((t,)) } #[allow(non_camel_case_types)] pub trait _typle_fn_check_out_of_bounds { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_check_out_of_bounds for ((),) { type Return = usize; fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t,) = self; { let mut count = 0; loop { { count += 1; } { count += 1; } { count += 1; } break; } count } } } pub fn check_out_of_bounds( t: T, ) -> <(T,) as _typle_fn_check_out_of_bounds>::Return where (T,): _typle_fn_check_out_of_bounds, { <(T,) as _typle_fn_check_out_of_bounds>::apply((t,)) } #[allow(non_camel_case_types)] pub trait _typle_fn_check_negative_range { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_check_negative_range for ((),) { type Return = usize; fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t,) = self; { #[allow(clippy::let_and_return)] let mut count = 0; count } } } pub fn check_negative_range( t: T, ) -> <(T,) as _typle_fn_check_negative_range>::Return where (T,): _typle_fn_check_negative_range, { <(T,) as _typle_fn_check_negative_range>::apply((t,)) } } pub mod function { use typle::typle; use std::hash::{Hash, Hasher}; use std::ops::Mul; #[allow(non_camel_case_types)] pub trait _typle_fn_hash { type Return; fn apply(self) -> Self::Return; } impl<'a, T0, S: Hasher> _typle_fn_hash for (&'a (T0,), &'a mut S) where T0: Hash, T0: ?Sized, { type Return = (); fn apply(self) -> Self::Return { let (tuple, state) = self; { loop { { tuple.0.hash(state); } break; } } } } impl<'a, T0, T1, S: Hasher> _typle_fn_hash for (&'a (T0, T1), &'a mut S) where T0: Hash, T1: Hash, T1: ?Sized, { type Return = (); fn apply(self) -> Self::Return { let (tuple, state) = self; { loop { { tuple.0.hash(state); } { tuple.1.hash(state); } break; } } } } impl<'a, T0, T1, T2, S: Hasher> _typle_fn_hash for (&'a (T0, T1, T2), &'a mut S) where T0: Hash, T1: Hash, T2: Hash, T2: ?Sized, { type Return = (); fn apply(self) -> Self::Return { let (tuple, state) = self; { loop { { tuple.0.hash(state); } { tuple.1.hash(state); } { tuple.2.hash(state); } break; } } } } pub fn hash<'a, T, S>( tuple: &'a T, state: &'a mut S, ) -> <(&'a T, &'a mut S) as _typle_fn_hash>::Return where (&'a T, &'a mut S): _typle_fn_hash, { <(&'a T, &'a mut S) as _typle_fn_hash>::apply((tuple, state)) } #[allow(non_camel_case_types)] trait _typle_fn_multiply { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_multiply for ((), M) where M: Copy, { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t, m) = self; { () } } } impl _typle_fn_multiply for ((T0,), M) where T0: Mul, M: Copy, { type Return = (>::Output,); fn apply(self) -> Self::Return { let (t, m) = self; { (t.0 * m,) } } } impl _typle_fn_multiply for ((T0, T1), M) where T0: Mul, T1: Mul, M: Copy, { type Return = (>::Output, >::Output); fn apply(self) -> Self::Return { let (t, m) = self; { (t.0 * m, t.1 * m) } } } impl _typle_fn_multiply for ((T0, T1, T2), M) where T0: Mul, T1: Mul, T2: Mul, M: Copy, { type Return = ( >::Output, >::Output, >::Output, ); fn apply(self) -> Self::Return { let (t, m) = self; { (t.0 * m, t.1 * m, t.2 * m) } } } fn multiply(t: T, m: M) -> <(T, M) as _typle_fn_multiply>::Return where (T, M): _typle_fn_multiply, { <(T, M) as _typle_fn_multiply>::apply((t, m)) } #[allow(non_camel_case_types)] trait _typle_fn_heapify { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_heapify for ((),) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (params,) = self; { () } } } impl _typle_fn_heapify for ((T0,),) { type Return = (Box,); fn apply(self) -> Self::Return { let (params,) = self; { (Box::new(params.0),) } } } impl _typle_fn_heapify for ((T0, T1),) { type Return = (Box, Box); fn apply(self) -> Self::Return { let (params,) = self; { (Box::new(params.0), Box::new(params.1)) } } } impl _typle_fn_heapify for ((T0, T1, T2),) { type Return = (Box, Box, Box); fn apply(self) -> Self::Return { let (params,) = self; { (Box::new(params.0), Box::new(params.1), Box::new(params.2)) } } } fn heapify(params: T) -> <(T,) as _typle_fn_heapify>::Return where (T,): _typle_fn_heapify, { <(T,) as _typle_fn_heapify>::apply((params,)) } #[allow(non_camel_case_types)] pub trait _typle_fn_zip { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_zip for ((), ()) { type Return = (); #[rustfmt::skip] fn apply(self) -> Self::Return { #[allow(unused_variables)] let (first, second) = self; { () } } } impl _typle_fn_zip for ((A0,), (B0,)) { type Return = ((A0, B0),); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ((first.0, second.0),) } } } impl _typle_fn_zip for ((A0, A1), (B0, B1)) { type Return = ((A0, B0), (A1, B1)); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ((first.0, second.0), (first.1, second.1)) } } } impl _typle_fn_zip for ((A0, A1, A2), (B0, B1, B2)) { type Return = ((A0, B0), (A1, B1), (A2, B2)); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ((first.0, second.0), (first.1, second.1), (first.2, second.2)) } } } impl _typle_fn_zip for ((A0, A1, A2, A3), (B0, B1, B2, B3)) { type Return = ((A0, B0), (A1, B1), (A2, B2), (A3, B3)); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), ) } } } impl _typle_fn_zip for ((A0, A1, A2, A3, A4), (B0, B1, B2, B3, B4)) { type Return = ((A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4)); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), ) } } } impl _typle_fn_zip for ((A0, A1, A2, A3, A4, A5), (B0, B1, B2, B3, B4, B5)) { type Return = ((A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5)); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), ) } } } impl _typle_fn_zip for ((A0, A1, A2, A3, A4, A5, A6), (B0, B1, B2, B3, B4, B5, B6)) { type Return = ( (A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5), (A6, B6), ); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), (first.6, second.6), ) } } } impl _typle_fn_zip for ((A0, A1, A2, A3, A4, A5, A6, A7), (B0, B1, B2, B3, B4, B5, B6, B7)) { type Return = ( (A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5), (A6, B6), (A7, B7), ); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), (first.6, second.6), (first.7, second.7), ) } } } impl< A0, A1, A2, A3, A4, A5, A6, A7, A8, B0, B1, B2, B3, B4, B5, B6, B7, B8, > _typle_fn_zip for ((A0, A1, A2, A3, A4, A5, A6, A7, A8), (B0, B1, B2, B3, B4, B5, B6, B7, B8)) { type Return = ( (A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5), (A6, B6), (A7, B7), (A8, B8), ); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), (first.6, second.6), (first.7, second.7), (first.8, second.8), ) } } } impl< A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, > _typle_fn_zip for ( (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9), (B0, B1, B2, B3, B4, B5, B6, B7, B8, B9), ) { type Return = ( (A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5), (A6, B6), (A7, B7), (A8, B8), (A9, B9), ); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), (first.6, second.6), (first.7, second.7), (first.8, second.8), (first.9, second.9), ) } } } impl< A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, > _typle_fn_zip for ( (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10), (B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10), ) { type Return = ( (A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5), (A6, B6), (A7, B7), (A8, B8), (A9, B9), (A10, B10), ); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), (first.6, second.6), (first.7, second.7), (first.8, second.8), (first.9, second.9), (first.10, second.10), ) } } } impl< A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, > _typle_fn_zip for ( (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11), (B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11), ) { type Return = ( (A0, B0), (A1, B1), (A2, B2), (A3, B3), (A4, B4), (A5, B5), (A6, B6), (A7, B7), (A8, B8), (A9, B9), (A10, B10), (A11, B11), ); #[rustfmt::skip] fn apply(self) -> Self::Return { let (first, second) = self; { ( (first.0, second.0), (first.1, second.1), (first.2, second.2), (first.3, second.3), (first.4, second.4), (first.5, second.5), (first.6, second.6), (first.7, second.7), (first.8, second.8), (first.9, second.9), (first.10, second.10), (first.11, second.11), ) } } } pub fn zip(first: A, second: B) -> <(A, B) as _typle_fn_zip>::Return where (A, B): _typle_fn_zip, { <(A, B) as _typle_fn_zip>::apply((first, second)) } #[allow(non_camel_case_types)] pub trait _typle_fn_double { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_double for ((),) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t,) = self; { () } } } impl _typle_fn_double for ((u32,),) { type Return = (u32,); fn apply(self) -> Self::Return { let (t,) = self; { (t.0 * 2,) } } } impl _typle_fn_double for ((u32, u32),) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (t,) = self; { (t.0 * 2, t.1 * 2) } } } impl _typle_fn_double for ((u32, u32, u32),) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (t,) = self; { (t.0 * 2, t.1 * 2, t.2 * 2) } } } pub fn double(t: T) -> <(T,) as _typle_fn_double>::Return where (T,): _typle_fn_double, { <(T,) as _typle_fn_double>::apply((t,)) } } pub mod get { #![allow(dead_code)] use typle::typle; pub struct MyStruct { t: T, } impl MyStruct<(T0,)> where T0: ToString, T0: Default, { fn select(&mut self) { ::std::option::Option::Some(&self.t.0); ::std::option::Option::None::<&std::convert::Infallible>; ::std::option::Option::None::<&std::convert::Infallible>; let _: Option = ::std::option::Option::None::< &std::convert::Infallible, > .map(ToString::to_string); let _: Option = ::std::option::Option::None::< &std::convert::Infallible, > .map(|s| s.to_string()); *::std::option::Option::Some(&mut self.t.0).unwrap() = ::default(); let i = 1; let _: Option = match i { 0 => ::std::option::Option::Some(&self.t.0).map(ToString::to_string), _ => { ::std::option::Option::None::<&std::convert::Infallible> .map(ToString::to_string) } }; } } impl MyStruct<(T0, T1)> where T0: ToString, T1: ToString, T0: Default, { fn select(&mut self) { ::std::option::Option::Some(&self.t.0); ::std::option::Option::Some(&self.t.1); ::std::option::Option::None::<&std::convert::Infallible>; let _: Option = ::std::option::Option::Some(&self.t.1) .map(ToString::to_string); let _: Option = ::std::option::Option::Some(&self.t.1) .map(|s| s.to_string()); *::std::option::Option::Some(&mut self.t.0).unwrap() = ::default(); let i = 1; let _: Option = match i { 0 => ::std::option::Option::Some(&self.t.0).map(ToString::to_string), 1 => ::std::option::Option::Some(&self.t.1).map(ToString::to_string), _ => { ::std::option::Option::None::<&std::convert::Infallible> .map(ToString::to_string) } }; } } } pub mod issue1 { #![allow(unused)] use typle::typle; pub trait Verifier { type Error; fn verify(&self, report: &()) -> Result<(), Self::Error>; } impl Verifier for (T0,) where T0: Verifier, ::Error: Into>, { type Error = Box; fn verify(&self, _report: &()) -> Result<(), Self::Error> { Ok(()) } } impl Verifier for (T0, T1) where T0: Verifier, T1: Verifier, ::Error: Into>, ::Error: Into>, { type Error = Box; fn verify(&self, _report: &()) -> Result<(), Self::Error> { Ok(()) } } impl Verifier for (T0, T1, T2) where T0: Verifier, T1: Verifier, T2: Verifier, ::Error: Into>, ::Error: Into>, ::Error: Into>, { type Error = Box; fn verify(&self, _report: &()) -> Result<(), Self::Error> { Ok(()) } } } pub mod macros { #![allow(dead_code)] use typle::typle; struct MyStruct { t: T, } impl MyStruct<(T0, T1, T2)> { fn call_macro(_t: (T0, T1, T2)) { "T"; "T :: LEN"; "(T0, T1, T2)"; "3"; } } } pub mod method { use typle::typle; #[allow(unused)] pub struct X { i: u32, } #[allow(non_camel_case_types)] pub trait _typle_fn_associated { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_associated for ((), u32) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t, i) = self; { () } } } impl _typle_fn_associated for ((u32,), u32) { type Return = (u32,); fn apply(self) -> Self::Return { let (t, i) = self; { (t.0 + i,) } } } impl _typle_fn_associated for ((u32, u32), u32) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (t, i) = self; { (t.0 + i, t.1 + i) } } } impl _typle_fn_associated for ((u32, u32, u32), u32) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (t, i) = self; { (t.0 + i, t.1 + i, t.2 + i) } } } #[allow(non_camel_case_types)] pub trait _typle_fn_inherent1 { type Return; fn apply(self) -> Self::Return; } impl<'a> _typle_fn_inherent1 for (&'a X, ()) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (_typle_self, t) = self; { () } } } impl<'a> _typle_fn_inherent1 for (&'a X, (u32,)) { type Return = (u32,); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { (t.0 + _typle_self.i,) } } } impl<'a> _typle_fn_inherent1 for (&'a X, (u32, u32)) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { (t.0 + _typle_self.i, t.1 + _typle_self.i) } } } impl<'a> _typle_fn_inherent1 for (&'a X, (u32, u32, u32)) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { (t.0 + _typle_self.i, t.1 + _typle_self.i, t.2 + _typle_self.i) } } } #[allow(non_camel_case_types)] pub trait _typle_fn_inherent2 { type Return; fn apply(self) -> Self::Return; } impl<'a> _typle_fn_inherent2 for (&'a X, ()) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (_typle_self, t) = self; { X::associated(t, _typle_self.i) } } } impl<'a> _typle_fn_inherent2 for (&'a X, (u32,)) { type Return = (u32,); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { X::associated(t, _typle_self.i) } } } impl<'a> _typle_fn_inherent2 for (&'a X, (u32, u32)) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { X::associated(t, _typle_self.i) } } } impl<'a> _typle_fn_inherent2 for (&'a X, (u32, u32, u32)) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { X::associated(t, _typle_self.i) } } } #[allow(non_camel_case_types)] pub trait _typle_fn_inherent3 { type Return; fn apply(self) -> Self::Return; } impl<'a> _typle_fn_inherent3 for (&'a mut X, ()) { type Return = (); #[allow(clippy::assign_op_pattern)] fn apply(self) -> Self::Return { #[allow(unused_variables)] let (_typle_self, t) = self; { _typle_self.i += 1; _typle_self.i = _typle_self.i + 1; t } } } impl<'a> _typle_fn_inherent3 for (&'a mut X, (u32,)) { type Return = (u32,); #[allow(clippy::assign_op_pattern)] fn apply(self) -> Self::Return { let (_typle_self, t) = self; { _typle_self.i += 1; _typle_self.i = _typle_self.i + 1; t } } } impl<'a> _typle_fn_inherent3 for (&'a mut X, (u32, u32)) { type Return = (u32, u32); #[allow(clippy::assign_op_pattern)] fn apply(self) -> Self::Return { let (_typle_self, t) = self; { _typle_self.i += 1; _typle_self.i = _typle_self.i + 1; t } } } impl<'a> _typle_fn_inherent3 for (&'a mut X, (u32, u32, u32)) { type Return = (u32, u32, u32); #[allow(clippy::assign_op_pattern)] fn apply(self) -> Self::Return { let (_typle_self, t) = self; { _typle_self.i += 1; _typle_self.i = _typle_self.i + 1; t } } } #[allow(non_camel_case_types)] pub trait _typle_fn_inherent4 { type Return; fn apply(self) -> Self::Return; } impl<'a> _typle_fn_inherent4 for (&'a X, ()) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (_typle_self, t) = self; { let _v: Vec = Vec::::new(); t } } } impl<'a> _typle_fn_inherent4 for (&'a X, (u32,)) { type Return = (u32,); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let _v: Vec = Vec::::new(); t } } } impl<'a> _typle_fn_inherent4 for (&'a X, (u32, u32)) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let _v: Vec = Vec::::new(); t } } } impl<'a> _typle_fn_inherent4 for (&'a X, (u32, u32, u32)) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let _v: Vec = Vec::::new(); t } } } #[allow(non_camel_case_types)] pub trait _typle_fn_inherent5 { type Return; fn apply(self) -> Self::Return; } impl<'a> _typle_fn_inherent5 for (&'a X, ()) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (_typle_self, t) = self; { #[allow(unused_variables)] let X { i } = _typle_self; () } } } impl<'a> _typle_fn_inherent5 for (&'a X, (u32,)) { type Return = (u32,); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let X { i } = _typle_self; (t.0 + i,) } } } impl<'a> _typle_fn_inherent5 for (&'a X, (u32, u32)) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let X { i } = _typle_self; (t.0 + i, t.1 + i) } } } impl<'a> _typle_fn_inherent5 for (&'a X, (u32, u32, u32)) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let X { i } = _typle_self; (t.0 + i, t.1 + i, t.2 + i) } } } #[allow(non_camel_case_types)] pub trait _typle_fn_inherent6 { type Return; fn apply(self) -> Self::Return; } impl<'a> _typle_fn_inherent6 for (&'a X, ()) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (_typle_self, t) = self; { #[allow(unused_variables)] let X { i } = _typle_self; () } } } impl<'a> _typle_fn_inherent6 for (&'a X, (u32,)) { type Return = (u32,); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let X { i } = _typle_self; (t.0 + i,) } } } impl<'a> _typle_fn_inherent6 for (&'a X, (u32, u32)) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let X { i } = _typle_self; (t.0 + i, t.1 + i) } } } impl<'a> _typle_fn_inherent6 for (&'a X, (u32, u32, u32)) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (_typle_self, t) = self; { let X { i } = _typle_self; (t.0 + i, t.1 + i, t.2 + i) } } } impl X { #[allow(unused)] pub fn new(i: u32) -> Self { Self { i } } pub fn associated(t: T, i: u32) -> <(T, u32) as _typle_fn_associated>::Return where (T, u32): _typle_fn_associated, { <(T, u32) as _typle_fn_associated>::apply((t, i)) } pub fn inherent1<'a, T>( &'a self, t: T, ) -> <(&'a X, T) as _typle_fn_inherent1>::Return where (&'a X, T): _typle_fn_inherent1, { <(&'a X, T) as _typle_fn_inherent1>::apply((self, t)) } pub fn inherent2<'a, T>( &'a self, t: T, ) -> <(&'a X, T) as _typle_fn_inherent2>::Return where (&'a X, T): _typle_fn_inherent2, { <(&'a X, T) as _typle_fn_inherent2>::apply((self, t)) } pub fn inherent3<'a, T>( &'a mut self, t: T, ) -> <(&'a mut X, T) as _typle_fn_inherent3>::Return where (&'a mut X, T): _typle_fn_inherent3, { <(&'a mut X, T) as _typle_fn_inherent3>::apply((self, t)) } pub fn inherent4<'a, T>( &'a self, t: T, ) -> <(&'a X, T) as _typle_fn_inherent4>::Return where (&'a X, T): _typle_fn_inherent4, { <(&'a X, T) as _typle_fn_inherent4>::apply((self, t)) } pub fn inherent5<'a, T>( &'a self, t: T, ) -> <(&'a X, T) as _typle_fn_inherent5>::Return where (&'a X, T): _typle_fn_inherent5, { <(&'a X, T) as _typle_fn_inherent5>::apply((self, t)) } pub fn inherent6<'a, T>( &'a self, t: T, ) -> <(&'a X, T) as _typle_fn_inherent6>::Return where (&'a X, T): _typle_fn_inherent6, { <(&'a X, T) as _typle_fn_inherent6>::apply((self, t)) } } } pub mod pattern { #![allow(dead_code)] use typle::typle; pub struct MyStruct { t: T, } impl MyStruct<(u32, u32, u32)> { pub fn test_macro(&self) -> u32 { let (x0, x1): (u32, u32) = (self.t.0 * 3, self.t.1 * 3); x0 + x1 } pub fn component(&self) -> u32 { let x1: u32 = self.t.1; x1 } pub fn test_slice(&self) -> u32 { let [x0, x1] = [self.t.0 * 3, self.t.1 * 3]; x0 + x1 } pub fn test_tuple(&self) -> u32 { let (x0, x1) = (self.t.0 * 3, self.t.1 * 3); x0 + x1 } } #[allow(non_camel_case_types)] trait _typle_fn_multiply_by { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_multiply_by for ((u32,), u32) { type Return = (u32,); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0,) = (t.0 * m,); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0,) } } } impl _typle_fn_multiply_by for ((u32, u32), u32) { type Return = (u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1) = (t.0 * m, t.1 * m); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1) } } } impl _typle_fn_multiply_by for ((u32, u32, u32), u32) { type Return = (u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2) = (t.0 * m, t.1 * m, t.2 * m); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3) = (t.0 * m, t.1 * m, t.2 * m, t.3 * m); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4) = (t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5, x6) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, t.6 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5, x6) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5, x6, x7) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, t.6 * m, t.7 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5, x6, x7) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5, x6, x7, x8) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, t.6 * m, t.7 * m, t.8 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5, x6, x7, x8) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, t.6 * m, t.7 * m, t.8 * m, t.9 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, t.6 * m, t.7 * m, t.8 * m, t.9 * m, t.10 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) } } } impl _typle_fn_multiply_by for ((u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32), u32) { type Return = (u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32, u32); fn apply(self) -> Self::Return { let (t, m) = self; { let (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) = ( t.0 * m, t.1 * m, t.2 * m, t.3 * m, t.4 * m, t.5 * m, t.6 * m, t.7 * m, t.8 * m, t.9 * m, t.10 * m, t.11 * m, ); match (&x0, &(t.0 * m)) { (left_val, right_val) => { if !(*left_val == *right_val) { let kind = ::core::panicking::AssertKind::Eq; ::core::panicking::assert_failed( kind, &*left_val, &*right_val, ::core::option::Option::None, ); } } }; (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) } } } fn multiply_by(t: T, m: u32) -> <(T, u32) as _typle_fn_multiply_by>::Return where (T, u32): _typle_fn_multiply_by, { <(T, u32) as _typle_fn_multiply_by>::apply((t, m)) } } pub mod type_alias { #![allow(type_alias_bounds, unused)] use typle::typle; trait Process { type State; type Output; fn process( state: Self::State, ) -> Result>; } type Alias where T0: Process, T1: Process, T2: Process, = (Option<::Output>, Option<::Output>, Option<::Output>); } pub mod typle_args { #![allow(unused)] use typle::typle; #[allow(non_camel_case_types)] trait _typle_fn_append { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_append for ((), A) { type Return = (A,); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t, a) = self; { (a,) } } } impl _typle_fn_append for ((T0,), A) { type Return = (T0, A); fn apply(self) -> Self::Return { let (t, a) = self; { (t.0, a) } } } impl _typle_fn_append for ((T0, T1), A) { type Return = (T0, T1, A); fn apply(self) -> Self::Return { let (t, a) = self; { (t.0, t.1, a) } } } impl _typle_fn_append for ((T0, T1, T2), A) { type Return = (T0, T1, T2, A); fn apply(self) -> Self::Return { let (t, a) = self; { (t.0, t.1, t.2, a) } } } fn append(t: T, a: A) -> <(T, A) as _typle_fn_append>::Return where (T, A): _typle_fn_append, { <(T, A) as _typle_fn_append>::apply((t, a)) } #[allow(non_camel_case_types)] trait _typle_fn_append_array { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_append_array for ((bool,), bool) { type Return = [bool; 1 + 1]; fn apply(self) -> Self::Return { let (t, a) = self; { [t.0, a] } } } impl _typle_fn_append_array for ((bool, bool), bool) { type Return = [bool; 2 + 1]; fn apply(self) -> Self::Return { let (t, a) = self; { [t.0, t.1, a] } } } impl _typle_fn_append_array for ((bool, bool, bool), bool) { type Return = [bool; 3 + 1]; fn apply(self) -> Self::Return { let (t, a) = self; { [t.0, t.1, t.2, a] } } } fn append_array(t: T, a: bool) -> <(T, bool) as _typle_fn_append_array>::Return where (T, bool): _typle_fn_append_array, { <(T, bool) as _typle_fn_append_array>::apply((t, a)) } #[allow(non_camel_case_types)] trait _typle_fn_append_double { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_append_double for ((u32,), u32) { type Return = [u32; 1 + 1]; fn apply(self) -> Self::Return { let (t, a) = self; { [2 * t.0, 2 * a] } } } impl _typle_fn_append_double for ((u32, u32), u32) { type Return = [u32; 2 + 1]; fn apply(self) -> Self::Return { let (t, a) = self; { [2 * t.0, 2 * t.1, 2 * a] } } } impl _typle_fn_append_double for ((u32, u32, u32), u32) { type Return = [u32; 3 + 1]; fn apply(self) -> Self::Return { let (t, a) = self; { [2 * t.0, 2 * t.1, 2 * t.2, 2 * a] } } } fn append_double(t: T, a: u32) -> <(T, u32) as _typle_fn_append_double>::Return where (T, u32): _typle_fn_append_double, { <(T, u32) as _typle_fn_append_double>::apply((t, a)) } #[allow(non_camel_case_types)] trait _typle_fn_append_even { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_append_even for ((), u32) { type Return = (u32,); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t, a) = self; { (a,) } } } impl _typle_fn_append_even for ((T0,), u32) { type Return = (T0, u32); fn apply(self) -> Self::Return { let (t, a) = self; { (t.0, a) } } } impl _typle_fn_append_even for ((T0, T1), u32) { type Return = (T0, u32); fn apply(self) -> Self::Return { let (t, a) = self; { (t.0, a) } } } impl _typle_fn_append_even for ((T0, T1, T2), u32) { type Return = (T0, T2, u32); fn apply(self) -> Self::Return { let (t, a) = self; { (t.0, t.2, a) } } } fn append_even(t: T, a: u32) -> <(T, u32) as _typle_fn_append_even>::Return where (T, u32): _typle_fn_append_even, { <(T, u32) as _typle_fn_append_even>::apply((t, a)) } #[allow(non_camel_case_types)] trait _typle_fn_even_string_odd { type Return; fn apply(self) -> Self::Return; } impl _typle_fn_even_string_odd for ((),) { type Return = (); fn apply(self) -> Self::Return { #[allow(unused_variables)] let (t,) = self; { #[allow(clippy::unused_unit)] () } } } impl _typle_fn_even_string_odd for ((T0,),) where T0: ToString, { type Return = (String,); fn apply(self) -> Self::Return { let (t,) = self; { (t.0.to_string(),) } } } impl _typle_fn_even_string_odd for ((T0, T1),) where T0: ToString, { type Return = (String, T1); fn apply(self) -> Self::Return { let (t,) = self; { (t.0.to_string(), t.1) } } } impl _typle_fn_even_string_odd for ((T0, T1, T2),) where T0: ToString, T2: ToString, { type Return = (String, T1, String); fn apply(self) -> Self::Return { let (t,) = self; { (t.0.to_string(), t.1, t.2.to_string()) } } } fn even_string_odd(t: T) -> <(T,) as _typle_fn_even_string_odd>::Return where (T,): _typle_fn_even_string_odd, { <(T,) as _typle_fn_even_string_odd>::apply((t,)) } struct World {} trait ExclusiveSystemParam {} struct ExclusiveSystemParamItem { f: F, } trait ExclusiveSystemParamFunction { type In; type Out; type Param; fn run( &mut self, world: &mut World, _in: Self::In, param_value: ExclusiveSystemParamItem, ) -> Self::Out; } impl ExclusiveSystemParamFunction Out> for Func where for<'a> &'a mut Func: FnMut(&mut World) -> Out + FnMut(&mut World) -> Out, Out: 'static, { type In = (); type Out = Out; type Param = (); #[inline] fn run( &mut self, world: &mut World, _in: (), param_value: ExclusiveSystemParamItem<()>, ) -> Self::Out { ::core::panicking::panic("not yet implemented") } } impl< Out, Func: Send + Sync + 'static, F0, > ExclusiveSystemParamFunction Out> for Func where for<'a> &'a mut Func: FnMut(&mut World, F0) -> Out + FnMut(&mut World, ExclusiveSystemParamItem) -> Out, Out: 'static, F0: ExclusiveSystemParam, { type In = (); type Out = Out; type Param = (F0,); #[inline] fn run( &mut self, world: &mut World, _in: (), param_value: ExclusiveSystemParamItem<(F0,)>, ) -> Self::Out { ::core::panicking::panic("not yet implemented") } } impl< Out, Func: Send + Sync + 'static, F0, F1, > ExclusiveSystemParamFunction Out> for Func where for<'a> &'a mut Func: FnMut(&mut World, F0, F1) -> Out + FnMut( &mut World, ExclusiveSystemParamItem, ExclusiveSystemParamItem, ) -> Out, Out: 'static, F0: ExclusiveSystemParam, F1: ExclusiveSystemParam, { type In = (); type Out = Out; type Param = (F0, F1); #[inline] fn run( &mut self, world: &mut World, _in: (), param_value: ExclusiveSystemParamItem<(F0, F1)>, ) -> Self::Out { ::core::panicking::panic("not yet implemented") } } impl< Out, Func: Send + Sync + 'static, F0, F1, F2, > ExclusiveSystemParamFunction Out> for Func where for<'a> &'a mut Func: FnMut(&mut World, F0, F1, F2) -> Out + FnMut( &mut World, ExclusiveSystemParamItem, ExclusiveSystemParamItem, ExclusiveSystemParamItem, ) -> Out, Out: 'static, F0: ExclusiveSystemParam, F1: ExclusiveSystemParam, F2: ExclusiveSystemParam, { type In = (); type Out = Out; type Param = (F0, F1, F2); #[inline] fn run( &mut self, world: &mut World, _in: (), param_value: ExclusiveSystemParamItem<(F0, F1, F2)>, ) -> Self::Out { ::core::panicking::panic("not yet implemented") } } } pub mod typle_fold { use typle::typle; pub struct Something {} pub trait IsUseful { type State: IsUseful; } pub trait UsefulTrait { type UsefulType: IsUseful; const SIZE: usize; #[allow(dead_code)] fn display(&self) -> String; } impl UsefulTrait for (T0,) where T0: UsefulTrait + std::fmt::Display, { type UsefulType = ::UsefulType; const SIZE: usize = (loop { let total = 0; let total = total + ::SIZE; break total; }); fn display(&self) -> String { ("[".to_string() + &self.0.to_string()) + "]" } } impl UsefulTrait for (T0, T1) where T0: UsefulTrait + std::fmt::Display, T1: UsefulTrait + std::fmt::Display, ::UsefulType: IsUseful<::UsefulType>, { type UsefulType = <::UsefulType as IsUseful<::UsefulType>>::State; const SIZE: usize = (loop { let total = 0; let total = total + ::SIZE; let total = total + ::SIZE; break total; }); fn display(&self) -> String { (loop { let s = "[".to_string() + &self.0.to_string(); let s = s + "," + &self.1.to_string(); break s; }) + "]" } } impl UsefulTrait for (T0, T1, T2) where T0: UsefulTrait + std::fmt::Display, T1: UsefulTrait + std::fmt::Display, T2: UsefulTrait + std::fmt::Display, ::UsefulType: IsUseful<::UsefulType>, ::UsefulType: IsUseful< <::UsefulType as IsUseful<::UsefulType>>::State, >, { type UsefulType = <::UsefulType as IsUseful< <::UsefulType as IsUseful<::UsefulType>>::State, >>::State; const SIZE: usize = (loop { let total = 0; let total = total + ::SIZE; let total = total + ::SIZE; let total = total + ::SIZE; break total; }); fn display(&self) -> String { (loop { let s = "[".to_string() + &self.0.to_string(); let s = s + "," + &self.1.to_string(); let s = s + "," + &self.2.to_string(); break s; }) + "]" } } } pub mod unzip { use typle::typle; pub trait TryUnzip { type Output; type Error; fn try_unzip(self) -> Result; } pub trait TryUnzipModified { type Error; fn try_unzip(self) -> Result; } impl TryUnzipModified<(Vec, Vec)> for I where I: Iterator>, { type Error = E; fn try_unzip(self) -> Result<(Vec, Vec), Self::Error> { let mut vecs = (Vec::new(), Vec::new()); for result in self { let t = result?; loop { { vecs.0.push(t.0); } { vecs.1.push(t.1); } break; } } Ok(vecs) } } impl TryUnzipModified<(Vec, Vec, Vec)> for I where I: Iterator>, { type Error = E; fn try_unzip(self) -> Result<(Vec, Vec, Vec), Self::Error> { let mut vecs = (Vec::new(), Vec::new(), Vec::new()); for result in self { let t = result?; loop { { vecs.0.push(t.0); } { vecs.1.push(t.1); } { vecs.2.push(t.2); } break; } } Ok(vecs) } } pub trait TryUnzipTuple { type Output; fn try_unzip(iter: I) -> Result where I: Iterator>; } impl TryUnzipTuple<(T0, T1), E> for (T0, T1) { type Output = (Vec, Vec); fn try_unzip(iter: I) -> Result where I: Iterator>, { let mut vecs = (Vec::new(), Vec::new()); for result in iter { let t = result?; loop { { vecs.0.push(t.0); } { vecs.1.push(t.1); } break; } } Ok(vecs) } } impl TryUnzipTuple<(T0, T1, T2), E> for (T0, T1, T2) { type Output = (Vec, Vec, Vec); fn try_unzip(iter: I) -> Result where I: Iterator>, { let mut vecs = (Vec::new(), Vec::new(), Vec::new()); for result in iter { let t = result?; loop { { vecs.0.push(t.0); } { vecs.1.push(t.1); } { vecs.2.push(t.2); } break; } } Ok(vecs) } } impl TryUnzip for I where I: Iterator>, T: TryUnzipTuple, { type Output = >::Output; type Error = E; fn try_unzip(self) -> Result { >::try_unzip(self) } } }