call_site() creates a Span that resolves an identifier as though it were written where the procedural macro is invoked. This makes it suitable for generated methods intended for application code. section 5.1.3
Choosing the span for generated identifiers
Construct a generated identifier with Ident::new("...", Span::call_site()). By contrast, mixed_site() follows declarative-macro hygiene rules: a generated local variable using mixed_site cannot be referenced from the surrounding application scope, producing a not-found error. section 5.1.3
pub fn push_ident(tokens: &mut TokenStream, s: &str) {
let span = Span::call_site();
push_ident_spanned(tokens, span, s);
}
The helper centralizes Span::call_site() before passing the span into identifier-generation code. section 5.1.3
