We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 447aace commit 9f00d83Copy full SHA for 9f00d83
compiler/rustc_middle/src/mir/mod.rs
@@ -1464,6 +1464,8 @@ impl<'tcx> Place<'tcx> {
1464
/// If MirPhase >= Derefered and if projection contains Deref,
1465
/// It's guaranteed to be in the first place
1466
pub fn has_deref(&self) -> bool {
1467
+ // To make sure this is not accidently used in wrong mir phase
1468
+ debug_assert!(!self.projection[1..].contains(&PlaceElem::Deref));
1469
self.projection.first() == Some(&PlaceElem::Deref)
1470
}
1471
0 commit comments