]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / ui / impl-trait / issues / issue-83929-impl-trait-in-generic-default.rs
1 struct Foo<T = impl Copy>(T);
2 //~^ ERROR `impl Trait` only allowed in function and inherent method return types
3
4 type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
5 //~^ ERROR `impl Trait` only allowed in function and inherent method return types
6
7 // should not cause ICE
8 fn x() -> Foo {
9     Foo(0)
10 }
11
12 fn main() -> Result<()> {}