|
120 | 120 | //! - `T<0>: Clone` - the first component of the tuple implements the `Clone` trait. |
121 | 121 | //! - `T<{1..=2}>: Clone` - the second and third components implement the `Clone` trait. |
122 | 122 | //! - `typle!(j in .. => I<{j}>: Iterator<Item=T<{j}>>): Tuple::Bounds` - the most |
123 | | -//! general way to bound components, allowing typle index expressions on both |
124 | | -//! sides of the colon. Note that the suffix `: Tuple::Bounds` is required after |
125 | | -//! the macro, where `Tuple` is the name of the typle trait. |
| 123 | +//! general way to bound components, allowing typle index expressions on both |
| 124 | +//! sides of the colon. Note that the suffix `: Tuple::Bounds` is required after |
| 125 | +//! the macro, where `Tuple` is the name of the typle trait. |
126 | 126 | //! |
127 | 127 | //! ```rust |
128 | 128 | //! # use typle::typle; |
|
351 | 351 | //! T<_>: Extract, |
352 | 352 | //! { |
353 | 353 | //! // The output of all previous components plus the state of the current component. |
354 | | -//! S = typle_variant!( |
355 | | -//! curr in ..T::MAX => ( |
356 | | -//! typle! { |
357 | | -//! prev in ..curr => T::<{prev}>::Output |
358 | | -//! } |
359 | | -//! ), |
| 354 | +//! S = typle_variant!(curr in ..T::MAX => |
| 355 | +//! (typle! {prev in ..curr => T::<{prev}>::Output}), |
360 | 356 | //! Option<T<{curr}>::State> |
361 | 357 | //! ), |
362 | 358 | //! } |
|
408 | 404 | //! # T: Tuple, |
409 | 405 | //! # T<_>: Extract, |
410 | 406 | //! # { |
411 | | -//! # S = typle_variant!(i in ..T::MAX => |
412 | | -//! # (typle!(j in ..i => T::<{j}>::Output)), Option<T<{i}>::State> |
| 407 | +//! # S = typle_variant!(curr in ..T::MAX => |
| 408 | +//! # (typle! {prev in ..curr => T::<{prev}>::Output}), |
| 409 | +//! # Option<T<{curr}>::State> |
413 | 410 | //! # ), |
414 | 411 | //! # } |
415 | 412 | //! // Relevant traits may need to be implemented for the never type. |
|
591 | 588 | //! } |
592 | 589 | //! ``` |
593 | 590 | //! - Typle index variables can be shadowed by inner typle index variables |
594 | | -//! but cannot be shadowed by standard variables: |
| 591 | +//! but cannot be shadowed by standard variables: |
595 | 592 | //! ```rust |
596 | 593 | //! # use typle::typle; |
597 | 594 | //! # #[typle(Tuple for 1..=1)] |
|
631 | 628 | //! } |
632 | 629 | //! test_macro((0, 1, 2)); |
633 | 630 | //! ``` |
634 | | -//! |
635 | 631 |
|
636 | 632 | mod constant; |
637 | 633 | mod context; |
|
0 commit comments