1
Fork 0

Auto merge of #117585 - dnbln:feat/move-kw-span, r=cjgillot

Add the `Span` of the `move` keyword to the HIR.

This is required to implement a lint like the one described here: https://github.com/rust-lang/rust-clippy/issues/11721
This commit is contained in:
bors 2023-11-06 02:07:34 +00:00
commit 152a4e90d1
14 changed files with 49 additions and 20 deletions

View file

@ -2938,7 +2938,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
else {
bug!("expected closure in SizedClosureCapture obligation");
};
if let hir::CaptureBy::Value = closure.capture_clause
if let hir::CaptureBy::Value { .. } = closure.capture_clause
&& let Some(span) = closure.fn_arg_span
{
err.span_label(span, "this closure captures all values by move");