Test that names of variables in external macros are not shown on a borrow error
This commit is contained in:
parent
f97b3c6044
commit
867b4c9e48
4 changed files with 65 additions and 0 deletions
|
|
@ -317,6 +317,14 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
|
|||
opt: DescribePlaceOpt,
|
||||
) -> Option<String> {
|
||||
let local = place.local;
|
||||
if self.body.local_decls[local]
|
||||
.source_info
|
||||
.span
|
||||
.in_external_macro(self.infcx.tcx.sess.source_map())
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut autoderef_index = None;
|
||||
let mut buf = String::new();
|
||||
let mut ok = self.append_local_to_string(local, &mut buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue