File tree 2 files changed +7
-3
lines changed 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ pub fn stream_inner(input: TokenStream) -> TokenStream {
227
227
} ;
228
228
229
229
quote ! ( {
230
- let ( mut __yield_tx, __yield_rx) = #crate_path:: __private:: yielder:: pair( ) ;
230
+ let ( mut __yield_tx, __yield_rx) = unsafe { #crate_path:: __private:: yielder:: pair( ) } ;
231
231
#crate_path:: __private:: AsyncStream :: new( __yield_rx, async move {
232
232
#dummy_yield
233
233
#( #stmts) *
@@ -261,7 +261,7 @@ pub fn try_stream_inner(input: TokenStream) -> TokenStream {
261
261
} ;
262
262
263
263
quote ! ( {
264
- let ( mut __yield_tx, __yield_rx) = #crate_path:: __private:: yielder:: pair( ) ;
264
+ let ( mut __yield_tx, __yield_rx) = unsafe { #crate_path:: __private:: yielder:: pair( ) } ;
265
265
#crate_path:: __private:: AsyncStream :: new( __yield_rx, async move {
266
266
#dummy_yield
267
267
#( #stmts) *
Original file line number Diff line number Diff line change @@ -20,8 +20,12 @@ pub(crate) struct Enter<'a, T> {
20
20
prev : * mut ( ) ,
21
21
}
22
22
23
+ // Note: It is considered unsound for anyone other than our macros to call
24
+ // this function. This is a private API intended only for calls from our
25
+ // macros, and users should never call it, but some people tend to
26
+ // misinterpret it as fine to call unless it is marked unsafe.
23
27
#[ doc( hidden) ]
24
- pub fn pair < T > ( ) -> ( Sender < T > , Receiver < T > ) {
28
+ pub unsafe fn pair < T > ( ) -> ( Sender < T > , Receiver < T > ) {
25
29
let tx = Sender { _p : PhantomData } ;
26
30
let rx = Receiver { _p : PhantomData } ;
27
31
( tx, rx)
You can’t perform that action at this time.
0 commit comments