about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/missing-items/missing-type-parameter.rs15
-rw-r--r--src/test/ui/missing-items/missing-type-parameter.stderr10
2 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/missing-items/missing-type-parameter.rs b/src/test/ui/missing-items/missing-type-parameter.rs
new file mode 100644
index 00000000000..3671abd6624
--- /dev/null
+++ b/src/test/ui/missing-items/missing-type-parameter.rs
@@ -0,0 +1,15 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn foo<X>() { }
+
+fn main() {
+    foo();
+}
diff --git a/src/test/ui/missing-items/missing-type-parameter.stderr b/src/test/ui/missing-items/missing-type-parameter.stderr
new file mode 100644
index 00000000000..2d007af4980
--- /dev/null
+++ b/src/test/ui/missing-items/missing-type-parameter.stderr
@@ -0,0 +1,10 @@
+error[E0282]: unable to infer enough type information about `X`
+  --> $DIR/missing-type-parameter.rs:14:5
+   |
+14 |     foo();
+   |     ^^^ cannot infer type for `X`
+   |
+   = note: type annotations or generic parameter binding required
+
+error: aborting due to previous error
+