Bind AttrDeprecated class reference within a closure