diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-03 15:32:13 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-05 15:40:11 +0000 |
| commit | a0358f44b33301e28070327eae7804a88a912b15 (patch) | |
| tree | e6b419df119addee5222ce0d0fbeb65c313d63fb /tests/codegen | |
| parent | 22d0073d47e7f82b0943db94babe40420205eb6a (diff) | |
| download | rust-a0358f44b33301e28070327eae7804a88a912b15.tar.gz rust-a0358f44b33301e28070327eae7804a88a912b15.zip | |
Also support generic constants
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs b/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs index 35071e238f3..df50b4af809 100644 --- a/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs +++ b/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs @@ -3,6 +3,8 @@ //@compile-flags: --crate-type=lib -Copt-level=0 +#![feature(generic_const_items)] + const fn foo() {} pub static FOO: () = foo(); @@ -14,3 +16,12 @@ const fn bar() {} pub const BAR: () = bar(); // CHECK-NOT: define{{.*}}bar{{.*}} + +const fn baz() {} + +#[rustfmt::skip] +pub const BAZ<const C: bool>: () = if C { + baz() +}; + +// CHECK: define{{.*}}baz{{.*}} |
