about summary refs log tree commit diff
path: root/tests/ui/impl-trait/define-via-const.rs
blob: a4b9123654c4519372e2d5fdb506893e6737530b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ check-pass

#![feature(type_alias_impl_trait)]

type Closure = impl Fn(u32) -> u32;

#[define_opaque(Closure)]
const ADDER: Closure = |x| x + 1;

fn main() {
    let z = (ADDER)(1);
}