From 52ee203d656f7939de65fa837eea58230151e71e Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Sat, 23 Sep 2017 11:58:06 -0500 Subject: [PATCH] make with_unsugared_doc preserve is_sugared_doc --- src/libsyntax/attr.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index b1f796084df82..8bd7399092f26 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -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) }