Skip to content

Commit 5467f25

Browse files
committed
Fix remaining test failures (constant visibility pretty-printing and make-tidy).
1 parent f7b1ce8 commit 5467f25

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,11 @@ impl<'a> State<'a> {
795795
fn print_associated_const(&mut self,
796796
ident: ast::Ident,
797797
ty: &ast::Ty,
798-
default: Option<&ast::Expr>)
798+
default: Option<&ast::Expr>,
799+
vis: ast::Visibility)
799800
-> io::Result<()>
800801
{
802+
try!(word(&mut self.s, &visibility_qualified(vis, "")));
801803
try!(self.word_space("const"));
802804
try!(self.print_ident(ident));
803805
try!(self.word_space(":"));
@@ -1284,7 +1286,8 @@ impl<'a> State<'a> {
12841286
match ti.node {
12851287
ast::ConstTraitItem(ref ty, ref default) => {
12861288
self.print_associated_const(ti.ident, &ty,
1287-
default.as_ref().map(|expr| &**expr))
1289+
default.as_ref().map(|expr| &**expr),
1290+
ast::Inherited)
12881291
}
12891292
ast::MethodTraitItem(ref sig, ref body) => {
12901293
if body.is_some() {
@@ -1311,7 +1314,7 @@ impl<'a> State<'a> {
13111314
try!(self.print_outer_attributes(&ii.attrs));
13121315
match ii.node {
13131316
ast::ConstImplItem(ref ty, ref expr) => {
1314-
self.print_associated_const(ii.ident, &ty, Some(&expr))
1317+
self.print_associated_const(ii.ident, &ty, Some(&expr), ii.vis)
13151318
}
13161319
ast::MethodImplItem(ref sig, ref body) => {
13171320
try!(self.head(""));

src/test/parse-fail/removed-syntax-static-fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ struct S;
1212

1313
impl S {
1414
static fn f() {}
15-
//~^ ERROR expected one of `const`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static`
1615
}
16+
//~^^ ERROR expected one of `const`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static`

0 commit comments

Comments
 (0)