@@ -399,11 +399,11 @@ impl Stage for Late {
399399 }
400400}
401401
402- /// used when parsing attributes for miscellaneous things *before* ast lowering
402+ /// Used when parsing attributes for miscellaneous things *before* ast lowering
403403pub struct Early {
404- /// Whether to emit errors or delay them as a bug
405- /// For most attributes, the attribute will be parsed again in the `Late` stage and in this case the errors should be delayed
406- /// But for some, such as `cfg`, the attribute will be removed before the `Late` stage so errors must be emitted
404+ /// Whether to emit errors or delay them as a bug.
405+ /// For most attributes, the attribute will be parsed again in the `Late` stage and in this case the errors should be delayed.
406+ /// But for some, such as `cfg`, the attribute will be removed before the `Late` stage so errors must be emitted.
407407 pub emit_errors : ShouldEmit ,
408408}
409409/// used when parsing attributes during ast lowering
@@ -416,19 +416,25 @@ pub struct AcceptContext<'f, 'sess, S: Stage> {
416416 pub ( crate ) shared : SharedContext < ' f , ' sess , S > ,
417417
418418 /// The outer span of the attribute currently being parsed
419+ ///
420+ /// ```
419421 /// #[attribute(...)]
420422 /// ^^^^^^^^^^^^^^^^^ outer span
423+ /// ```
421424 /// For attributes in `cfg_attr`, the outer span and inner spans are equal.
422425 pub ( crate ) attr_span : Span ,
423- /// The inner span of the attribute currently being parsed
426+ /// The inner span of the attribute currently being parsed.
427+ ///
428+ /// ```
424429 /// #[attribute(...)]
425430 /// ^^^^^^^^^^^^^^ inner span
431+ /// ```
426432 pub ( crate ) inner_span : Span ,
427433
428- /// Whether it is an inner or outer attribute
434+ /// Whether it is an inner or outer attribute.
429435 pub ( crate ) attr_style : AttrStyle ,
430436
431- /// A description of the thing we are parsing using this attribute parser
437+ /// A description of the thing we are parsing using this attribute parser.
432438 /// We are not only using these parsers for attributes, but also for macros such as the `cfg!()` macro.
433439 pub ( crate ) parsed_description : ParsedDescription ,
434440
@@ -715,12 +721,12 @@ where
715721 self . emit_parse_error ( span, AttributeParseErrorReason :: ExpectedNoArgs )
716722 }
717723
718- /// emit an error that a `name` was expected here
724+ /// Emit an error that a `name` was expected here
719725 pub ( crate ) fn expected_identifier ( & mut self , span : Span ) -> ErrorGuaranteed {
720726 self . emit_parse_error ( span, AttributeParseErrorReason :: ExpectedIdentifier )
721727 }
722728
723- /// emit an error that a `name = value` pair was expected at this span. The symbol can be given for
729+ /// Emit an error that a `name = value` pair was expected at this span. The symbol can be given for
724730 /// a nicer error message talking about the specific name that was found lacking a value.
725731 pub ( crate ) fn expected_name_value (
726732 & mut self ,
@@ -730,12 +736,12 @@ where
730736 self . emit_parse_error ( span, AttributeParseErrorReason :: ExpectedNameValue ( name) )
731737 }
732738
733- /// emit an error that a `name = value` pair was found where that name was already seen.
739+ /// Emit an error that a `name = value` pair was found where that name was already seen.
734740 pub ( crate ) fn duplicate_key ( & mut self , span : Span , key : Symbol ) -> ErrorGuaranteed {
735741 self . emit_parse_error ( span, AttributeParseErrorReason :: DuplicateKey ( key) )
736742 }
737743
738- /// an error that should be emitted when a [`MetaItemOrLitParser`](crate::parser::MetaItemOrLitParser)
744+ /// An error that should be emitted when a [`MetaItemOrLitParser`](crate::parser::MetaItemOrLitParser)
739745 /// was expected *not* to be a literal, but instead a meta item.
740746 pub ( crate ) fn unexpected_literal ( & mut self , span : Span ) -> ErrorGuaranteed {
741747 self . emit_parse_error ( span, AttributeParseErrorReason :: UnexpectedLiteral )
@@ -749,7 +755,7 @@ where
749755 self . emit_parse_error ( span, AttributeParseErrorReason :: ExpectedAtLeastOneArgument )
750756 }
751757
752- /// produces an error along the lines of `expected one of [foo, meow]`
758+ /// Produces an error along the lines of `expected one of [foo, meow]`
753759 pub ( crate ) fn expected_specific_argument (
754760 & mut self ,
755761 span : Span ,
@@ -765,7 +771,7 @@ where
765771 )
766772 }
767773
768- /// produces an error along the lines of `expected one of [foo, meow] as an argument`.
774+ /// Produces an error along the lines of `expected one of [foo, meow] as an argument`.
769775 /// i.e. slightly different wording to [`expected_specific_argument`](Self::expected_specific_argument).
770776 pub ( crate ) fn expected_specific_argument_and_list (
771777 & mut self ,
@@ -830,7 +836,7 @@ where
830836
831837 self . template . suggestions ( style, & self . attr_path )
832838 }
833- /// error that a string literal was expected.
839+ /// Error that a string literal was expected.
834840 /// You can optionally give the literal you did find (which you found not to be a string literal)
835841 /// which can make better errors. For example, if the literal was a byte string it will suggest
836842 /// removing the `b` prefix.
0 commit comments