diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2023-07-28 14:44:03 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2023-07-28 14:44:03 +0000 |
| commit | 66d23793f08cef2360bde6afd23e6badaed5cc2f (patch) | |
| tree | 673b965ba6c7a6e8e8fa6a1c571a9278572ced55 /compiler/rustc_borrowck/src | |
| parent | 49a16b64b0a288c744929d7c0458c048c3f4cbf0 (diff) | |
| download | rust-66d23793f08cef2360bde6afd23e6badaed5cc2f.tar.gz rust-66d23793f08cef2360bde6afd23e6badaed5cc2f.zip | |
Account for macros when suggesting a new let binding
Diffstat (limited to 'compiler/rustc_borrowck/src')
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index 03b90f4ab18..28c0a444fc8 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -2133,13 +2133,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { self.current -= 1; } fn visit_expr(&mut self, expr: &hir::Expr<'tcx>) { - if self.span == expr.span { + if self.span == expr.span.source_callsite() { self.found = self.current; } walk_expr(self, expr); } } let source_info = self.body.source_info(location); + let proper_span = proper_span.source_callsite(); if let Some(scope) = self.body.source_scopes.get(source_info.scope) && let ClearCrossCrate::Set(scope_data) = &scope.local_data && let Some(node) = self.infcx.tcx.hir().find(scope_data.lint_root) |
