Add UI test for missing type parameter

This commit is contained in:
Keith Yeung 2016-12-09 13:28:16 -08:00
parent 87e76e6ca4
commit d24028b5a8
2 changed files with 25 additions and 0 deletions

View File

@ -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();
}

View File

@ -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