]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-52843-closure-constrain.rs
1 // Checks to ensure that we properly detect when a closure constrains an opaque type
2
3 #![feature(type_alias_impl_trait)]
4
5 use std::fmt::Debug;
6
7 fn main() {
8     type Opaque = impl Debug;
9     fn _unused() -> Opaque { String::new() }
10     let null = || -> Opaque { 0 };
11     //~^ ERROR: concrete type differs from previous defining opaque type use
12     println!("{:?}", null());
13 }