Skip to main content

Module remove_adt_clauses

Module remove_adt_clauses 

Source
Expand description

--remove-adt-clauses strips trait clauses from type declarations when it’s possible to do so. Because it’s not possible to recover associated type information when we remove clauses, we don’t remove clauses if any of them have associated types. For that reason, this flag is best used with --lift-associated-types.

Every reference to a clause removed in this way is replaced with a TraitRefKind::BuiltinOrAuto { builtin_data: RemovedAdtClause, .. }.

Structs§

RemoveAdtClausesVisitor 🔒
Transform

Functions§

build_removed_clause_placeholder 🔒
Build a BuiltinOrAuto { builtin_data: RemovedAdtClause, .. } kind whose parent_trait_refs recursively mirror the trait’s implied clauses (each parent itself a RemovedAdtClause placeholder).
has_assoc_types 🔒
Compute whether a trait has associated types, even through supertraits.
untouchable_adts 🔒
ADTs that have at least one trait clause pointing at a trait with associated types (transitively). We leave these ADTs entirely untouched.