Skip to content

Rollup of 21 pull requests #119549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
85d2b6e
Remove unnecessary arm in check_expr_yield
compiler-errors Dec 23, 2023
f521b4c
suppress change-tracker warnings in containers
onur-ozkan Dec 27, 2023
8dd6fac
don't return suggestion message if no changes detected
onur-ozkan Dec 26, 2023
2c23c06
rc: Take *const T in is_dangling
taiki-e Dec 30, 2023
07adee7
is_coroutine -> is_coroutine_or_closure
compiler-errors Dec 30, 2023
847cd6c
Use the right type for upvars
compiler-errors Dec 30, 2023
86bd81f
Update tracking issue of naked_functions
nbdd0121 Dec 31, 2023
d796ad4
rustdoc ui: adjust tooltip z-index to be above sidebar
Dec 31, 2023
f118c76
Remove two unused feature gates from rustc_query_impl
bjorn3 Dec 31, 2023
5cbe41a
Document that File does not buffer reads/writes, refer to BufReader/B…
chfogelman Dec 26, 2023
884cb41
Minor improvements in comment for
gurry Jan 1, 2024
01ac44a
Pretty-print always-const trait predicates correctly
fmease Dec 31, 2023
b1853eb
use css variable for z-index of the sidebar
Dec 31, 2023
440ba5f
Update books
rustbot Jan 1, 2024
82a5745
Update deadlinks of `strict_provenance` lints
ShE3py Jan 1, 2024
3d0297a
Deny defaults for higher-ranked generic parameters
fmease Jan 1, 2024
23924fe
Mark myself as back from leave
oli-obk Jan 2, 2024
5e7c1b9
coverage: Avoid a query stability hazard in `function_coverage_map`
Zalathar Jan 2, 2024
94c43cc
Report I/O errors with emit_fatal not emit_err
saethlin Jan 2, 2024
ba86034
Don't synthesize host effect params for trait assoc fns marked const
fmease Jan 1, 2024
8f546aa
Turn a bug!() into a span_delay_bug()
fmease Jan 2, 2024
ae8e401
E0379: Make diagnostic more precise
fmease Jan 1, 2024
aa79904
E0379: Provide suggestions
fmease Jan 1, 2024
ee86b1f
llvm: Allow `noundef` in codegen tests
maurer Jan 2, 2024
6f49080
Update `thread_local` examples to use `local_key_cell_methods`
tgross35 Jan 2, 2024
d9d23fa
Fix: Properly set vendor in i686-win7-windows-msvc target
roblabla Jan 3, 2024
0d421c5
Add useful panic messages if queries fail to start
rsmyth-ecmi Dec 18, 2023
093bd08
Rollup merge of #119086 - RossSmyth:query_panics, r=compiler-errors
fmease Jan 3, 2024
893b6f6
Rollup merge of #119239 - compiler-errors:yield-coercion, r=davidtwco
fmease Jan 3, 2024
907922b
Rollup merge of #119298 - onur-ozkan:silence-change-tracker-warning-f…
fmease Jan 3, 2024
4e265d9
Rollup merge of #119319 - chfogelman:buffered-file-doc, r=the8472
fmease Jan 3, 2024
34ef194
Rollup merge of #119434 - taiki-e:rc-is-dangling, r=Mark-Simulacrum
fmease Jan 3, 2024
3053ced
Rollup merge of #119444 - compiler-errors:closure-or-coroutine, r=oli…
fmease Jan 3, 2024
699a70b
Rollup merge of #119474 - nbdd0121:naked, r=Nilstrieb
fmease Jan 3, 2024
b41b169
Rollup merge of #119476 - fmease:pp-always-const-trait-preds, r=compi…
fmease Jan 3, 2024
493792b
Rollup merge of #119477 - lukas-code:tooltip-z-index, r=notriddle
fmease Jan 3, 2024
394aaee
Rollup merge of #119479 - bjorn3:remove_unused_feature_gates, r=compi…
fmease Jan 3, 2024
5d6e35b
Rollup merge of #119487 - gurry:improve-freshner-comment, r=Nilstrieb
fmease Jan 3, 2024
1422615
Rollup merge of #119492 - rustbot:docs-update, r=ehuss
fmease Jan 3, 2024
b5618bc
Rollup merge of #119494 - fmease:deny-hr-param-defaults, r=compiler-e…
fmease Jan 3, 2024
39c2e6d
Rollup merge of #119498 - ShE3py:provenance-lints-doc, r=Nilstrieb
fmease Jan 3, 2024
8bce6fc
Rollup merge of #119505 - fmease:no-host-param-for-trait-fns, r=fee1-…
fmease Jan 3, 2024
a34754e
Rollup merge of #119510 - saethlin:fatal-io-errors, r=WaffleLapkin,Ni…
fmease Jan 3, 2024
c2debec
Rollup merge of #119512 - oli-obk:unleave, r=oli-obk
fmease Jan 3, 2024
ea39f19
Rollup merge of #119514 - Zalathar:query-stability, r=wesleywiser
fmease Jan 3, 2024
fcec407
Rollup merge of #119523 - maurer:fix-sparc-llvm-18, r=nikic
fmease Jan 3, 2024
a79fccc
Rollup merge of #119534 - tgross35:thread-local-example-updates, r=Jo…
fmease Jan 3, 2024
9b2a44a
Rollup merge of #119544 - roblabla:new-win7-targets, r=Nilstrieb
fmease Jan 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove unnecessary arm in check_expr_yield
compiler-errors committed Dec 23, 2023
commit 85d2b6e3f3c39489784b2f7ca54b33458a7b4da8
6 changes: 0 additions & 6 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
@@ -2071,12 +2071,6 @@ pub enum YieldSource {
Yield,
}

impl YieldSource {
pub fn is_await(&self) -> bool {
matches!(self, YieldSource::Await { .. })
}
}

impl fmt::Display for YieldSource {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(match self {
11 changes: 1 addition & 10 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
@@ -349,7 +349,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
ExprKind::Index(base, idx, brackets_span) => {
self.check_expr_index(base, idx, expr, brackets_span)
}
ExprKind::Yield(value, ref src) => self.check_expr_yield(value, expr, src),
ExprKind::Yield(value, _) => self.check_expr_yield(value, expr),
hir::ExprKind::Err(guar) => Ty::new_error(tcx, guar),
}
}
@@ -3155,22 +3155,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&self,
value: &'tcx hir::Expr<'tcx>,
expr: &'tcx hir::Expr<'tcx>,
src: &'tcx hir::YieldSource,
) -> Ty<'tcx> {
match self.resume_yield_tys {
Some((resume_ty, yield_ty)) => {
self.check_expr_coercible_to_type(value, yield_ty, None);

resume_ty
}
// Given that this `yield` expression was generated as a result of lowering a `.await`,
// we know that the yield type must be `()`; however, the context won't contain this
// information. Hence, we check the source of the yield expression here and check its
// value's type against `()` (this check should always hold).
None if src.is_await() => {
self.check_expr_coercible_to_type(value, Ty::new_unit(self.tcx), None);
Ty::new_unit(self.tcx)
}
_ => {
self.tcx.sess.emit_err(YieldExprOutsideOfCoroutine { span: expr.span });
// Avoid expressions without types during writeback (#78653).