While debugging a macro_derive’d impl of a trait, I’ve been hit by this somewhat unhelpful error:
18 | #[derive(Debug, Template)] | ^^^^^^^^ cannot move out of borrowed content
The issue is, of course, that Template generates an impl with an error. This particular derive is from askama, which generates an impl based on my own template file.
In C, source generators would pepper the generated code with
#line directives, so that the compiler would display the actual line that led to the generation of invalid code.
Is there an equivalent for Rust?