We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f23a80a + 62a2103 commit 6e1b9bdCopy full SHA for 6e1b9bd
compiler/rustc_resolve/src/rustdoc.rs
@@ -12,6 +12,7 @@ use rustc_middle::ty::TyCtxt;
12
use rustc_span::def_id::DefId;
13
use rustc_span::symbol::{Symbol, kw, sym};
14
use rustc_span::{DUMMY_SP, InnerSpan, Span};
15
+use thin_vec::ThinVec;
16
use tracing::{debug, trace};
17
18
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
@@ -196,9 +197,9 @@ pub fn add_doc_fragment(out: &mut String, frag: &DocFragment) {
196
197
pub fn attrs_to_doc_fragments<'a, A: AttributeExt + Clone + 'a>(
198
attrs: impl Iterator<Item = (&'a A, Option<DefId>)>,
199
doc_only: bool,
-) -> (Vec<DocFragment>, Vec<A>) {
200
+) -> (Vec<DocFragment>, ThinVec<A>) {
201
let mut doc_fragments = Vec::new();
- let mut other_attrs = Vec::<A>::new();
202
+ let mut other_attrs = ThinVec::<A>::new();
203
for (attr, item_id) in attrs {
204
if let Some((doc_str, comment_kind)) = attr.doc_str_and_comment_kind() {
205
let doc = beautify_doc_string(doc_str, comment_kind);
src/librustdoc/clean/types.rs
@@ -1150,7 +1150,7 @@ pub struct RenderedLink {
1150
#[derive(Clone, Debug, Default)]
1151
pub(crate) struct Attributes {
1152
pub(crate) doc_strings: Vec<DocFragment>,
1153
- pub(crate) other_attrs: Vec<hir::Attribute>,
+ pub(crate) other_attrs: ThinVec<hir::Attribute>,
1154
}
1155
1156
impl Attributes {
0 commit comments