summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs
blob: 50eeff0b18fd44eb1252568f3733d31b0744f98c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Checks to ensure that we properly detect when a closure constrains an opaque type

#![feature(type_alias_impl_trait)]

use std::fmt::Debug;

fn main() {
    type Opaque = impl Debug;
    fn _unused() -> Opaque { String::new() }
    let null = || -> Opaque { 0 };
    //~^ ERROR: concrete type differs from previous defining opaque type use
    println!("{:?}", null());
}