rust/tests/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs

13 lines
349 B
Rust
Raw Normal View History

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
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
// should not cause ICE
fn x() -> Foo {
Foo(0)
}
fn main() -> Result<()> {}