diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 7972852a3f45..fe969c6fd51a 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -915,9 +915,6 @@ impl<'a> State<'a> { match attr.node.style { ast::AttrInner => { try!(self.print_attribute(attr)); - if !attr.node.is_sugared_doc { - try!(word(&mut self.s, ";")); - } count += 1; } _ => {/* fallthrough */ } @@ -935,7 +932,10 @@ impl<'a> State<'a> { if attr.node.is_sugared_doc { word(&mut self.s, attr.value_str().unwrap().get()) } else { - try!(word(&mut self.s, "#[")); + match attr.node.style { + ast::AttrInner => try!(word(&mut self.s, "#![")), + ast::AttrOuter => try!(word(&mut self.s, "#[")), + } try!(self.print_meta_item(attr.meta())); word(&mut self.s, "]") } diff --git a/src/test/auxiliary/impl_privacy_xc_1.rs b/src/test/auxiliary/impl_privacy_xc_1.rs index de182c48c41f..df4e0658cb83 100644 --- a/src/test/auxiliary/impl_privacy_xc_1.rs +++ b/src/test/auxiliary/impl_privacy_xc_1.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[crate_type = "lib"]; +#![crate_type = "lib"] pub struct Fish { pub x: int diff --git a/src/test/pretty/attr-fn-inner.rs b/src/test/pretty/attr-fn-inner.rs index 6745a2714361..65dcf9005670 100644 --- a/src/test/pretty/attr-fn-inner.rs +++ b/src/test/pretty/attr-fn-inner.rs @@ -14,7 +14,7 @@ // accidentally carried over to each inner function fn main() { - #[inner_attr]; + #![inner_attr] #[outer_attr] fn f() { } diff --git a/src/test/pretty/doc-comments.rs b/src/test/pretty/doc-comments.rs index 45e242c0ca04..02d141f5163c 100644 --- a/src/test/pretty/doc-comments.rs +++ b/src/test/pretty/doc-comments.rs @@ -57,5 +57,5 @@ fn f() { } fn g() { } fn h() { - #[doc = "as do inner ones"]; + #![doc = "as do inner ones"] } diff --git a/src/test/run-pass/method-attributes.rs b/src/test/run-pass/method-attributes.rs index db7440738da8..87c43da9ebcf 100644 --- a/src/test/run-pass/method-attributes.rs +++ b/src/test/run-pass/method-attributes.rs @@ -22,12 +22,12 @@ trait frobable { impl frobable for int { #[frob_attr1] fn frob(&self) { - #[frob_attr2]; + #![frob_attr2] } #[defrob_attr1] fn defrob(&self) { - #[defrob_attr2]; + #![defrob_attr2] } }