add support for unsafe_ref for a struct type