]> git.lizzy.rs Git - rust.git/commitdiff
adding test
authorSaleem Jaffer <saleem@acko.com>
Wed, 13 Mar 2019 04:28:05 +0000 (09:58 +0530)
committerSaleem Jaffer <saleem@acko.com>
Wed, 13 Mar 2019 04:28:05 +0000 (09:58 +0530)
src/test/ui/parser/doc-inside-trait-item.rs [new file with mode: 0644]
src/test/ui/parser/doc-inside-trait-item.stderr [new file with mode: 0644]

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 (file)
index 0000000..897515d
--- /dev/null
@@ -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 (file)
index 0000000..261e27b
--- /dev/null
@@ -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`.