Lines Matching refs:span

39 //! - "help" suggestions can't have their own span info on stable,
40 //! (essentially inheriting the parent span).
123 //! `abort` and `emit_error` take a "source span" as the first argument. This source
127 //! This source is the preferable one since it doesn't lose span information on multi-token
182 //! abort!(span, message)
184 //! The first argument is an expression the span info should be taken from.
189 //! abort!(span, format_literal, format_args...)
198 //! and do not take span in 2'th and 3'th forms. Those are essentially shortcuts for
201 //! `diagnostic!` requires a [`Level`] instance between `span` and second argument
206 //! > If you have some type from `proc_macro` or `syn` to point to, do not call `.span()`
213 //! > // ^^ <-- avoid .span()
216 //! > `.span()` calls work too, but you may experience regressions in message quality.
225 //! span, message; // <--- attachments start with `;` (semicolon)
236 //! wow = note_span => "custom span"; // <--- attachments can have their own span
314 pub fn single_span(span: Span) -> Self {
316 first: span,
317 last: span,
326 /// Construct span range from a `TokenStream`. This method always preserves all the
332 /// consists of only one `TokenTree`, the result is `SpanRange::single_span(tt.span())`
335 let mut spans = ts.to_token_stream().into_iter().map(|tt| tt.span());
342 /// Join two span ranges. The resulting range will start at `self.first` and end at
351 /// Collapse the range into single span, preserving as much information as possible.
530 .map(|tt| tt.span())
532 let last = ts.last().map(|tt| tt.span()).unwrap_or(first);