Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7037eae

Browse files
committedApr 22, 2024
Auto merge of #124258 - GuillaumeGomez:rollup-2d3albo, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - #104087 (Stabilise inline_const) - #123792 (Require explicitly marking closures as coroutines) - #124057 (Fix ICE when ADT tail has type error) - #124178 ([cleanup] [llvm backend] Prevent creating the same `Instance::mono` multiple times) - #124220 (Miri: detect wrong vtables in wide pointers) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7f2fc33 + 23e24c7 commit 7037eae

File tree

397 files changed

+1784
-1279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+1784
-1279
lines changed
 

‎compiler/rustc_ast_lowering/messages.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,6 @@ ast_lowering_underscore_expr_lhs_assign =
163163
.label = `_` not allowed here
164164
165165
ast_lowering_use_angle_brackets = use angle brackets instead
166+
ast_lowering_yield_in_closure =
167+
`yield` can only be used in `#[coroutine]` closures, or `gen` blocks
168+
.suggestion = use `#[coroutine]` to make this closure a coroutine

‎compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,12 @@ pub(crate) struct NoPreciseCapturesOnApit {
421421
#[primary_span]
422422
pub span: Span,
423423
}
424+
425+
#[derive(Diagnostic)]
426+
#[diag(ast_lowering_yield_in_closure)]
427+
pub(crate) struct YieldInClosure {
428+
#[primary_span]
429+
pub span: Span,
430+
#[suggestion(code = "#[coroutine] ", applicability = "maybe-incorrect", style = "verbose")]
431+
pub suggestion: Option<Span>,
432+
}

0 commit comments

Comments
 (0)
Please sign in to comment.