]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
Rollup merge of #92917 - jackh726:issue-91762-2, r=nikomatsakis
[rust.git] / src / test / ui / type-alias-impl-trait / nested_type_alias_impl_trait.rs
1 #![feature(type_alias_impl_trait)]
2
3 mod my_mod {
4     use std::fmt::Debug;
5
6     pub type Foo = impl Debug;
7     pub type Foot = impl Debug;
8
9     pub fn get_foo() -> Foo {
10         5i32
11     }
12
13     pub fn get_foot() -> Foot {
14         get_foo() //~ ERROR opaque type's hidden type cannot be another opaque type
15     }
16 }
17
18 fn main() {
19     let _: my_mod::Foot = my_mod::get_foot();
20 }