Skip to content

Commit 91a0e16

Browse files
committedMar 7, 2025
Auto merge of #138127 - compiler-errors:rollup-kcarqrz, r=compiler-errors
Rollup of 17 pull requests Successful merges: - #137827 (Add timestamp to unstable feature usage metrics) - #138041 (bootstrap and compiletest: Use `size_of_val` from the prelude instead of imported) - #138046 (trim channel value in `get_closest_merge_commit`) - #138053 (Increase the max. custom try jobs requested to `20`) - #138061 (triagebot: add a `compiler_leads` ad-hoc group) - #138064 (Remove - from xtensa targets cpu names) - #138075 (Use final path segment for diagnostic) - #138078 (Reduce the noise of bootstrap changelog warnings in --dry-run mode) - #138081 (Move `yield` expressions behind their own feature gate) - #138090 (`librustdoc`: flatten nested ifs) - #138092 (Re-add `DynSend` and `DynSync` impls for `TyCtxt`) - #138094 (a small borrowck cleanup) - #138098 (Stabilize feature `const_copy_from_slice`) - #138103 (Git ignore citool's target directory) - #138105 (Fix broken link to Miri intrinsics in documentation) - #138108 (Mention me (WaffleLapkin) when changes to `rustc_codegen_ssa` occur) - #138117 ([llvm/PassWrapper] use `size_t` when building arg strings) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 98a4878 + e6d1856 commit 91a0e16

Some content is hidden

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

51 files changed

+377
-335
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ no_llvm_build
5353
/target
5454
/library/target
5555
/src/bootstrap/target
56+
/src/ci/citool/target
5657
/src/tools/x/target
5758
# Created by `x vendor`
5859
/vendor

‎compiler/rustc_ast_lowering/src/expr.rs

+14-21
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
16901690
let yielded =
16911691
opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| self.expr_unit(span));
16921692

1693+
if !self.tcx.features().yield_expr()
1694+
&& !self.tcx.features().coroutines()
1695+
&& !self.tcx.features().gen_blocks()
1696+
{
1697+
rustc_session::parse::feature_err(
1698+
&self.tcx.sess,
1699+
sym::yield_expr,
1700+
span,
1701+
fluent_generated::ast_lowering_yield,
1702+
)
1703+
.emit();
1704+
}
1705+
16931706
let is_async_gen = match self.coroutine_kind {
16941707
Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Gen, _)) => false,
16951708
Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::AsyncGen, _)) => true,
@@ -1714,28 +1727,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
17141727
None,
17151728
);
17161729
}
1717-
Some(hir::CoroutineKind::Coroutine(_)) => {
1718-
if !self.tcx.features().coroutines() {
1719-
rustc_session::parse::feature_err(
1720-
&self.tcx.sess,
1721-
sym::coroutines,
1722-
span,
1723-
fluent_generated::ast_lowering_yield,
1724-
)
1725-
.emit();
1726-
}
1727-
false
1728-
}
1730+
Some(hir::CoroutineKind::Coroutine(_)) => false,
17291731
None => {
1730-
if !self.tcx.features().coroutines() {
1731-
rustc_session::parse::feature_err(
1732-
&self.tcx.sess,
1733-
sym::coroutines,
1734-
span,
1735-
fluent_generated::ast_lowering_yield,
1736-
)
1737-
.emit();
1738-
}
17391732
let suggestion = self.current_item.map(|s| s.shrink_to_lo());
17401733
self.dcx().emit_err(YieldInClosure { span, suggestion });
17411734
self.coroutine_kind = Some(hir::CoroutineKind::Coroutine(Movability::Movable));

0 commit comments

Comments
 (0)