about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/rustdoc.rs
diff options
context:
space:
mode:
authorJonathan Dönszelmann <jonathan@donsz.nl>2024-12-16 09:15:58 +0100
committerJonathan Dönszelmann <jonathan@donsz.nl>2024-12-16 10:00:38 +0100
commit62a21038ec15198a035dd5dd56e95fd40bf0e734 (patch)
tree3d387bb723483a0a18bfd33c0168724c8166237c /compiler/rustc_resolve/src/rustdoc.rs
parentf2b91ccbc27cb06369aa2dd934ff219e156408a8 (diff)
downloadrust-62a21038ec15198a035dd5dd56e95fd40bf0e734.tar.gz
rust-62a21038ec15198a035dd5dd56e95fd40bf0e734.zip
try fix hir-attrs perf
Diffstat (limited to 'compiler/rustc_resolve/src/rustdoc.rs')
-rw-r--r--compiler/rustc_resolve/src/rustdoc.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs
index 8b14fe31d8c..bc0354fc3a8 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);