Add UI test for missing type parameter
This commit is contained in:
parent
87e76e6ca4
commit
d24028b5a8
2 changed files with 25 additions and 0 deletions
15
src/test/ui/missing-items/missing-type-parameter.rs
Normal file
15
src/test/ui/missing-items/missing-type-parameter.rs
Normal 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();
|
||||
}
|
||||
10
src/test/ui/missing-items/missing-type-parameter.stderr
Normal file
10
src/test/ui/missing-items/missing-type-parameter.stderr
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue