Auto merge of #6296 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
This commit is contained in:
commit
b20d4c155d
@ -115,7 +115,7 @@ fn is_argument(map: rustc_middle::hir::map::Map<'_>, id: HirId) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
|
impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
|
||||||
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, mode: ConsumeMode) {
|
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, mode: ConsumeMode) {
|
||||||
if cmt.place.projections.is_empty() {
|
if cmt.place.projections.is_empty() {
|
||||||
if let PlaceBase::Local(lid) = cmt.place.base {
|
if let PlaceBase::Local(lid) = cmt.place.base {
|
||||||
if let ConsumeMode::Move = mode {
|
if let ConsumeMode::Move = mode {
|
||||||
@ -135,7 +135,7 @@ fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, mode: ConsumeMode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: ty::BorrowKind) {
|
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
|
||||||
if cmt.place.projections.is_empty() {
|
if cmt.place.projections.is_empty() {
|
||||||
if let PlaceBase::Local(lid) = cmt.place.base {
|
if let PlaceBase::Local(lid) = cmt.place.base {
|
||||||
self.set.remove(&lid);
|
self.set.remove(&lid);
|
||||||
@ -143,7 +143,7 @@ fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: ty::BorrowKind) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>) {
|
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
|
||||||
if cmt.place.projections.is_empty() {
|
if cmt.place.projections.is_empty() {
|
||||||
let map = &self.cx.tcx.hir();
|
let map = &self.cx.tcx.hir();
|
||||||
if is_argument(*map, cmt.hir_id) {
|
if is_argument(*map, cmt.hir_id) {
|
||||||
|
@ -1957,28 +1957,28 @@ struct MutatePairDelegate<'a, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Delegate<'tcx> for MutatePairDelegate<'_, 'tcx> {
|
impl<'tcx> Delegate<'tcx> for MutatePairDelegate<'_, 'tcx> {
|
||||||
fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: ConsumeMode) {}
|
fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId, _: ConsumeMode) {}
|
||||||
|
|
||||||
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, bk: ty::BorrowKind) {
|
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, diag_expr_id: HirId, bk: ty::BorrowKind) {
|
||||||
if let ty::BorrowKind::MutBorrow = bk {
|
if let ty::BorrowKind::MutBorrow = bk {
|
||||||
if let PlaceBase::Local(id) = cmt.place.base {
|
if let PlaceBase::Local(id) = cmt.place.base {
|
||||||
if Some(id) == self.hir_id_low {
|
if Some(id) == self.hir_id_low {
|
||||||
self.span_low = Some(self.cx.tcx.hir().span(cmt.hir_id))
|
self.span_low = Some(self.cx.tcx.hir().span(diag_expr_id))
|
||||||
}
|
}
|
||||||
if Some(id) == self.hir_id_high {
|
if Some(id) == self.hir_id_high {
|
||||||
self.span_high = Some(self.cx.tcx.hir().span(cmt.hir_id))
|
self.span_high = Some(self.cx.tcx.hir().span(diag_expr_id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>) {
|
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>, diag_expr_id: HirId) {
|
||||||
if let PlaceBase::Local(id) = cmt.place.base {
|
if let PlaceBase::Local(id) = cmt.place.base {
|
||||||
if Some(id) == self.hir_id_low {
|
if Some(id) == self.hir_id_low {
|
||||||
self.span_low = Some(self.cx.tcx.hir().span(cmt.hir_id))
|
self.span_low = Some(self.cx.tcx.hir().span(diag_expr_id))
|
||||||
}
|
}
|
||||||
if Some(id) == self.hir_id_high {
|
if Some(id) == self.hir_id_high {
|
||||||
self.span_high = Some(self.cx.tcx.hir().span(cmt.hir_id))
|
self.span_high = Some(self.cx.tcx.hir().span(diag_expr_id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,13 +325,13 @@ fn move_common(&mut self, cmt: &euv::PlaceWithHirId<'_>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt {
|
impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt {
|
||||||
fn consume(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, mode: euv::ConsumeMode) {
|
fn consume(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, _: HirId, mode: euv::ConsumeMode) {
|
||||||
if let euv::ConsumeMode::Move = mode {
|
if let euv::ConsumeMode::Move = mode {
|
||||||
self.move_common(cmt);
|
self.move_common(cmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn borrow(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: ty::BorrowKind) {}
|
fn borrow(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {}
|
||||||
|
|
||||||
fn mutate(&mut self, _: &euv::PlaceWithHirId<'tcx>) {}
|
fn mutate(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId) {}
|
||||||
}
|
}
|
||||||
|
@ -68,15 +68,15 @@ fn update(&mut self, cat: &PlaceWithHirId<'tcx>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
|
impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
|
||||||
fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: ConsumeMode) {}
|
fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId, _: ConsumeMode) {}
|
||||||
|
|
||||||
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, bk: ty::BorrowKind) {
|
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, bk: ty::BorrowKind) {
|
||||||
if let ty::BorrowKind::MutBorrow = bk {
|
if let ty::BorrowKind::MutBorrow = bk {
|
||||||
self.update(&cmt)
|
self.update(&cmt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>) {
|
fn mutate(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
|
||||||
self.update(&cmt)
|
self.update(&cmt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user