]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-fn-zst-args.rs
Rollup merge of #107023 - scottmcm:stop-shouting, r=Nilstrieb
[rust.git] / tests / ui / consts / const-fn-zst-args.rs
1 // build-pass
2
3 // Check that the evaluation of const-functions with
4 // zero-sized types as arguments compiles successfully
5
6 struct Zst {}
7
8 const fn foo(val: Zst) -> Zst { val }
9
10 const FOO: Zst = foo(Zst {});
11
12 fn main() {
13     const _: Zst = FOO;
14 }