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:
commit
152a4e90d1
14 changed files with 49 additions and 20 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue