Lines Matching full:span
41 /// The [`Span`] of the first `Ident` argument is used as the span of the final
42 /// identifier, falling back to [`Span::call_site`] when no identifiers are
48 /// // If `ident` is an Ident, the span of `my_ident` will be inherited from it.
53 /// Alternatively, the span can be overridden by passing the `span` named
61 /// # let my_span = proc_macro2::Span::call_site();
62 /// format_ident!("MyIdent", span = my_span);
65 /// [`Span`]: proc_macro2::Span
66 /// [`Span::call_site`]: proc_macro2::Span::call_site
133 ([$span:expr, $($fmt:tt)*]) => {
136 $span,
140 // Span argument
141 ([$old:expr, $($fmt:tt)*] span = $span:expr) => {
142 $crate::format_ident_impl!([$old, $($fmt)*] span = $span,)
144 ([$old:expr, $($fmt:tt)*] span = $span:expr, $($rest:tt)*) => {
146 $crate::__private::Option::Some::<$crate::__private::Span>($span),
152 ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr) => {
153 $crate::format_ident_impl!([$span, $($fmt)*] $name = $arg,)
155 ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr, $($rest:tt)*) => {
157 … arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, $name = arg] $($rest)*),
162 ([$span:expr, $($fmt:tt)*] $arg:expr) => {
163 $crate::format_ident_impl!([$span, $($fmt)*] $arg,)
165 ([$span:expr, $($fmt:tt)*] $arg:expr, $($rest:tt)*) => {
167 arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, arg] $($rest)*),