2025-05-01 14:34:04 -07:00
|
|
|
// Regression test for ICE from issue #140545
|
|
|
|
|
// The error message is confusing and wrong, but that's a different problem (#139350)
|
2025-09-01 22:03:21 +02:00
|
|
|
|
|
|
|
|
//@ revisions: current next
|
|
|
|
|
//@[next] compile-flags: -Znext-solver
|
|
|
|
|
//@ ignore-compare-mode-next-solver (explicit revisions)
|
|
|
|
|
//@[next] check-pass
|
2025-05-01 14:34:04 -07:00
|
|
|
|
|
|
|
|
trait Foo {}
|
2025-09-01 22:03:21 +02:00
|
|
|
fn a<T: Foo>(x: T) -> impl Foo {
|
2025-05-01 14:34:04 -07:00
|
|
|
if true { x } else { a(a(x)) }
|
2025-09-01 22:03:21 +02:00
|
|
|
//[current]~^ ERROR: expected generic type parameter, found `impl Foo` [E0792]
|
|
|
|
|
//[current]~| ERROR: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
|
2025-05-01 14:34:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main(){}
|