mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Add UI test for missing type parameter
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user