diff options
| -rw-r--r-- | compiler/rustc_resolve/src/rustdoc.rs | 5 | ||||
| -rw-r--r-- | src/librustdoc/clean/types.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index ed421da0241..118e224675a 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -12,6 +12,7 @@ use rustc_middle::ty::TyCtxt; use rustc_span::def_id::DefId; use rustc_span::symbol::{Symbol, kw, sym}; use rustc_span::{DUMMY_SP, InnerSpan, Span}; +use thin_vec::ThinVec; use tracing::{debug, trace}; #[derive(Clone, Copy, PartialEq, Eq, Debug)] @@ -196,9 +197,9 @@ pub fn add_doc_fragment(out: &mut String, frag: &DocFragment) { pub fn attrs_to_doc_fragments<'a, A: AttributeExt + Clone + 'a>( attrs: impl Iterator<Item = (&'a A, Option<DefId>)>, doc_only: bool, -) -> (Vec<DocFragment>, Vec<A>) { +) -> (Vec<DocFragment>, ThinVec<A>) { let mut doc_fragments = Vec::new(); - let mut other_attrs = Vec::<A>::new(); + let mut other_attrs = ThinVec::<A>::new(); for (attr, item_id) in attrs { if let Some((doc_str, comment_kind)) = attr.doc_str_and_comment_kind() { let doc = beautify_doc_string(doc_str, comment_kind); diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 0918a90d04b..64d99b1d226 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1150,7 +1150,7 @@ pub struct RenderedLink { #[derive(Clone, Debug, Default)] pub(crate) struct Attributes { pub(crate) doc_strings: Vec<DocFragment>, - pub(crate) other_attrs: Vec<hir::Attribute>, + pub(crate) other_attrs: ThinVec<hir::Attribute>, } impl Attributes { |
