diff options
| author | ayazhafiz <ayaz.hafiz.1@gmail.com> | 2020-10-13 16:11:51 -0500 |
|---|---|---|
| committer | ayazhafiz <ayaz.hafiz.1@gmail.com> | 2020-10-13 16:21:55 -0500 |
| commit | abfbd1bd719bd1440132ead24ec64c0acd293f41 (patch) | |
| tree | cd793b32d7d4277b528e11954d19af370866fc90 /src/test/rustdoc | |
| parent | d65c08e9cc164b7b44de53503fae859a4fafd976 (diff) | |
| download | rust-abfbd1bd719bd1440132ead24ec64c0acd293f41.tar.gz rust-abfbd1bd719bd1440132ead24ec64c0acd293f41.zip | |
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.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/static.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/rustdoc/static.rs b/src/test/rustdoc/static.rs new file mode 100644 index 00000000000..aa48644918d --- /dev/null +++ b/src/test/rustdoc/static.rs @@ -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; |
