Avoid extraneous space between visibility kw and ident for statics
Today, given a static like `static mut FOO: usize = 1`, rustdoc would emit `static mut FOO: usize = 1`, as it emits both the mutability kw with a space and reserves a space after the mutability kw. This patch fixes that misformatting. This patch also adds some tests for emit of other statics, as I could not find an existing test devoted to statics.
This commit is contained in:
parent
d65c08e9cc
commit
abfbd1bd71
12
src/test/rustdoc/static.rs
Normal file
12
src/test/rustdoc/static.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// compile-flags: --document-private-items
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
// @has static/static.FOO.html '//pre[@class="static"]' 'static FOO: usize'
|
||||
static FOO: usize = 1;
|
||||
|
||||
// @has static/static.BAR.html '//pre[@class="static"]' 'pub static BAR: usize'
|
||||
pub static BAR: usize = 1;
|
||||
|
||||
// @has static/static.BAZ.html '//pre[@class="static"]' 'pub static mut BAZ: usize'
|
||||
pub static mut BAZ: usize = 1;
|
Loading…
Reference in New Issue
Block a user