Skip to content

Commit d24028b

Browse files
committed
Add UI test for missing type parameter
1 parent 87e76e6 commit d24028b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn foo<X>() { }
12+
13+
fn main() {
14+
foo();
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error[E0282]: unable to infer enough type information about `X`
2+
--> $DIR/missing-type-parameter.rs:14:5
3+
|
4+
14 | foo();
5+
| ^^^ cannot infer type for `X`
6+
|
7+
= note: type annotations or generic parameter binding required
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)