diff --git a/src/test/ui/parser/doc-inside-trait-item.rs b/src/test/ui/parser/doc-inside-trait-item.rs new file mode 100644 index 00000000000..897515d65bb --- /dev/null +++ b/src/test/ui/parser/doc-inside-trait-item.rs @@ -0,0 +1,6 @@ +trait User{ + fn test(); + /// empty doc + //~^ ERROR found a documentation comment that doesn't document anything +} +fn main() {} \ No newline at end of file diff --git a/src/test/ui/parser/doc-inside-trait-item.stderr b/src/test/ui/parser/doc-inside-trait-item.stderr new file mode 100644 index 00000000000..261e27b6e0d --- /dev/null +++ b/src/test/ui/parser/doc-inside-trait-item.stderr @@ -0,0 +1,11 @@ +error[E0584]: found a documentation comment that doesn't document anything + --> $DIR/doc-inside-trait-item.rs:3:5 + | +LL | /// empty doc + | ^^^^^^^^^^^^^ + | + = help: doc comments must come before what they document, maybe a comment was intended with `//`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0584`.