Skip to content

Commit

Permalink
make with_unsugared_doc preserve is_sugared_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Nov 21, 2017
1 parent f9f3611 commit 52ee203
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/libsyntax/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,13 @@ impl Attribute {
let meta = mk_name_value_item_str(
Symbol::intern("doc"),
Symbol::intern(&strip_doc_comment_decoration(&comment.as_str())));
if self.style == ast::AttrStyle::Outer {
f(&mk_attr_outer(self.span, self.id, meta))
let mut attr = if self.style == ast::AttrStyle::Outer {
mk_attr_outer(self.span, self.id, meta)
} else {
f(&mk_attr_inner(self.span, self.id, meta))
}
mk_attr_inner(self.span, self.id, meta)
};
attr.is_sugared_doc = true;
f(&attr)
} else {
f(self)
}
Expand Down

0 comments on commit 52ee203

Please sign in to comment.