rust/tests/ui/simd
Esteban Küber 6b24fdf811 Provide structured suggestion for unconstrained generic constant
```
error: unconstrained generic constant
  --> $DIR/const-argument-if-length.rs:18:10
   |
LL |     pad: [u8; is_zst::<T>()],
   |          ^^^^^^^^^^^^^^^^^^^
   |
help: try adding a `where` bound
   |
LL | pub struct AtLeastByte<T: ?Sized> where [(); is_zst::<T>()]: {
   |                                   ++++++++++++++++++++++++++
```

Detect when the constant expression isn't `usize` and suggest casting:

```
error: unconstrained generic constant
 --> f300.rs:6:10
  |
6 |     bb::<{!N}>();
  |          ^^^^
-Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs:3539:36
  |
help: try adding a `where` bound
  |
5 | fn b<const N: bool>() where [(); {!N} as usize]: {
  |                       ++++++++++++++++++++++++++
```

Fix #122395.
2024-03-21 00:03:59 +00:00
..
intrinsic fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
array-trait.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
array-trait.stderr Provide structured suggestion for unconstrained generic constant 2024-03-21 00:03:59 +00:00
array-type.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
const-err-trumps-simd-err.rs add test ensuring simd codegen checks don't run when a static assertion failed 2024-03-10 12:37:10 +01:00
const-err-trumps-simd-err.stderr preserve span when evaluating mir::ConstOperand 2024-03-14 21:55:07 +01:00
generics.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
issue-17170.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-32947.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-39720.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
issue-85915-simd-ptrs.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
issue-89193.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
issue-105439.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
libm_no_std_cant_float.rs Update std::simd usage and test outputs 2023-11-26 09:02:25 -05:00
libm_no_std_cant_float.stderr
libm_std_can_float.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
masked-load-store-build-fail.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
masked-load-store-build-fail.stderr Add simd_masked_{load,store} platform-intrinsics 2023-12-09 12:36:08 +01:00
masked-load-store-check-fail.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
masked-load-store-check-fail.stderr Add simd_masked_{load,store} platform-intrinsics 2023-12-09 12:36:08 +01:00
masked-load-store.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
monomorphize-heterogeneous.rs Add test for new delayed bug code path 2023-04-08 22:14:57 +01:00
monomorphize-heterogeneous.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
monomorphize-shuffle-index.generic.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
monomorphize-shuffle-index.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
not-out-of-bounds.rs check that simd_insert/extract indices are in-bounds 2024-02-23 19:43:59 +01:00
not-out-of-bounds.stderr check that simd_insert/extract indices are in-bounds 2024-02-23 19:43:59 +01:00
portable-intrinsics-arent-exposed.rs
portable-intrinsics-arent-exposed.stderr When failing to import core, suggest std 2023-11-22 19:30:47 +00:00
repr_packed.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
shuffle.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
simd-bitmask.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
size-align.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
target-feature-mixup.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
type-generic-monomorphisation-empty.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
type-generic-monomorphisation-empty.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-generic-monomorphisation-extern-nonnull-ptr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-generic-monomorphisation-non-primitive.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-generic-monomorphisation-non-primitive.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-generic-monomorphisation-oversized.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
type-generic-monomorphisation-oversized.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-generic-monomorphisation-power-of-two.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
type-generic-monomorphisation-wide-ptr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-generic-monomorphisation-wide-ptr.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-generic-monomorphisation.rs fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
type-generic-monomorphisation.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-len.rs
type-len.stderr
type-wide-ptr.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-wide-ptr.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
wasm-simd-indirect.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00