File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,10 +357,8 @@ impl Declaration {
357357 all_declarations ! ( self , it => it. definition_ids. is_empty( ) )
358358 }
359359
360- /// Returns true if this declaration is no longer anchored to anything
361- /// and can be removed. For most declarations, that means having no
362- /// definitions. Singleton classes are also kept alive by members and
363- /// inbound constant references.
360+ /// Returns true if this declaration has no local anchors and can be removed.
361+ /// Graph-level cleanup can still keep declarations alive based on external anchors.
364362 #[ must_use]
365363 pub fn is_removable ( & self ) -> bool {
366364 if let Some ( ns) = self . as_singleton_class ( ) {
Original file line number Diff line number Diff line change @@ -179,6 +179,18 @@ impl Definition {
179179 }
180180 }
181181
182+ #[ must_use]
183+ pub fn has_extend_mixin ( & self ) -> bool {
184+ let mixins = match self {
185+ Definition :: Class ( definition) => definition. mixins ( ) ,
186+ Definition :: SingletonClass ( definition) => definition. mixins ( ) ,
187+ Definition :: Module ( definition) => definition. mixins ( ) ,
188+ _ => return false ,
189+ } ;
190+
191+ mixins. iter ( ) . any ( |mixin| matches ! ( mixin, Mixin :: Extend ( _) ) )
192+ }
193+
182194 #[ must_use]
183195 pub fn is_deprecated ( & self ) -> bool {
184196 all_definitions ! ( self , it => it. flags( ) . is_deprecated( ) )
You can’t perform that action at this time.
0 commit comments