Skip to content

Commit 4680580

Browse files
committed
Auto merge of #60984 - matthewjasper:borrowck-error-reporting-cleanup, r=pnkfelix
Borrowck error reporting cleanup * Don't show variables created by desugarings in borrowck errors * Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods. * Remove unused `ScopeTree` parameter. r? @pnkfelix
2 parents fd8e23c + 8dc945c commit 4680580

File tree

11 files changed

+2108
-2020
lines changed

11 files changed

+2108
-2020
lines changed

src/librustc/mir/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,13 @@ impl<'tcx> LocalDecl<'tcx> {
915915
}
916916
}
917917

918+
/// Returns `true` is the local is from a compiler desugaring, e.g.,
919+
/// `__next` from a `for` loop.
920+
#[inline]
921+
pub fn from_compiler_desugaring(&self) -> bool {
922+
self.source_info.span.compiler_desugaring_kind().is_some()
923+
}
924+
918925
/// Creates a new `LocalDecl` for a temporary.
919926
#[inline]
920927
pub fn new_temp(ty: Ty<'tcx>, span: Span) -> Self {

0 commit comments

Comments
 (0)