Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
d3ec92e16e7e78c273c0f996cad5122ce5a6cdd6
rust/tests/rustdoc/union.rs

9 lines
175 B
Rust
Raw Normal View History

Support unions in rustdoc
2016-08-10 21:00:17 +03:00
// @has union/union.U.html
pub union U {
// @has - //pre "pub a: u8"
pub a: u8,
Display "private fields" instead of "fields omitted" Also: * Always use `/* */` block comments * Use the same message everywhere, rather than sometimes prefixing with "some" When I first read rustdoc docs, I was confused why the fields were being omitted. It was only later that I realized it was because they were private. It's also always bothered me that rustdoc sometimes uses `//` and sometimes uses `/*` comments for these messages, so this change makes them all use `/*`. Technically, I think fields can be omitted if they are public but `doc(hidden)` too, but `doc(hidden)` is analogous to privacy. It's really just used to emulate "doc privacy" when -- because of technical limitations -- an item has to be public. So I think it's fine to include this under the category of "private fields".
2022-01-09 12:41:13 -08:00
// @has - //pre "/* private fields */"
Support unions in rustdoc
2016-08-10 21:00:17 +03:00
// @!has - //pre "b: u16"
b: u16,
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1178ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API