Skip to content

Commit 52ee203

Browse files
make with_unsugared_doc preserve is_sugared_doc
1 parent f9f3611 commit 52ee203

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: src/libsyntax/attr.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,13 @@ impl Attribute {
371371
let meta = mk_name_value_item_str(
372372
Symbol::intern("doc"),
373373
Symbol::intern(&strip_doc_comment_decoration(&comment.as_str())));
374-
if self.style == ast::AttrStyle::Outer {
375-
f(&mk_attr_outer(self.span, self.id, meta))
374+
let mut attr = if self.style == ast::AttrStyle::Outer {
375+
mk_attr_outer(self.span, self.id, meta)
376376
} else {
377-
f(&mk_attr_inner(self.span, self.id, meta))
378-
}
377+
mk_attr_inner(self.span, self.id, meta)
378+
};
379+
attr.is_sugared_doc = true;
380+
f(&attr)
379381
} else {
380382
f(self)
381383
}

0 commit comments

Comments
 (0)