File tree Expand file tree Collapse file tree
compiler/rustc_attr_parsing/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ impl OnUnknownParser {
2525 self . span = Some ( span) ;
2626
2727 // At early parsing we get passed `Target::Crate` regardless of the item we're on.
28- // Only do target checking if we're late .
28+ // Therefore, only do target checking if we can emit .
2929 let early = matches ! ( cx. should_emit, ShouldEmit :: Nothing ) ;
3030
3131 if !early && !matches ! ( cx. target, Target :: Use ) {
Original file line number Diff line number Diff line change 7575//!
7676//! This is equivalent to `#[repr(C, packed)]` and results in a single `AttributeKind::Repr`
7777//! containing both `C` and `packed` annotations.
78+ //!
79+ //! ## Early attribute parsing
80+ //!
81+ //! While lowering to the HIR, all attributes are parsed using the attribute parsers.
82+ //! However, sometimes an attributes' parsed form is needed before the HIR is constructed.
83+ //! This is referred to as "early" attribute parsing,
84+ //! and is performed using the `parse_limited_*` family of functions on `AttributeParser`.
7885
7986// tidy-alphabetical-start
8087#![ feature( decl_macro) ]
You can’t perform that action at this time.
0 commit comments