From 6ac3812ca5385b2285080f1987e657e4216bc181 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 29 Apr 2016 15:57:12 +0200 Subject: [PATCH] add a test for #29928 --- src/test/run-pass/const-fn.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/run-pass/const-fn.rs b/src/test/run-pass/const-fn.rs index a0a68533b58a..3b13cc661f6e 100644 --- a/src/test/run-pass/const-fn.rs +++ b/src/test/run-pass/const-fn.rs @@ -38,6 +38,13 @@ const X: () = test(); const fn f(_: ()) -> usize { 1 } +const fn g(x: usize) -> A { + A { field: x } +} +struct A { + field: usize, +} + const SUM: u32 = add(44, 22); const DIFF: u32 = sub(44, 22); const DIV: u32 = unsafe{div(44, 22)};