rust/tests
Matthias Krüger d9a957b32a
Rollup merge of - gurry:120756-terse-non-prim-cast-diag, r=petrochenkov
Emit more specific diagnostics when enums fail to cast with `as`

Fixes 

Changes this diagnostic reported in the issue:
```
error[E0605]: non-primitive cast: `Bad` as `u32`
  --> src/main.rs:18:10
   |
18 |     dbg!(bad as u32);
   |          ^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
```

to this:
```
error[E0605]: non-primitive cast: `Bad` as `u32`
  --> src/main.rs:18:10
   |
18 |     dbg!(bad as u32);
   |          ^^^^^^^^^^ an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less
   |
   = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information
```

This change is only for enums. The diagnostic remains unchanged for all other cases.
2024-02-09 19:21:18 +01:00
..
assembly Bless/fix tests 2024-02-08 19:56:30 -05:00
auxiliary
codegen Rollup merge of - heiher:direct-access-external-data, r=petrochenkov 2024-02-07 18:24:41 +01:00
codegen-units Update tests 2024-02-07 10:42:01 +08:00
coverage coverage: Make unexpansion of closure bodies more precise 2024-02-05 10:09:46 +11:00
coverage-run-rustdoc coverage: Don't instrument #[automatically_derived] functions 2024-01-22 12:18:57 +11:00
debuginfo Update tests. 2024-01-27 16:38:57 +01:00
incremental Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
mir-opt Bless/fix tests 2024-02-08 19:56:30 -05:00
pretty Auto merge of - nnethercote:further-improve-space_between, r=petrochenkov 2024-01-31 02:01:43 +00:00
run-make Update data layouts in custom target tests for LLVM 18 2024-01-31 15:15:59 +01:00
run-make-fulldeps Auto merge of - veera-sivarajan:fix-makefile, r=Mark-Simulacrum 2024-01-05 07:42:03 +00:00
run-pass-valgrind
rustdoc Rollup merge of - GuillaumeGomez:glob-reexport-attr-merge-bugfix, r=notriddle 2024-01-31 12:10:53 +01:00
rustdoc-gui Rollup merge of - notriddle:notriddle/resize-close-modals, r=fmease 2024-01-22 07:56:42 +01:00
rustdoc-js Rollup merge of - notriddle:notriddle/tuple-unit, r=GuillaumeGomez 2024-01-06 16:07:46 +01:00
rustdoc-js-std Rollup merge of - notriddle:notriddle/tuple-unit, r=GuillaumeGomez 2024-01-06 16:07:46 +01:00
rustdoc-json Add regression test for is_object_safe field on traits 2023-12-23 19:00:17 +01:00
rustdoc-ui Auto merge of - matthiaskrgr:rollup-0k8ib1c, r=matthiaskrgr 2024-02-08 12:14:19 +00:00
ui Rollup merge of - gurry:120756-terse-non-prim-cast-diag, r=petrochenkov 2024-02-09 19:21:18 +01:00
ui-fulldeps Rollup merge of - nnethercote:SubdiagnosticMessageOp, r=compiler-errors 2024-02-08 09:06:36 +01:00
COMPILER_TESTS.md