2021-04-06 10:21:08 -05:00
|
|
|
struct Foo<T = impl Copy>(T);
|
2022-02-17 21:18:42 -06:00
|
|
|
//~^ ERROR `impl Trait` only allowed in function and inherent method return types
|
2021-04-06 10:21:08 -05:00
|
|
|
|
|
|
|
type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
|
2022-02-17 21:18:42 -06:00
|
|
|
//~^ ERROR `impl Trait` only allowed in function and inherent method return types
|
2021-04-06 10:21:08 -05:00
|
|
|
|
|
|
|
// should not cause ICE
|
|
|
|
fn x() -> Foo {
|
|
|
|
Foo(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> Result<()> {}
|