diff options
| author | Ben Kimock <kimockb@gmail.com> | 2024-12-04 21:03:12 -0500 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2024-12-06 16:42:09 -0500 |
| commit | 711c8cc690c70d9b4c0e17e90f21f03d4e9d3ebf (patch) | |
| tree | c2025a7bb0c2a9bf1af448b859b41f5905762cbc /tests/ui/polymorphization/const_parameters/functions.rs | |
| parent | 8dc83770f748c6cd16b342889ca2240397c19534 (diff) | |
| download | rust-711c8cc690c70d9b4c0e17e90f21f03d4e9d3ebf.tar.gz rust-711c8cc690c70d9b4c0e17e90f21f03d4e9d3ebf.zip | |
Remove polymorphization
Diffstat (limited to 'tests/ui/polymorphization/const_parameters/functions.rs')
| -rw-r--r-- | tests/ui/polymorphization/const_parameters/functions.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/ui/polymorphization/const_parameters/functions.rs b/tests/ui/polymorphization/const_parameters/functions.rs deleted file mode 100644 index 6535e3f081d..00000000000 --- a/tests/ui/polymorphization/const_parameters/functions.rs +++ /dev/null @@ -1,37 +0,0 @@ -//@ build-fail -//@ compile-flags:-Zpolymorphize=on -#![feature(generic_const_exprs, rustc_attrs)] -//~^ WARN the feature `generic_const_exprs` is incomplete - -// This test checks that the polymorphization analysis correctly detects unused const -// parameters in functions. - -// Function doesn't have any generic parameters to be unused. -#[rustc_polymorphize_error] -pub fn no_parameters() {} - -// Function has an unused generic parameter. -#[rustc_polymorphize_error] -pub fn unused<const T: usize>() { - //~^ ERROR item has unused generic parameters -} - -// Function uses generic parameter in value of a binding. -#[rustc_polymorphize_error] -pub fn used_binding<const T: usize>() -> usize { - let x: usize = T; - x -} - -// Function uses generic parameter in substitutions to another function. -#[rustc_polymorphize_error] -pub fn used_substs<const T: usize>() { - unused::<T>() -} - -fn main() { - no_parameters(); - unused::<1>(); - used_binding::<1>(); - used_substs::<1>(); -} |
