Skip to content

Commit 1416f54

Browse files
authored
feat: update deps (#16)
1 parent ac98030 commit 1416f54

File tree

10 files changed

+21
-43
lines changed

10 files changed

+21
-43
lines changed

Cargo.lock

Lines changed: 9 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cxx-async/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ crate-type = ["lib"]
1818
[dependencies]
1919
async-recursion = "1"
2020
once_cell = "1"
21-
pin-utils = "0.1"
2221

2322
# CXX related dependencies
2423
cxx = { version = "1", features = ["c++20"] }

cxx-async/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ const SEND_RESULT_FINISHED: u32 = 2;
188188

189189
pub use cxx_async_macro::bridge;
190190

191-
#[doc(hidden)]
192-
pub use pin_utils::unsafe_pinned;
193-
194191
// Replacements for macros that panic that are guaranteed to cause an abort, so that we don't unwind
195192
// across C++ frames.
196193

examples/cppcoro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Patrick Walton <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
async-recursion = "0.3"
8+
async-recursion = "1"
99
once_cell = "1"
1010

1111
# CXX related dependencies

examples/cppcoro/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ fn main() {
1111

1212
cxx_build::bridge("src/main.rs")
1313
.file("src/cppcoro_example.cpp")
14+
.flag("-std=c++20")
1415
.flag_if_supported("-Wall")
1516
.include("include")
1617
.include("../common/include")

examples/cppcoro/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use futures::{StreamExt, TryStreamExt};
1212
use once_cell::sync::Lazy;
1313
use std::future::Future;
1414
use std::ops::Range;
15+
use std::pin::Pin;
1516

1617
#[cxx::bridge]
1718
mod ffi {

examples/folly/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Patrick Walton <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
async-recursion = "0.3"
8+
async-recursion = "1"
99
once_cell = "1"
1010

1111
# CXX related dependencies

examples/folly/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use futures::{StreamExt, TryStreamExt};
1212
use once_cell::sync::Lazy;
1313
use std::future::Future;
1414
use std::ops::Range;
15+
use std::pin::Pin;
1516

1617
#[cxx::bridge]
1718
mod ffi {

macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ proc-macro = true
1414
[dependencies]
1515
proc-macro2 = "1"
1616
quote = "1"
17-
syn = { version = "1", features = ["full"] }
17+
syn = { version = "2" }

macro/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ fn bridge_future(pieces: AstPieces) -> TokenStream {
120120
// method.
121121
// 3. The struct isn't `repr(packed)`. We define the struct and don't have this
122122
// attribute.
123-
::cxx_async::unsafe_pinned!(future: ::cxx_async::private::BoxFuture<'static,
124-
::cxx_async::CxxAsyncResult<#output>>);
123+
fn future(self: Pin<&mut Self>) -> Pin<&mut ::cxx_async::private::BoxFuture<'static, ::cxx_async::CxxAsyncResult<#output>>> {
124+
unsafe { self.map_unchecked_mut(|s| &mut s.future) }
125+
}
125126

126127
#[doc(hidden)]
127128
fn assert_field_is_unpin() {
@@ -272,8 +273,9 @@ fn bridge_stream(pieces: AstPieces) -> TokenStream {
272273
// method.
273274
// 3. The struct isn't `repr(packed)`. We define the struct and don't have this
274275
// attribute.
275-
::cxx_async::unsafe_pinned!(stream: ::cxx_async::private::BoxStream<'static,
276-
::cxx_async::CxxAsyncResult<#item>>);
276+
fn stream(self: Pin<&mut Self>) -> Pin<&mut ::cxx_async::private::BoxStream<'static, ::cxx_async::CxxAsyncResult<#item>>> {
277+
unsafe { self.map_unchecked_mut(|s| &mut s.stream) }
278+
}
277279

278280
#[doc(hidden)]
279281
fn assert_field_is_unpin() {

0 commit comments

Comments
 (0)