Remove Attrs type alias

This commit is contained in:
Guillaume Gomez 2022-08-28 10:34:19 +02:00
parent c07a8b4e09
commit 1e005af31b

View File

@ -24,8 +24,6 @@ use crate::clean::{
use crate::core::DocContext; use crate::core::DocContext;
use crate::formats::item_type::ItemType; use crate::formats::item_type::ItemType;
type Attrs<'hir> = &'hir [ast::Attribute];
/// Attempt to inline a definition into this AST. /// Attempt to inline a definition into this AST.
/// ///
/// This function will fetch the definition specified, and if it is /// This function will fetch the definition specified, and if it is
@ -46,7 +44,7 @@ pub(crate) fn try_inline(
import_def_id: Option<DefId>, import_def_id: Option<DefId>,
res: Res, res: Res,
name: Symbol, name: Symbol,
attrs: Option<Attrs<'_>>, attrs: Option<&[ast::Attribute]>,
visited: &mut FxHashSet<DefId>, visited: &mut FxHashSet<DefId>,
) -> Option<Vec<clean::Item>> { ) -> Option<Vec<clean::Item>> {
let did = res.opt_def_id()?; let did = res.opt_def_id()?;
@ -172,7 +170,7 @@ pub(crate) fn try_inline_glob(
} }
} }
pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> Attrs<'hir> { pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> &'hir [ast::Attribute] {
cx.tcx.get_attrs_unchecked(did) cx.tcx.get_attrs_unchecked(did)
} }
@ -287,7 +285,7 @@ pub(crate) fn build_impls(
cx: &mut DocContext<'_>, cx: &mut DocContext<'_>,
parent_module: Option<DefId>, parent_module: Option<DefId>,
did: DefId, did: DefId,
attrs: Option<Attrs<'_>>, attrs: Option<&[ast::Attribute]>,
ret: &mut Vec<clean::Item>, ret: &mut Vec<clean::Item>,
) { ) {
let _prof_timer = cx.tcx.sess.prof.generic_activity("build_inherent_impls"); let _prof_timer = cx.tcx.sess.prof.generic_activity("build_inherent_impls");
@ -303,8 +301,8 @@ pub(crate) fn build_impls(
pub(crate) fn merge_attrs( pub(crate) fn merge_attrs(
cx: &mut DocContext<'_>, cx: &mut DocContext<'_>,
parent_module: Option<DefId>, parent_module: Option<DefId>,
old_attrs: Attrs<'_>, old_attrs: &[ast::Attribute],
new_attrs: Option<Attrs<'_>>, new_attrs: Option<&[ast::Attribute]>,
) -> (clean::Attributes, Option<Arc<clean::cfg::Cfg>>) { ) -> (clean::Attributes, Option<Arc<clean::cfg::Cfg>>) {
// NOTE: If we have additional attributes (from a re-export), // NOTE: If we have additional attributes (from a re-export),
// always insert them first. This ensure that re-export // always insert them first. This ensure that re-export
@ -331,7 +329,7 @@ pub(crate) fn build_impl(
cx: &mut DocContext<'_>, cx: &mut DocContext<'_>,
parent_module: Option<DefId>, parent_module: Option<DefId>,
did: DefId, did: DefId,
attrs: Option<Attrs<'_>>, attrs: Option<&[ast::Attribute]>,
ret: &mut Vec<clean::Item>, ret: &mut Vec<clean::Item>,
) { ) {
if !cx.inlined.insert(did.into()) { if !cx.inlined.insert(did.into()) {