diff --git a/src/generics.rs b/src/generics.rs index f0ebd7fe2..119ed86d0 100644 --- a/src/generics.rs +++ b/src/generics.rs @@ -248,34 +248,7 @@ impl Generics { predicates: Punctuated::new(), }) } -} - -/// Returned by `Generics::split_for_impl`. -#[cfg(feature = "printing")] -#[cfg_attr( - docsrs, - doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) -)] -pub struct ImplGenerics<'a>(&'a Generics); - -/// Returned by `Generics::split_for_impl`. -#[cfg(feature = "printing")] -#[cfg_attr( - docsrs, - doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) -)] -pub struct TypeGenerics<'a>(&'a Generics); -/// Returned by `TypeGenerics::as_turbofish`. -#[cfg(feature = "printing")] -#[cfg_attr( - docsrs, - doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) -)] -pub struct Turbofish<'a>(&'a Generics); - -#[cfg(feature = "printing")] -impl Generics { /// Split a type's generics into the pieces required for impl'ing a trait /// for that type. /// @@ -294,6 +267,7 @@ impl Generics { /// } /// # ; /// ``` + #[cfg(feature = "printing")] #[cfg_attr( docsrs, doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) @@ -307,6 +281,30 @@ impl Generics { } } +/// Returned by `Generics::split_for_impl`. +#[cfg(feature = "printing")] +#[cfg_attr( + docsrs, + doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) +)] +pub struct ImplGenerics<'a>(&'a Generics); + +/// Returned by `Generics::split_for_impl`. +#[cfg(feature = "printing")] +#[cfg_attr( + docsrs, + doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) +)] +pub struct TypeGenerics<'a>(&'a Generics); + +/// Returned by `TypeGenerics::as_turbofish`. +#[cfg(feature = "printing")] +#[cfg_attr( + docsrs, + doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))) +)] +pub struct Turbofish<'a>(&'a Generics); + #[cfg(feature = "printing")] macro_rules! generics_wrapper_impls { ($ty:ident) => {