File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
compiler/rustc_ast/src/attr Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,13 @@ impl Attribute {
180180 self . value_str ( ) . is_some ( )
181181 }
182182
183+ /// This is used in case you want the value span instead of the whole attribute. Example:
184+ ///
185+ /// ```text
186+ /// #[doc(alias = "foo")]
187+ /// ```
188+ ///
189+ /// In here, it'll return a span for `"foo"`.
183190 pub fn name_value_literal_span ( & self ) -> Option < Span > {
184191 match self . kind {
185192 AttrKind :: Normal ( ref item, _) => {
@@ -241,6 +248,13 @@ impl MetaItem {
241248 self . value_str ( ) . is_some ( )
242249 }
243250
251+ /// This is used in case you want the value span instead of the whole attribute. Example:
252+ ///
253+ /// ```text
254+ /// #[doc(alias = "foo")]
255+ /// ```
256+ ///
257+ /// In here, it'll return a span for `"foo"`.
244258 pub fn name_value_literal_span ( & self ) -> Option < Span > {
245259 Some ( self . name_value_literal ( ) ?. span )
246260 }
You can’t perform that action at this time.
0 commit comments