|
115 | 115 | //! // Generic associated types, the return values are moved to here.
|
116 | 116 | //! // NOTE: all #[send] methods also get the `Send` trait bound.
|
117 | 117 | //! type OpenFuture<'a>: ::core::future::Future<Output = Result<FileDescriptor, Errno>> +
|
118 |
| -//! ::core::marker::Send + 'a; |
119 |
| -//! type ReadFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a; |
120 |
| -//! type WriteFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a; |
121 |
| -//! type CloseFuture<'a>: ::core::future::Future<Output = Result<(), Errno>> + 'a; |
| 118 | +//! ::core::marker::Send + 'a where Self: 'a; |
| 119 | +//! type ReadFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a where Self: 'a; |
| 120 | +//! type WriteFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a where Self: 'a; |
| 121 | +//! type CloseFuture<'a>: ::core::future::Future<Output = Result<(), Errno>> + 'a where Self: 'a; |
122 | 122 | //! }
|
123 | 123 | //! ```
|
124 | 124 | //!
|
|
133 | 133 | //! # fn read<'a>(&'a self, fd: FileDescriptor, buf: &'a mut [u8]) -> Self::ReadFuture<'a>;
|
134 | 134 | //! # fn write<'a>(&'a self, fd: FileDescriptor, buf: &'a [u8]) -> Self::WriteFuture<'a>;
|
135 | 135 | //! # fn close<'a>(&'a self, fd: FileDescriptor) -> Self::CloseFuture<'a>;
|
136 |
| -//! # type OpenFuture<'a>: ::core::future::Future<Output = Result<FileDescriptor, Errno>> + Send + 'a; |
137 |
| -//! # type ReadFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a; |
138 |
| -//! # type WriteFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a; |
139 |
| -//! # type CloseFuture<'a>: ::core::future::Future<Output = Result<(), Errno>> + 'a; |
| 136 | +//! # type OpenFuture<'a>: ::core::future::Future<Output = Result<FileDescriptor, Errno>> + Send + 'a where Self: 'a; |
| 137 | +//! # type ReadFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a where Self: 'a; |
| 138 | +//! # type WriteFuture<'a>: ::core::future::Future<Output = Result<usize, Errno>> + 'a where Self: 'a; |
| 139 | +//! # type CloseFuture<'a>: ::core::future::Future<Output = Result<(), Errno>> + 'a where Self: 'a; |
140 | 140 | //! # }
|
141 | 141 | //! # const ENOENT: Errno = Errno;
|
142 | 142 | //! # const EBADF: Errno = Errno;
|
|
188 | 188 |
|
189 | 189 | extern crate proc_macro;
|
190 | 190 |
|
| 191 | +use std::iter::FromIterator; |
191 | 192 | use std::str::FromStr;
|
192 | 193 | use std::{iter, mem};
|
193 | 194 |
|
194 | 195 | use proc_macro2::{Span, TokenStream};
|
195 | 196 | use quote::quote;
|
196 | 197 | use syn::punctuated::Punctuated;
|
197 |
| -use syn::token; |
| 198 | +use syn::token::Where; |
| 199 | +use syn::{token, PredicateType, WhereClause, WherePredicate}; |
198 | 200 | use syn::{
|
199 | 201 | AngleBracketedGenericArguments, AttrStyle, Attribute, Binding, Block, Expr, ExprAsync, FnArg,
|
200 | 202 | GenericArgument, GenericParam, Generics, Ident, ImplItem, ImplItemType, ItemImpl, ItemTrait,
|
|
0 commit comments