In this case, syn::Type will be Type::Reference, which contains syn::TypeReference, which has the public field lifetime. Just set it to None, like this:
fn strip_lifetimes(ty: Type) -> Type {
match ty {
Reference(ty) => Reference(TypeReference { lifetime: None, ..ty }),
ty => ty,
}
}
Careful, type comparison like that is brittle: what if somebody did type Str = &'static str;, and provided Str to your macro?
Consider emitting code with the macro that uses poorman's specialization instead, or just assuming the given type is the one you expected, and let the type mismatches themselves nudge the caller of the macro to use the correct type