From 4dbc68adfe629ac38f69876f022586ff9384bf9c Mon Sep 17 00:00:00 2001 From: Nikita Vilunov Date: Mon, 20 Nov 2023 17:19:12 +0100 Subject: [PATCH] Update rust toolchain --- .gitignore | 1 + crates/projection-xmpp/src/lib.rs | 2 +- crates/proto-xmpp/src/lib.rs | 4 ++-- crates/proto-xmpp/src/xml/mod.rs | 12 ++++++------ rust-toolchain | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index ce1cc97..75d301e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target /db.sqlite .idea/ +.DS_Store diff --git a/crates/projection-xmpp/src/lib.rs b/crates/projection-xmpp/src/lib.rs index 29b3dee..e4da283 100644 --- a/crates/projection-xmpp/src/lib.rs +++ b/crates/projection-xmpp/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(generators, generator_trait, type_alias_impl_trait, impl_trait_in_assoc_type)] +#![feature(coroutines, coroutine_trait, type_alias_impl_trait, impl_trait_in_assoc_type)] mod proto; diff --git a/crates/proto-xmpp/src/lib.rs b/crates/proto-xmpp/src/lib.rs index ee85319..feb3660 100644 --- a/crates/proto-xmpp/src/lib.rs +++ b/crates/proto-xmpp/src/lib.rs @@ -1,6 +1,6 @@ #![feature( - generators, - generator_trait, + coroutines, + coroutine_trait, type_alias_impl_trait, impl_trait_in_assoc_type )] diff --git a/crates/proto-xmpp/src/xml/mod.rs b/crates/proto-xmpp/src/xml/mod.rs index c67fe49..83a37af 100644 --- a/crates/proto-xmpp/src/xml/mod.rs +++ b/crates/proto-xmpp/src/xml/mod.rs @@ -1,4 +1,4 @@ -use std::ops::Generator; +use std::ops::Coroutine; use std::pin::Pin; use quick_xml::NsReader; @@ -37,7 +37,7 @@ pub trait Parser: Sized { impl Parser for T where - T: Generator<(ResolveResult<'static>, &'static Event<'static>), Yield = (), Return = Out> + T: Coroutine<(ResolveResult<'static>, &'static Event<'static>), Yield = (), Return = Out> + Unpin, { type Output = Out; @@ -48,13 +48,13 @@ where event: &Event<'a>, ) -> Continuation { let s = Pin::new(&mut self); - // this is a very rude workaround fixing the fact that rust generators - // 1. don't support higher-kinded lifetimes (i.e. no `impl for <'a> Generator>) + // this is a very rude workaround fixing the fact that rust coroutines + // 1. don't support higher-kinded lifetimes (i.e. no `impl for <'a> Coroutine>) // 2. don't track borrows across yield points and lack thereof // implementors of Parser should manually check that inputs are not used across yields match s.resume(unsafe { std::mem::transmute((namespace, event)) }) { - std::ops::GeneratorState::Yielded(()) => Continuation::Continue(self), - std::ops::GeneratorState::Complete(res) => Continuation::Final(res), + std::ops::CoroutineState::Yielded(()) => Continuation::Continue(self), + std::ops::CoroutineState::Complete(res) => Continuation::Final(res), } } } diff --git a/rust-toolchain b/rust-toolchain index 38686d9..e1143b5 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-10-06 +nightly-2023-11-20