diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-29 06:34:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-29 06:34:49 +0200 |
| commit | fa177a9db2d7c96ced985d018a0108de033f5ded (patch) | |
| tree | 3fad4be806a83896996c86943a7b7797fd9e3ea1 /src | |
| parent | 3e5be57de86f3636c10ebb696d36dbe89861f383 (diff) | |
| parent | 1e005af31b078f584f7adbdebc505ba0cca52706 (diff) | |
| download | rust-fa177a9db2d7c96ced985d018a0108de033f5ded.tar.gz rust-fa177a9db2d7c96ced985d018a0108de033f5ded.zip | |
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`````
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index f367edcbf5a..31b805f2ed7 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -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()) { |
