diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/inline-const/const-expr-generic.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/inline-const/const-expr-generic.rs b/src/test/ui/inline-const/const-expr-generic.rs new file mode 100644 index 000000000..3207bfa0e --- /dev/null +++ b/src/test/ui/inline-const/const-expr-generic.rs @@ -0,0 +1,15 @@ +// check-pass +#![feature(inline_const)] + +fn foo<T>() -> usize { + const { std::mem::size_of::<T>() } +} + +fn bar<const N: usize>() -> usize { + const { N + 1 } +} + +fn main() { + foo::<i32>(); + bar::<1>(); +} |