From d24028b5a83f9bbad6eca2d276ad7c0f625f6f01 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Fri, 9 Dec 2016 13:28:16 -0800 Subject: [PATCH] Add UI test for missing type parameter --- .../ui/missing-items/missing-type-parameter.rs | 15 +++++++++++++++ .../missing-items/missing-type-parameter.stderr | 10 ++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/test/ui/missing-items/missing-type-parameter.rs create mode 100644 src/test/ui/missing-items/missing-type-parameter.stderr 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 000000000000..3671abd66246 --- /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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() { } + +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 000000000000..2d007af4980b --- /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 +