about summary refs log tree commit diff
path: root/tests/ui/span/missing-unit-argument.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/span/missing-unit-argument.rs')
-rw-r--r--tests/ui/span/missing-unit-argument.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/span/missing-unit-argument.rs b/tests/ui/span/missing-unit-argument.rs
new file mode 100644
index 00000000000..db96ae223d9
--- /dev/null
+++ b/tests/ui/span/missing-unit-argument.rs
@@ -0,0 +1,17 @@
+fn foo(():(), ():()) {}
+fn bar(():()) {}
+
+struct S;
+impl S {
+    fn baz(self, (): ()) { }
+    fn generic<T>(self, _: T) { }
+}
+
+fn main() {
+    let _: Result<(), String> = Ok(); //~ ERROR this enum variant takes
+    foo(); //~ ERROR function takes
+    foo(()); //~ ERROR function takes
+    bar(); //~ ERROR function takes
+    S.baz(); //~ ERROR this method takes
+    S.generic::<()>(); //~ ERROR this method takes
+}