Rollup merge of #101116 - GuillaumeGomez:rm-attrs-ty-alias, r=notriddle

[rustdoc] Remove Attrs type alias

When working on https://github.com/rust-lang/rust/pull/101006, I was quite confused because of this type alias as I'm used to having rustdoc types into `clean/types.rs`. Anyway, considering how few uses of it we have, I simply removed it.

r? `````@notriddle`````
This commit is contained in:
Matthias Krüger 2022-08-29 06:34:49 +02:00 committed by GitHub
commit fa177a9db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,8 +24,6 @@ use crate::clean::{
use crate::core::DocContext;
use crate::formats::item_type::ItemType;
type Attrs<'hir> = &'hir [ast::Attribute];
/// Attempt to inline a definition into this AST.
///
/// 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>,
res: Res,
name: Symbol,
attrs: Option<Attrs<'_>>,
attrs: Option<&[ast::Attribute]>,
visited: &mut FxHashSet<DefId>,
) -> Option<Vec<clean::Item>> {
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)
}
@ -287,7 +285,7 @@ pub(crate) fn build_impls(
cx: &mut DocContext<'_>,
parent_module: Option<DefId>,
did: DefId,
attrs: Option<Attrs<'_>>,
attrs: Option<&[ast::Attribute]>,
ret: &mut Vec<clean::Item>,
) {
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(
cx: &mut DocContext<'_>,
parent_module: Option<DefId>,
old_attrs: Attrs<'_>,
new_attrs: Option<Attrs<'_>>,
old_attrs: &[ast::Attribute],
new_attrs: Option<&[ast::Attribute]>,
) -> (clean::Attributes, Option<Arc<clean::cfg::Cfg>>) {
// NOTE: If we have additional attributes (from a re-export),
// always insert them first. This ensure that re-export
@ -331,7 +329,7 @@ pub(crate) fn build_impl(
cx: &mut DocContext<'_>,
parent_module: Option<DefId>,
did: DefId,
attrs: Option<Attrs<'_>>,
attrs: Option<&[ast::Attribute]>,
ret: &mut Vec<clean::Item>,
) {
if !cx.inlined.insert(did.into()) {