Skip to main content

transparent_deref_peel

Function transparent_deref_peel 

Source
fn transparent_deref_peel<'tcx>(
    tcx: TyCtxt<'tcx>,
    func: &Operand<'tcx>,
) -> Option<usize>
Expand description

Detect a transparent-wrapper deref whose receiver is ManuallyDrop<T> or MaybeDangling<T>, and return how many leading field-0 hops must be peeled to reach the inner T:

  • ManuallyDrop<T> { value: MaybeDangling<T> } → 2 (valueMaybeDangling.0)
  • MaybeDangling<P>(P) → 1.