- fn consume(&mut self, cmt: &cmt_<'tcx>, mode: ConsumeMode) {
- if let Categorization::Local(lid) = cmt.cat {
- if let ConsumeMode::Move = mode {
- // moved out or in. clearly can't be localized
- self.set.remove(&lid);
- }
- }
- let map = &self.cx.tcx.hir();
- if let Categorization::Local(lid) = cmt.cat {
- if let Some(Node::Binding(_)) = map.find(cmt.hir_id) {
- if self.set.contains(&lid) {
- // let y = x where x is known
- // remove x, insert y
- self.set.insert(cmt.hir_id);
+ fn consume(&mut self, cmt: &Place<'tcx>, mode: ConsumeMode) {
+ if cmt.projections.is_empty() {
+ if let PlaceBase::Local(lid) = cmt.base {
+ if let ConsumeMode::Move = mode {
+ // moved out or in. clearly can't be localized