Flagging deprecations from custom derive code


So I maintain the Askama crate, which is a custom derive parsing template code to generate what comes down to a nice Display implementation. It supports template inheritance, and since Askama started I’ve iterated a bit on how that works. Now, I’d like to deprecate a particular pattern in how Askama supports template inheritance.

So the question comes up: has anyone figured out a nice way to flag deprecations to users (in the compiler output) during procedural macro execution? I suppose the easy way out is just to print some stuff to stderr, but ideally it would somewhat look like a normal compiler (deprecation) warning. Note, I want this to work on stable, so the nice way to do this using Span::warning() is right out.