Skip to content

Commit 85bb664

Browse files
committed
cmt_ -> Place
1 parent b5a6714 commit 85bb664

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

clippy_lints/src/escape.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc::hir::intravisit as visit;
22
use rustc::hir::{self, *};
33
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
44
use rustc::middle::expr_use_visitor::*;
5-
use rustc::middle::mem_categorization::{cmt_, Categorization};
5+
use rustc::middle::mem_categorization::{Place, Categorization};
66
use rustc::ty::layout::LayoutOf;
77
use rustc::ty::{self, Ty};
88
use rustc::util::nodemap::HirIdSet;
@@ -105,7 +105,7 @@ fn is_argument(map: &hir::map::Map<'_>, id: HirId) -> bool {
105105
}
106106

107107
impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
108-
fn consume(&mut self, cmt: &cmt_<'tcx>, mode: ConsumeMode) {
108+
fn consume(&mut self, cmt: &Place<'tcx>, mode: ConsumeMode) {
109109
if let Categorization::Local(lid) = cmt.cat {
110110
if let ConsumeMode::Move = mode {
111111
// moved out or in. clearly can't be localized
@@ -125,13 +125,13 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
125125
}
126126
}
127127

128-
fn borrow(&mut self, cmt: &cmt_<'tcx>, _: ty::BorrowKind) {
128+
fn borrow(&mut self, cmt: &Place<'tcx>, _: ty::BorrowKind) {
129129
if let Categorization::Local(lid) = cmt.cat {
130130
self.set.remove(&lid);
131131
}
132132
}
133133

134-
fn mutate(&mut self, cmt: &cmt_<'tcx>) {
134+
fn mutate(&mut self, cmt: &Place<'tcx>) {
135135
let map = &self.cx.tcx.hir();
136136
if is_argument(map, cmt.hir_id) {
137137
// Skip closure arguments

clippy_lints/src/loops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::consts::{constant, Constant};
1313
use crate::utils::usage::mutated_variables;
1414
use crate::utils::{is_type_diagnostic_item, qpath_res, sext, sugg};
1515
use rustc::middle::expr_use_visitor::*;
16-
use rustc::middle::mem_categorization::cmt_;
16+
use rustc::middle::mem_categorization::Place;
1717
use rustc::middle::mem_categorization::Categorization;
1818
use rustc::ty::subst::Subst;
1919
use rustc::ty::{self, Ty};
@@ -1586,9 +1586,9 @@ struct MutatePairDelegate {
15861586
}
15871587

15881588
impl<'tcx> Delegate<'tcx> for MutatePairDelegate {
1589-
fn consume(&mut self, _: &cmt_<'tcx>, _: ConsumeMode) {}
1589+
fn consume(&mut self, _: &Place<'tcx>, _: ConsumeMode) {}
15901590

1591-
fn borrow(&mut self, cmt: &cmt_<'tcx>, bk: ty::BorrowKind) {
1591+
fn borrow(&mut self, cmt: &Place<'tcx>, bk: ty::BorrowKind) {
15921592
if let ty::BorrowKind::MutBorrow = bk {
15931593
if let Categorization::Local(id) = cmt.cat {
15941594
if Some(id) == self.hir_id_low {
@@ -1601,7 +1601,7 @@ impl<'tcx> Delegate<'tcx> for MutatePairDelegate {
16011601
}
16021602
}
16031603

1604-
fn mutate(&mut self, cmt: &cmt_<'tcx>) {
1604+
fn mutate(&mut self, cmt: &Place<'tcx>) {
16051605
if let Categorization::Local(id) = cmt.cat {
16061606
if Some(id) == self.hir_id_low {
16071607
self.span_low = Some(cmt.span)

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ struct MovedVariablesCtxt {
326326
}
327327

328328
impl MovedVariablesCtxt {
329-
fn move_common(&mut self, cmt: &mc::cmt_<'_>) {
329+
fn move_common(&mut self, cmt: &mc::Place<'_>) {
330330
let cmt = unwrap_downcast_or_interior(cmt);
331331

332332
if let mc::Categorization::Local(vid) = cmt.cat {
@@ -336,18 +336,18 @@ impl MovedVariablesCtxt {
336336
}
337337

338338
impl<'tcx> euv::Delegate<'tcx> for MovedVariablesCtxt {
339-
fn consume(&mut self, cmt: &mc::cmt_<'tcx>, mode: euv::ConsumeMode) {
339+
fn consume(&mut self, cmt: &mc::Place<'tcx>, mode: euv::ConsumeMode) {
340340
if let euv::ConsumeMode::Move = mode {
341341
self.move_common(cmt);
342342
}
343343
}
344344

345-
fn borrow(&mut self, _: &mc::cmt_<'tcx>, _: ty::BorrowKind) {}
345+
fn borrow(&mut self, _: &mc::Place<'tcx>, _: ty::BorrowKind) {}
346346

347-
fn mutate(&mut self, _: &mc::cmt_<'tcx>) {}
347+
fn mutate(&mut self, _: &mc::Place<'tcx>) {}
348348
}
349349

350-
fn unwrap_downcast_or_interior<'a, 'tcx>(mut cmt: &'a mc::cmt_<'tcx>) -> mc::cmt_<'tcx> {
350+
fn unwrap_downcast_or_interior<'a, 'tcx>(mut cmt: &'a mc::Place<'tcx>) -> mc::Place<'tcx> {
351351
loop {
352352
match cmt.cat {
353353
mc::Categorization::Downcast(ref c, _) | mc::Categorization::Interior(ref c, _) => {

clippy_lints/src/utils/usage.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc::hir::def::Res;
22
use rustc::hir::*;
33
use rustc::lint::LateContext;
44
use rustc::middle::expr_use_visitor::*;
5-
use rustc::middle::mem_categorization::cmt_;
5+
use rustc::middle::mem_categorization::Place;
66
use rustc::middle::mem_categorization::Categorization;
77
use rustc::ty;
88
use rustc_data_structures::fx::FxHashSet;
@@ -64,15 +64,15 @@ impl<'tcx> MutVarsDelegate {
6464
}
6565

6666
impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
67-
fn consume(&mut self, _: &cmt_<'tcx>, _: ConsumeMode) {}
67+
fn consume(&mut self, _: &Place<'tcx>, _: ConsumeMode) {}
6868

69-
fn borrow(&mut self, cmt: &cmt_<'tcx>, bk: ty::BorrowKind) {
69+
fn borrow(&mut self, cmt: &Place<'tcx>, bk: ty::BorrowKind) {
7070
if let ty::BorrowKind::MutBorrow = bk {
7171
self.update(&cmt.cat)
7272
}
7373
}
7474

75-
fn mutate(&mut self, cmt: &cmt_<'tcx>) {
75+
fn mutate(&mut self, cmt: &Place<'tcx>) {
7676
self.update(&cmt.cat)
7777
}
7878
}

0 commit comments

Comments
 (0)