Skip to content

Commit c4d4fd4

Browse files
authored
Rollup merge of #101116 - GuillaumeGomez:rm-attrs-ty-alias, r=notriddle
[rustdoc] Remove Attrs type alias When working on #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``
2 parents 579f082 + 1e005af commit c4d4fd4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/librustdoc/clean/inline.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ use crate::clean::{
2424
use crate::core::DocContext;
2525
use crate::formats::item_type::ItemType;
2626

27-
type Attrs<'hir> = &'hir [ast::Attribute];
28-
2927
/// Attempt to inline a definition into this AST.
3028
///
3129
/// This function will fetch the definition specified, and if it is
@@ -46,7 +44,7 @@ pub(crate) fn try_inline(
4644
import_def_id: Option<DefId>,
4745
res: Res,
4846
name: Symbol,
49-
attrs: Option<Attrs<'_>>,
47+
attrs: Option<&[ast::Attribute]>,
5048
visited: &mut FxHashSet<DefId>,
5149
) -> Option<Vec<clean::Item>> {
5250
let did = res.opt_def_id()?;
@@ -172,7 +170,7 @@ pub(crate) fn try_inline_glob(
172170
}
173171
}
174172

175-
pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> Attrs<'hir> {
173+
pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> &'hir [ast::Attribute] {
176174
cx.tcx.get_attrs_unchecked(did)
177175
}
178176

@@ -287,7 +285,7 @@ pub(crate) fn build_impls(
287285
cx: &mut DocContext<'_>,
288286
parent_module: Option<DefId>,
289287
did: DefId,
290-
attrs: Option<Attrs<'_>>,
288+
attrs: Option<&[ast::Attribute]>,
291289
ret: &mut Vec<clean::Item>,
292290
) {
293291
let _prof_timer = cx.tcx.sess.prof.generic_activity("build_inherent_impls");
@@ -303,8 +301,8 @@ pub(crate) fn build_impls(
303301
pub(crate) fn merge_attrs(
304302
cx: &mut DocContext<'_>,
305303
parent_module: Option<DefId>,
306-
old_attrs: Attrs<'_>,
307-
new_attrs: Option<Attrs<'_>>,
304+
old_attrs: &[ast::Attribute],
305+
new_attrs: Option<&[ast::Attribute]>,
308306
) -> (clean::Attributes, Option<Arc<clean::cfg::Cfg>>) {
309307
// NOTE: If we have additional attributes (from a re-export),
310308
// always insert them first. This ensure that re-export
@@ -331,7 +329,7 @@ pub(crate) fn build_impl(
331329
cx: &mut DocContext<'_>,
332330
parent_module: Option<DefId>,
333331
did: DefId,
334-
attrs: Option<Attrs<'_>>,
332+
attrs: Option<&[ast::Attribute]>,
335333
ret: &mut Vec<clean::Item>,
336334
) {
337335
if !cx.inlined.insert(did.into()) {

0 commit comments

Comments
 (0)