Skip to content

Commit 6513cff

Browse files
jdonszelmannm-ou-se
andcommitted
Don't name variables from external macros in borrow errors.
Co-authored-by: Mara Bos <[email protected]>
1 parent 6144e11 commit 6513cff

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,11 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
317317
opt: DescribePlaceOpt,
318318
) -> Option<String> {
319319
let local = place.local;
320-
if self.body.local_decls[local].source_info.span.in_external_macro(self.infcx.tcx.sess.source_map()) {
320+
if self.body.local_decls[local]
321+
.source_info
322+
.span
323+
.in_external_macro(self.infcx.tcx.sess.source_map())
324+
{
321325
return None;
322326
}
323327

src/doc/nomicon

src/gcc

Submodule gcc updated 29018 files

tests/ui/macros/auxiliary/return_from_external_macro.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ macro_rules! foo {
99
}
1010
};
1111
}
12-

0 commit comments

Comments
 (0)