Lines Matching defs:span
174 #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
315 pub fn span(&self) -> Span {
316 Span::_new(self.inner.span())
358 /// If the code span associated with this `SourceFile` was generated by an
407 /// The span of the invocation of the current procedural macro.
409 /// Identifiers created with this span will be resolved as if they were
416 /// The span located at the invocation of the procedural macro, but with
423 /// A span that resolves at the macro definition site.
432 /// Creates a new span with the same line/column information as `self` but
438 /// Creates a new span with the same name resolution behavior as `self` but
466 /// The original source file into which this span points.
475 /// Get the starting line/column in the source file for this span.
477 /// This method requires the `"span-locations"` feature to be enabled.
485 #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
490 /// Get the ending line/column in the source file for this span.
492 /// This method requires the `"span-locations"` feature to be enabled.
500 #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
505 /// Create a new span encompassing `self` and `other`.
527 /// Returns the source text behind a span. This preserves the original
529 /// the span corresponds to real source code.
539 /// Prints a span in a form convenient for debugging.
560 /// Returns the span of this tree, delegating to the `span` method of
562 pub fn span(&self) -> Span {
564 TokenTree::Group(t) => t.span(),
565 TokenTree::Ident(t) => t.span(),
566 TokenTree::Punct(t) => t.span(),
567 TokenTree::Literal(t) => t.span(),
571 /// Configures the span for *only this token*.
574 /// the span of each of the internal tokens, this will simply delegate to
576 pub fn set_span(&mut self, span: Span) {
578 TokenTree::Group(t) => t.set_span(span),
579 TokenTree::Ident(t) => t.set_span(span),
580 TokenTree::Punct(t) => t.set_span(span),
581 TokenTree::Literal(t) => t.set_span(span),
635 imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner);
685 /// This constructor will set the span for this group to
686 /// `Span::call_site()`. To change the span you can use the `set_span`
708 /// Returns the span for the delimiters of this token stream, spanning the
712 /// pub fn span(&self) -> Span {
715 pub fn span(&self) -> Span {
716 Span::_new(self.inner.span())
719 /// Returns the span pointing to the opening delimiter of this group.
729 /// Returns the span pointing to the closing delimiter of this group.
746 /// Configures the span for this `Group`'s delimiters, but not its internal
749 /// This method will **not** set the span of all the internal tokens spanned
750 /// by this group, but rather it will only set the span of the delimiter
752 pub fn set_span(&mut self, span: Span) {
753 self.inner.set_span(span.inner);
780 span: Span,
802 /// The returned `Punct` will have the default span of `Span::call_site()`
808 span: Span::call_site(),
826 /// Returns the span for this punctuation character.
827 pub fn span(&self) -> Span {
828 self.span
831 /// Configure the span for this punctuation character.
832 pub fn set_span(&mut self, span: Span) {
833 self.span = span;
850 imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner);
874 /// A span must be provided explicitly which governs the name resolution
934 /// `span`.
939 /// Note that `span`, currently in rustc, configures the hygiene information
943 /// hygiene meaning that identifiers created with this span will be resolved
949 /// span will be resolved at the location of the macro definition and other
965 pub fn new(string: &str, span: Span) -> Self {
966 Ident::_new(imp::Ident::new_checked(string, span.inner))
975 pub fn new_raw(string: &str, span: Span) -> Self {
976 Ident::_new(imp::Ident::new_raw_checked(string, span.inner))
979 /// Returns the span of this `Ident`.
980 pub fn span(&self) -> Span {
981 Span::_new(self.inner.span())
984 /// Configures the span of this `Ident`, possibly changing its hygiene
986 pub fn set_span(&mut self, span: Span) {
987 self.inner.set_span(span.inner);
1063 /// span by default, which can be configured with the `set_span` method
1084 /// span by default, which can be configured with the `set_span` method
1224 /// Returns the span encompassing this literal.
1225 pub fn span(&self) -> Span {
1226 Span::_new(self.inner.span())
1229 /// Configures the span associated for this literal.
1230 pub fn set_span(&mut self, span: Span) {
1231 self.inner.set_span(span.inner);
1234 /// Returns a `Span` that is a subset of `self.span()` containing only
1236 /// trimmed span is outside the bounds of `self`.