diff options
| author | Michael Goulet <michael@errs.io> | 2022-07-04 23:44:41 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-07-11 00:04:00 +0000 |
| commit | a1634642e079d4517e31a75fa002ea0496148cda (patch) | |
| tree | c970a1ddc4e0096d880852426a7117fcfac3f6c0 /src/test/ui/const-generics/float-generic.rs | |
| parent | c396bb3b8a16b1f2762b7c6078dc3e023f6a2493 (diff) | |
| download | rust-a1634642e079d4517e31a75fa002ea0496148cda.tar.gz rust-a1634642e079d4517e31a75fa002ea0496148cda.zip | |
Deny floats even when adt_const_params is enabled
Diffstat (limited to 'src/test/ui/const-generics/float-generic.rs')
| -rw-r--r-- | src/test/ui/const-generics/float-generic.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/float-generic.rs b/src/test/ui/const-generics/float-generic.rs new file mode 100644 index 00000000000..b72059b5b1c --- /dev/null +++ b/src/test/ui/const-generics/float-generic.rs @@ -0,0 +1,12 @@ +// revisions: simple adt_const_params +#![cfg_attr(adt_const_params, feature(adt_const_params))] +#![cfg_attr(adt_const_params, allow(incomplete_features))] + +fn foo<const F: f32>() {} +//~^ ERROR `f32` is forbidden as the type of a const generic parameter + +const C: f32 = 1.0; + +fn main() { + foo::<C>(); +} |
