CodeQL library for Rust
codeql/rust-all 0.2.6 (changelog, source)
Search

Class ImplicitDerefNodeState

A state used to represent the flow steps involved in implicit dereferencing.

For example, if there is an implicit dereference in a call like x.m(), then that desugars into (*Deref::deref(&x)).m(), and

  • TImplicitDerefNodeAfterBorrowState represents the &x part,
  • TImplicitDerefNodeBeforeDerefState represents the Deref::deref(&x) part, and
  • TImplicitDerefNodeAfterDerefState represents the entire *Deref::deref(&x) part.

When the targeted deref function is from impl<T> Deref for &(mut) T, we optimize away the call, skipping the TImplicitDerefNodeAfterBorrowState state, and instead add a local step directly from x to the TImplicitDerefNodeBeforeDerefState state.

Import path

import codeql.rust.dataflow.internal.Node

Direct supertypes

Predicates