This code expands very sensibly to impl<T: Display> Display for Error<T>:
#[derive(Error, Debug)]
#[error("{thing}")]
pub struct Error<T> {
thing: T,
}
This one expands to impl<T> Display for Error<T> with no inferred bound on T:
#[derive(Error, Debug)]
#[error("{var}", var = "...")]
pub struct Error<T> {
thing: T,
}
But this one does not make sense. It expands to impl<T: Display> Display for Error<T> even though self.thing is not used in the error message and T does not need to be bound with Display.
#[derive(Error, Debug)]
#[error("{thing}", thing = "...")]
pub struct Error<T> {
thing: T,
}