@@ -10,7 +10,7 @@ use std::{fmt, iter};
10
10
use arrayvec:: ArrayVec ;
11
11
use thin_vec:: ThinVec ;
12
12
13
- use rustc_ast:: { self as ast, AttrStyle } ;
13
+ use rustc_ast as ast;
14
14
use rustc_attr:: { ConstStability , Deprecation , Stability , StabilityLevel } ;
15
15
use rustc_const_eval:: const_eval:: is_unstable_const_fn;
16
16
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
@@ -23,7 +23,7 @@ use rustc_hir_analysis::check::intrinsic::intrinsic_operation_unsafety;
23
23
use rustc_index:: vec:: IndexVec ;
24
24
use rustc_middle:: ty:: fast_reject:: SimplifiedType ;
25
25
use rustc_middle:: ty:: { self , DefIdTree , TyCtxt , Visibility } ;
26
- use rustc_resolve:: rustdoc:: { add_doc_fragment, attrs_to_doc_fragments, DocFragment } ;
26
+ use rustc_resolve:: rustdoc:: { add_doc_fragment, attrs_to_doc_fragments, inner_docs , DocFragment } ;
27
27
use rustc_session:: Session ;
28
28
use rustc_span:: hygiene:: MacroKind ;
29
29
use rustc_span:: symbol:: { kw, sym, Ident , Symbol } ;
@@ -405,7 +405,7 @@ impl Item {
405
405
pub ( crate ) fn inner_docs ( & self , tcx : TyCtxt < ' _ > ) -> bool {
406
406
self . item_id
407
407
. as_def_id ( )
408
- . map ( |did| tcx. get_attrs_unchecked ( did) . inner_docs ( ) )
408
+ . map ( |did| inner_docs ( tcx. get_attrs_unchecked ( did) ) )
409
409
. unwrap_or ( false )
410
410
}
411
411
@@ -874,8 +874,6 @@ pub(crate) trait AttributesExt {
874
874
875
875
fn span ( & self ) -> Option < rustc_span:: Span > ;
876
876
877
- fn inner_docs ( & self ) -> bool ;
878
-
879
877
fn cfg ( & self , tcx : TyCtxt < ' _ > , hidden_cfg : & FxHashSet < Cfg > ) -> Option < Arc < Cfg > > ;
880
878
}
881
879
@@ -894,14 +892,6 @@ impl AttributesExt for [ast::Attribute] {
894
892
self . iter ( ) . find ( |attr| attr. doc_str ( ) . is_some ( ) ) . map ( |attr| attr. span )
895
893
}
896
894
897
- /// Returns whether the first doc-comment is an inner attribute.
898
- ///
899
- //// If there are no doc-comments, return true.
900
- /// FIXME(#78591): Support both inner and outer attributes on the same item.
901
- fn inner_docs ( & self ) -> bool {
902
- self . iter ( ) . find ( |a| a. doc_str ( ) . is_some ( ) ) . map_or ( true , |a| a. style == AttrStyle :: Inner )
903
- }
904
-
905
895
fn cfg ( & self , tcx : TyCtxt < ' _ > , hidden_cfg : & FxHashSet < Cfg > ) -> Option < Arc < Cfg > > {
906
896
let sess = tcx. sess ;
907
897
let doc_cfg_active = tcx. features ( ) . doc_cfg ;
0 commit comments