Skip to content

Commit 3cbc3f4

Browse files
author
Jakub Bukaj
committed
Add a test for failure to unify type parameters
1 parent 3db13f4 commit 3cbc3f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/compile-fail/type-parameter-names.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// Test that we print out the names of type parameters correctly in
1212
// our error messages.
1313

14-
fn foo<Foo, Bar>(x: Foo) -> Bar { x } //~ ERROR expected `Bar`, found `Foo`
14+
fn foo<Foo, Bar>(x: Foo) -> Bar {
15+
x
16+
//~^ ERROR expected `Bar`, found `Foo` (expected type parameter, found a different type parameter)
17+
}
1518

1619
fn main() {}

0 commit comments

Comments
 (0)