Skip to content

Commit

Permalink
Rename break label
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Oct 1, 2024
1 parent b807ad6 commit 742540d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions async-stream-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl VisitMut for Scrub<'_> {
{
#[allow(unreachable_code)]
if false {
break 'check_stream_scope (loop {});
break '__async_stream_private_check_scope (loop {});
}
#yield_expr
}
Expand Down Expand Up @@ -234,7 +234,7 @@ pub fn stream_inner(input: TokenStream) -> TokenStream {
quote!({
let (mut __yield_tx, __yield_rx) = unsafe { #crate_path::__private::yielder::pair() };
#crate_path::__private::AsyncStream::new(__yield_rx, async move {
'check_stream_scope: {
'__async_stream_private_check_scope: {
#dummy_yield
#(#stmts)*
}
Expand Down Expand Up @@ -270,7 +270,7 @@ pub fn try_stream_inner(input: TokenStream) -> TokenStream {
quote!({
let (mut __yield_tx, __yield_rx) = unsafe { #crate_path::__private::yielder::pair() };
#crate_path::__private::AsyncStream::new(__yield_rx, async move {
'check_stream_scope: {
'__async_stream_private_check_scope: {
#dummy_yield
#(#stmts)*
}
Expand Down
32 changes: 16 additions & 16 deletions async-stream/tests/ui/unsoundness_issue_106.stderr
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
error[E0767]: use of unreachable label `'check_stream_scope`
--> tests/ui/unsoundness_issue_106.rs:15:10
error[E0767]: use of unreachable label `'__async_stream_private_check_scope`
--> tests/ui/unsoundness_issue_106.rs:14:10
|
15 | pin!(stream! {
14 | pin!(stream! {
| __________^
16 | | let yield_42 = asynk!(yield 42_usize);
17 | | let s = stream! {
18 | | yield Box::new(12345);
15 | | let yield_42 = asynk!(yield 42_usize);
16 | | let s = stream! {
17 | | yield Box::new(12345);
... |
27 | | }
28 | | })
26 | | }
27 | | })
| | ^
| | |
| |_____unreachable label `'check_stream_scope`
| |_____unreachable label `'__async_stream_private_check_scope`
| unreachable label defined here
|
= note: labels are unreachable through functions, closures, async blocks and modules
= note: this error originates in the macro `$crate::__private::stream_inner` which comes from the expansion of the macro `stream` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0267]: `break` inside `async` block
--> tests/ui/unsoundness_issue_106.rs:15:10
--> tests/ui/unsoundness_issue_106.rs:14:10
|
8 | async { $e }
| ----- enclosing `async` block
...
15 | pin!(stream! {
14 | pin!(stream! {
| __________^
16 | | let yield_42 = asynk!(yield 42_usize);
17 | | let s = stream! {
18 | | yield Box::new(12345);
15 | | let yield_42 = asynk!(yield 42_usize);
16 | | let s = stream! {
17 | | yield Box::new(12345);
... |
27 | | }
28 | | })
26 | | }
27 | | })
| |_____^ cannot `break` inside `async` block
|
= note: this error originates in the macro `$crate::__private::stream_inner` which comes from the expansion of the macro `stream` (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 742540d

Please sign in to comment.