]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
[rust.git] / tests / 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 }