File tree 1 file changed +17
-0
lines changed
compiler/rustc_passes/src
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,15 @@ impl CheckAttrVisitor<'tcx> {
565
565
true
566
566
}
567
567
568
+ /// Checks `#[doc(inline)]`/`#[doc(no_inline)]` attributes. Returns `true` if valid.
569
+ ///
570
+ /// A doc inlining attribute is invalid if it is applied to a non-`use` item, or
571
+ /// if there are conflicting attributes for one item.
572
+ ///
573
+ /// `specified_inline` is used to keep track of whether we have
574
+ /// already seen an inlining attribute for this item.
575
+ /// If so, `specified_inline` holds the value and the span of
576
+ /// the first `inline`/`no_inline` attribute.
568
577
fn check_doc_inline (
569
578
& self ,
570
579
attr : & Attribute ,
@@ -619,6 +628,7 @@ impl CheckAttrVisitor<'tcx> {
619
628
}
620
629
}
621
630
631
+ /// Checks that an attribute is *not* used at the crate level. Returns `true` if valid.
622
632
fn check_attr_not_crate_level (
623
633
& self ,
624
634
meta : & NestedMetaItem ,
@@ -641,6 +651,7 @@ impl CheckAttrVisitor<'tcx> {
641
651
true
642
652
}
643
653
654
+ /// Checks that an attribute is used at the crate level. Returns `true` if valid.
644
655
fn check_attr_crate_level (
645
656
& self ,
646
657
attr : & Attribute ,
@@ -683,6 +694,12 @@ impl CheckAttrVisitor<'tcx> {
683
694
true
684
695
}
685
696
697
+ /// Runs various checks on `#[doc]` attributes. Returns `true` if valid.
698
+ ///
699
+ /// `specified_inline` should be initialized to `None` and kept for the scope
700
+ /// of one item. Read the documentation of [`check_doc_inline`] for more information.
701
+ ///
702
+ /// [`check_doc_inline`]: Self::check_doc_inline
686
703
fn check_doc_attrs (
687
704
& self ,
688
705
attr : & Attribute ,
You can’t perform that action at this time.
0 commit comments