rust/tests/ui/impl-trait/define-via-const.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
188 B
Rust
Raw Normal View History

//@ 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);
}