about summary refs log tree commit diff
path: root/src/test/rustdoc/structfields.rs
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-01-09 12:41:13 -0800
committerNoah Lev <camelidcamel@gmail.com>2022-01-09 12:48:28 -0800
commit2b70a3df7a73b283e7f19439a98c81bb66f6a852 (patch)
tree89f65a2d149f930afd7ad72c48a65842e36846cb /src/test/rustdoc/structfields.rs
parent092e1c9d23158d81be27bb6f71bdd0c6282478fb (diff)
downloadrust-2b70a3df7a73b283e7f19439a98c81bb66f6a852.tar.gz
rust-2b70a3df7a73b283e7f19439a98c81bb66f6a852.zip
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".
Diffstat (limited to 'src/test/rustdoc/structfields.rs')
-rw-r--r--src/test/rustdoc/structfields.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/rustdoc/structfields.rs b/src/test/rustdoc/structfields.rs
index 6de198453cd..7e1cada4b98 100644
--- a/src/test/rustdoc/structfields.rs
+++ b/src/test/rustdoc/structfields.rs
@@ -2,7 +2,7 @@
 pub struct Foo {
     // @has - //pre "pub a: ()"
     pub a: (),
-    // @has - //pre "// some fields omitted"
+    // @has - //pre "/* private fields */"
     // @!has - //pre "b: ()"
     b: (),
     // @!has - //pre "c: usize"
@@ -16,7 +16,7 @@ pub struct Foo {
 pub struct Bar {
     // @has - //pre "pub a: ()"
     pub a: (),
-    // @!has - //pre "// some fields omitted"
+    // @!has - //pre "/* private fields */"
 }
 
 // @has structfields/enum.Qux.html
@@ -29,11 +29,11 @@ pub enum Qux {
         b: (),
         // @has - //pre "c: usize"
         c: usize,
-        // @has - //pre "// some fields omitted"
+        // @has - //pre "/* private fields */"
     },
 }
 
-// @has structfields/struct.Baz.html //pre "pub struct Baz { /* fields omitted */ }"
+// @has structfields/struct.Baz.html //pre "pub struct Baz { /* private fields */ }"
 pub struct Baz {
     x: u8,
     #[doc(hidden)]