]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/inference-cycle.rs
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / ui / type-alias-impl-trait / inference-cycle.rs
1 #![feature(type_alias_impl_trait)]
2 #![allow(dead_code)]
3
4 mod m {
5     type Foo = impl std::fmt::Debug;
6     //~^ ERROR cycle detected
7
8     // Cycle: error today, but it'd be nice if it eventually worked
9
10     pub fn foo() -> Foo {
11         is_send(bar())
12     }
13
14     pub fn bar() {
15         is_send(foo()); // Today: error
16     }
17
18     fn baz() {
19         let f: Foo = 22_u32;
20     }
21
22     fn is_send<T: Send>(_: T) {}
23 }
24
25 fn main() {}