about summary refs log tree commit diff
path: root/tests/ui/suggestions/missing-semicolon.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/missing-semicolon.rs')
-rw-r--r--tests/ui/suggestions/missing-semicolon.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/suggestions/missing-semicolon.rs b/tests/ui/suggestions/missing-semicolon.rs
new file mode 100644
index 00000000000..12ef3d33e5f
--- /dev/null
+++ b/tests/ui/suggestions/missing-semicolon.rs
@@ -0,0 +1,38 @@
+// run-rustfix
+#![allow(dead_code, unused_variables, path_statements)]
+fn a() {
+    let x = 5;
+    let y = x //~ ERROR expected function
+    () //~ ERROR expected `;`, found `}`
+}
+
+fn b() {
+    let x = 5;
+    let y = x //~ ERROR expected function
+    ();
+}
+fn c() {
+    let x = 5;
+    x //~ ERROR expected function
+    ()
+}
+fn d() { // ok
+    let x = || ();
+    x
+    ()
+}
+fn e() { // ok
+    let x = || ();
+    x
+    ();
+}
+fn f()
+ {
+    let y = 5 //~ ERROR expected function
+    () //~ ERROR expected `;`, found `}`
+}
+fn g() {
+    5 //~ ERROR expected function
+    ();
+}
+fn main() {}