about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/pub/pub-ident-fn-3.rs2
-rw-r--r--tests/ui/pub/pub-ident-fn-3.stderr9
-rw-r--r--tests/ui/pub/pub-ident-fn-or-struct-2.rs2
-rw-r--r--tests/ui/pub/pub-ident-fn-or-struct-2.stderr9
-rw-r--r--tests/ui/pub/pub-ident-struct-4.fixed6
-rw-r--r--tests/ui/pub/pub-ident-struct-4.rs6
-rw-r--r--tests/ui/pub/pub-ident-struct-4.stderr13
7 files changed, 41 insertions, 6 deletions
diff --git a/tests/ui/pub/pub-ident-fn-3.rs b/tests/ui/pub/pub-ident-fn-3.rs
index fdbea7cf487..50db4039d4f 100644
--- a/tests/ui/pub/pub-ident-fn-3.rs
+++ b/tests/ui/pub/pub-ident-fn-3.rs
@@ -2,7 +2,7 @@
 
 mod foo {
     pub bar();
-    //~^ ERROR missing `fn` or `struct` for function or struct definition
+    //~^ ERROR missing `struct` for struct definition
 }
 
 fn main() {}
diff --git a/tests/ui/pub/pub-ident-fn-3.stderr b/tests/ui/pub/pub-ident-fn-3.stderr
index 6d3d4e592c8..23eadec1193 100644
--- a/tests/ui/pub/pub-ident-fn-3.stderr
+++ b/tests/ui/pub/pub-ident-fn-3.stderr
@@ -1,8 +1,13 @@
-error: missing `fn` or `struct` for function or struct definition
+error: missing `struct` for struct definition
   --> $DIR/pub-ident-fn-3.rs:4:8
    |
 LL |     pub bar();
-   |     ---^--- help: if you meant to call a macro, try: `bar!`
+   |        ^
+   |
+help: add `struct` here to parse `bar` as a public struct
+   |
+LL |     pub struct bar();
+   |         ++++++
 
 error: aborting due to previous error
 
diff --git a/tests/ui/pub/pub-ident-fn-or-struct-2.rs b/tests/ui/pub/pub-ident-fn-or-struct-2.rs
index 8f67cdd2933..dfa6cf2ee1e 100644
--- a/tests/ui/pub/pub-ident-fn-or-struct-2.rs
+++ b/tests/ui/pub/pub-ident-fn-or-struct-2.rs
@@ -1,4 +1,4 @@
 pub S();
-//~^ ERROR missing `fn` or `struct` for function or struct definition
+//~^ ERROR missing `struct` for struct definition
 
 fn main() {}
diff --git a/tests/ui/pub/pub-ident-fn-or-struct-2.stderr b/tests/ui/pub/pub-ident-fn-or-struct-2.stderr
index 047e66b18d8..b7a9bc0a7db 100644
--- a/tests/ui/pub/pub-ident-fn-or-struct-2.stderr
+++ b/tests/ui/pub/pub-ident-fn-or-struct-2.stderr
@@ -1,8 +1,13 @@
-error: missing `fn` or `struct` for function or struct definition
+error: missing `struct` for struct definition
   --> $DIR/pub-ident-fn-or-struct-2.rs:1:4
    |
 LL | pub S();
-   | ---^- help: if you meant to call a macro, try: `S!`
+   |    ^
+   |
+help: add `struct` here to parse `S` as a public struct
+   |
+LL | pub struct S();
+   |     ++++++
 
 error: aborting due to previous error
 
diff --git a/tests/ui/pub/pub-ident-struct-4.fixed b/tests/ui/pub/pub-ident-struct-4.fixed
new file mode 100644
index 00000000000..b49fa678e1b
--- /dev/null
+++ b/tests/ui/pub/pub-ident-struct-4.fixed
@@ -0,0 +1,6 @@
+// run-rustfix
+
+pub struct T(String);
+//~^ ERROR missing `struct` for struct definition
+
+fn main() {}
diff --git a/tests/ui/pub/pub-ident-struct-4.rs b/tests/ui/pub/pub-ident-struct-4.rs
new file mode 100644
index 00000000000..20bc94b0acb
--- /dev/null
+++ b/tests/ui/pub/pub-ident-struct-4.rs
@@ -0,0 +1,6 @@
+// run-rustfix
+
+pub T(String);
+//~^ ERROR missing `struct` for struct definition
+
+fn main() {}
diff --git a/tests/ui/pub/pub-ident-struct-4.stderr b/tests/ui/pub/pub-ident-struct-4.stderr
new file mode 100644
index 00000000000..90c7138e5ce
--- /dev/null
+++ b/tests/ui/pub/pub-ident-struct-4.stderr
@@ -0,0 +1,13 @@
+error: missing `struct` for struct definition
+  --> $DIR/pub-ident-struct-4.rs:3:4
+   |
+LL | pub T(String);
+   |    ^
+   |
+help: add `struct` here to parse `T` as a public struct
+   |
+LL | pub struct T(String);
+   |     ++++++
+
+error: aborting due to previous error
+