From b0755581ca49d3c583d68956bad445ad382c7af9 Mon Sep 17 00:00:00 2001 From: mrBliss Date: Tue, 19 Apr 2016 20:19:14 +0200 Subject: [PATCH] Format visibility of associated consts (#953) Fixes #951. --- src/visitor.rs | 2 +- tests/source/static.rs | 4 ++++ tests/target/static.rs | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/visitor.rs b/src/visitor.rs index cc97c2289f0..d52a167cb5e 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -362,7 +362,7 @@ pub fn visit_impl_item(&mut self, ii: &ast::ImplItem) { } ast::ImplItemKind::Const(ref ty, ref expr) => { let rewrite = rewrite_static("const", - ast::Visibility::Inherited, + ii.vis, ii.ident, ty, ast::Mutability::Immutable, diff --git a/tests/source/static.rs b/tests/source/static.rs index 6315b489046..a571b5f11f6 100644 --- a/tests/source/static.rs +++ b/tests/source/static.rs @@ -12,3 +12,7 @@ pub static count : u8 = 10 ; pub const test: &Type = &val; + +impl Color { + pub const WHITE: u32 = 10; +} diff --git a/tests/target/static.rs b/tests/target/static.rs index ffaeb0890d3..f3dbdad3e76 100644 --- a/tests/target/static.rs +++ b/tests/target/static.rs @@ -15,3 +15,7 @@ pub static count: u8 = 10; pub const test: &Type = &val; + +impl Color { + pub const WHITE: u32 = 10; +} -- 2.44.0