rust/tests/ui/cast
Matthias Krüger 47f1df5ca3
Rollup merge of #145676 - Oneirical:uncountable-integer-9, r=jieyouxu
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]

Part of rust-lang/rust#133895

Methodology:

1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer

Inspired by the methodology that `@Kivooeo` was using.

r? `@jieyouxu`
2025-08-29 12:37:30 +02:00
..
array-field-ptr-cast-14845.rs comments 2025-08-05 19:34:46 +05:00
array-field-ptr-cast-14845.stderr comments 2025-08-05 19:34:46 +05:00
associated-type-bounds-cast-54094.rs Add test batch 2 2025-08-27 15:06:05 -04:00
cast-alias-of-array-to-element.rs Structurally resolve in check_ref_cast 2025-05-06 19:30:55 +00:00
cast-array-issue-138836.rs Expect an array when expected and acutal types are both arrays during cast 2025-03-27 13:05:18 +08:00
cast-array-issue-138836.stderr Expect an array when expected and acutal types are both arrays during cast 2025-03-27 13:05:18 +08:00
cast-as-bool.rs compiletest: Trim the value of dont-require-annotations 2025-04-10 23:48:57 +03:00
cast-as-bool.stderr compiletest: Make SUGGESTION annotations viral 2025-04-10 23:48:57 +03:00
cast-char.rs added error for invalid char cast 2025-07-10 15:44:36 +05:00
cast-char.stderr added error for invalid char cast 2025-07-10 15:44:36 +05:00
cast-does-fallback.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cast-enum-to-primitive-error.fixed cleaned up some tests 2025-07-13 00:03:31 +05:00
cast-enum-to-primitive-error.rs cleaned up some tests 2025-07-13 00:03:31 +05:00
cast-enum-to-primitive-error.stderr cleaned up some tests 2025-07-13 00:03:31 +05:00
cast-errors-issue-43825.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-errors-issue-43825.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
cast-from-nil.rs compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
cast-from-nil.stderr compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
cast-int-to-char.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-int-to-char.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-macro-lhs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-macro-lhs.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
cast-pointee-projection.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cast-region-to-uint.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cast-rfc0401-2.rs add source type for invalid bool casts 2023-09-11 18:10:07 +00:00
cast-rfc0401-2.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
cast-rfc0401-vtable-kinds.rs Delete tuple unsizing 2025-02-27 10:26:33 +00:00
cast-rfc0401-vtable-kinds.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
cast-rfc0401.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cast-to-bare-fn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-bare-fn.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-infer-ty.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cast-to-nil.rs compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
cast-to-nil.stderr compiletest: Require //~ annotations even if error-pattern is specified 2025-04-03 11:08:55 +03:00
cast-to-slice.rs fix: diagnostic for casting reference to slice 2023-12-20 20:50:32 -05:00
cast-to-slice.stderr reword suggestion message 2025-06-06 20:52:34 +00:00
cast-to-unsized-trait-object-suggestion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
cast-to-unsized-trait-object-suggestion.stderr reword suggestion message 2025-06-06 20:52:34 +00:00
cast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cast_lit_suffix-issue-138392.fixed Use lit span when suggesting suffix lit cast 2025-03-14 20:44:49 +08:00
cast_lit_suffix-issue-138392.rs Use lit span when suggesting suffix lit cast 2025-03-14 20:44:49 +08:00
cast_lit_suffix-issue-138392.stderr Use lit span when suggesting suffix lit cast 2025-03-14 20:44:49 +08:00
casts-differing-anon.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
casts-differing-anon.stderr improve errors for invalid pointer casts 2024-09-24 23:12:02 +02:00
casts-issue-46365.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
casts-issue-46365.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
codegen-object-shim.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
coercion-as-explicit-cast.rs cleaned up some tests 2025-07-13 00:03:31 +05:00
coercion-as-explicit-cast.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
constant-expression-cast-9942.rs Rehome tests/ui/issues/ tests [4/?] 2025-08-10 11:54:15 -04:00
dyn-tails-need-normalization.rs Normalize when equating dyn tails in MIR borrowck 2024-08-05 14:28:06 -04:00
enum-to-numeric-cast.rs Emit more specific diagnostics when enums fail to cast with as 2024-02-09 09:19:44 +05:30
enum-to-numeric-cast.stderr Emit more specific diagnostics when enums fail to cast with as 2024-02-09 09:19:44 +05:30
fat-ptr-cast-rpass.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fat-ptr-cast-rpass.stderr bless tests with new lint messages 2025-08-19 21:27:10 +02:00
fat-ptr-cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fat-ptr-cast.stderr Use wide pointers consistenly across the compiler 2024-10-04 14:06:48 +02:00
func-pointer-issue-140491.rs Add ui test func-pointer-issue-140491 2025-05-24 16:33:02 +08:00
func-pointer-issue-140491.stderr Note ref expr being cast when encounter NonScalar cast error 2025-05-31 12:19:55 +08:00
ice-cast-type-with-error-124848.rs FIx ICE while casting a type with error 2024-05-11 08:24:26 +05:30
ice-cast-type-with-error-124848.stderr Make missing lifetime suggestion verbose 2025-06-24 18:59:42 +00:00
issue-10991.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-10991.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-17444.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-17444.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-84213.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-84213.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-84213.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85586.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-85586.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-88621.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-88621.stderr Emit more specific diagnostics when enums fail to cast with as 2024-02-09 09:19:44 +05:30
issue-89497.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-89497.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-89497.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-106883-is-empty.rs suggest is_empty for collections when casting to bool 2023-01-15 22:17:54 +13:00
issue-106883-is-empty.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
non-primitive-cast-suggestion.fixed cleaned up some tests 2025-07-01 15:16:56 +05:00
non-primitive-cast-suggestion.rs cleaned up some tests 2025-07-01 15:16:56 +05:00
non-primitive-cast-suggestion.stderr cleaned up some tests 2025-07-01 15:16:56 +05:00
owned-struct-to-trait-cast-6318.rs Add test batch 1 2025-08-27 00:23:26 -04:00
ptr-to-ptr-different-regions.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ptr-to-trait-obj-add-auto.rs Make ptr_cast_add_auto_to_object lint into hard error 2025-02-22 23:03:14 +00:00
ptr-to-trait-obj-add-auto.stderr Make ptr_cast_add_auto_to_object lint into hard error 2025-02-22 23:03:14 +00:00
ptr-to-trait-obj-add-super-auto.rs Allow casting *mut dyn T->*mut (dyn T + Send) if T has Send super trait 2024-07-07 20:07:01 +02:00
ptr-to-trait-obj-different-args.rs improve errors for invalid pointer casts 2024-09-24 23:12:02 +02:00
ptr-to-trait-obj-different-args.stderr improve errors for invalid pointer casts 2024-09-24 23:12:02 +02:00
ptr-to-trait-obj-different-regions-id-trait.current.stderr use more accurate spans for user type ascriptions 2024-09-24 22:20:42 +02:00
ptr-to-trait-obj-different-regions-id-trait.next.stderr use more accurate spans for user type ascriptions 2024-09-24 22:20:42 +02:00
ptr-to-trait-obj-different-regions-id-trait.rs Normalize struct tail properly in borrowck and hir typeck 2024-08-11 19:40:03 -04:00
ptr-to-trait-obj-different-regions-lt-ext.rs Arbitrary self types v2: pointers feature gate. 2024-08-27 17:32:35 +00:00
ptr-to-trait-obj-different-regions-lt-ext.stderr best_blame_constraint: prioritize blaming interesting-seeming constraints 2025-01-06 16:12:11 -08:00
ptr-to-trait-obj-different-regions-misc.rs compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ptr-to-trait-obj-different-regions-misc.stderr compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
ptr-to-trait-obj-drop-principal.rs elaborate why dropping principal in *dyn casts is non-trivial 2024-10-20 17:54:04 +02:00
ptr-to-trait-obj-drop-principal.stderr elaborate why dropping principal in *dyn casts is non-trivial 2024-10-20 17:54:04 +02:00
ptr-to-trait-obj-ok.rs borrowck: use subtyping instead of equality for ptr-to-ptr casts 2024-09-27 21:04:32 +02:00
ptr-to-trait-obj-wrap-upcast.rs Actually check that the traits are the same for casting pointers to dyn _ 2024-07-04 17:56:09 +02:00
ptr-to-trait-obj-wrap-upcast.stderr improve errors for invalid pointer casts 2024-09-24 23:12:02 +02:00
supported-cast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
trait-object-cast-segfault-4333.rs Rehome tests/ui/issues/ tests [1/?] 2025-07-24 17:01:44 -04:00
trait-object-size-error-14366.rs comments 2025-08-05 19:34:46 +05:00
trait-object-size-error-14366.stderr comments 2025-08-05 19:34:46 +05:00
u8-to-char-cast-9918.rs Rehome tests/ui/issues/ tests [2/?] 2025-08-02 15:29:16 -04:00
unsized-struct-cast.rs make unsized cast illegal 2023-09-22 18:57:27 +03:00
unsized-struct-cast.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unsized-union-ice.rs add test for casting pointer to union with unsized tail 2024-03-19 13:57:31 +01:00
unsized-union-ice.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
unsupported-cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unsupported-cast.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00