2021-04-06 16:21:08 +01:00
|
|
|
struct Foo<T = impl Copy>(T);
|
2021-07-19 09:21:27 -03:00
|
|
|
//~^ ERROR `impl Trait` not allowed outside of function and method return types
|
2021-04-06 16:21:08 +01:00
|
|
|
|
|
|
|
|
type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
|
2021-07-19 09:21:27 -03:00
|
|
|
//~^ ERROR `impl Trait` not allowed outside of function and method return types
|
2021-04-06 16:21:08 +01:00
|
|
|
|
|
|
|
|
// should not cause ICE
|
|
|
|
|
fn x() -> Foo {
|
|
|
|
|
Foo(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() -> Result<()> {}
|