make sure has_deref is correct
This commit is contained in:
parent
447aaceed7
commit
9f00d836af
1 changed files with 2 additions and 0 deletions
|
@ -1464,6 +1464,8 @@ impl<'tcx> Place<'tcx> {
|
|||
/// If MirPhase >= Derefered and if projection contains Deref,
|
||||
/// It's guaranteed to be in the first place
|
||||
pub fn has_deref(&self) -> bool {
|
||||
// To make sure this is not accidently used in wrong mir phase
|
||||
debug_assert!(!self.projection[1..].contains(&PlaceElem::Deref));
|
||||
self.projection.first() == Some(&PlaceElem::Deref)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue