Pass &mut std::task::Context to poll

This commit is contained in:
Pierre Krieger
2019-12-10 16:54:38 +01:00
parent 7e9175716e
commit 213c633b92
2 changed files with 3 additions and 3 deletions

View File

@ -389,7 +389,7 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
syn::NestedMeta::Meta(syn::Meta::NameValue(ref m)) if m.path.is_ident("poll_method") => {
if let syn::Lit::Str(ref s) = m.lit {
let ident: Ident = syn::parse_str(&s.value()).unwrap();
poll_method = quote!{#name::#ident(self)};
poll_method = quote!{#name::#ident(self, cx)};
}
}
_ => ()

View File

@ -134,7 +134,7 @@ fn custom_polling() {
}
#[allow(dead_code)]
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>() {
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>(_: &mut std::task::Context) {
require_net_behaviour::<Foo<TSubstream>>();
}
}
@ -190,7 +190,7 @@ fn custom_event_and_polling() {
}
#[allow(dead_code)]
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>() {
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>(_: &mut std::task::Context) {
require_net_behaviour::<Foo<TSubstream>>();
}
}