]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/inference-cycle.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / 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     //~| ERROR cycle detected
8
9     // Cycle: error today, but it'd be nice if it eventually worked
10
11     pub fn foo() -> Foo {
12         is_send(bar())
13     }
14
15     pub fn bar() {
16         is_send(foo()); // Today: error
17     }
18
19     fn baz() {
20         let f: Foo = 22_u32;
21     }
22
23     fn is_send<T: Send>(_: T) {}
24 }
25
26 fn main() {}