pub trait IsDependentType<'db> {
// Required method
fn is_dependent_type(
&self,
db: &'db dyn Database,
identifiers: &[SmolStrId<'db>],
) -> bool;
}Expand description
Helper trait for check syntactically if a type is dependent on a given identifier.
Required Methods§
Sourcefn is_dependent_type(
&self,
db: &'db dyn Database,
identifiers: &[SmolStrId<'db>],
) -> bool
fn is_dependent_type( &self, db: &'db dyn Database, identifiers: &[SmolStrId<'db>], ) -> bool
Returns true if self is dependent on identifier in an internal type.
For example given identifier T will return true for:
T, Array<T>, Array<Array<T>>, (T, felt252), T::AssocType.
Does not resolve type aliases or named generics. A multi-segment path is considered
dependent when its head segment is one of the identifiers (e.g. the associated type
T::AssocType), which is a purely syntactic check (no path resolution).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".