rust/tests
Dylan DPC 4dea3a295f
Rollup merge of #108000 - y21:no-zero-init-for-uninhabited, r=jackh726
lint: don't suggest MaybeUninit::assume_init for uninhabited types

Creating a zeroed uninhabited type such as `!` or an empty enum with `mem::zeroed()` (or transmuting `()` to `!`) currently triggers this lint:
```rs
warning: the type `!` does not permit zero-initialization
 --> test.rs:5:23
  |
5 |         let _val: ! = mem::zeroed();
  |                       ^^^^^^^^^^^^^
  |                       |
  |                       this code causes undefined behavior when executed
  |                       help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
  |
  = note: the `!` type has no valid value
```
The `MaybeUninit` suggestion in the help message seems confusing/useless for uninhabited types, as such a type cannot be fully initialized in the first place (as the note implies).
This PR limits this help message to inhabited types which can be initialized
2023-02-21 14:19:58 +05:30
..
assembly
auxiliary
codegen
codegen-units
debuginfo
incremental
mir-opt
pretty
run-make
run-make-fulldeps
run-pass-valgrind
rustdoc Rollup merge of #108241 - GuillaumeGomez:fix-reexported-macro-handling, r=notriddle 2023-02-20 22:12:17 +01:00
rustdoc-gui
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Make configure_and_expand "infalllible" by just aborting the compilation if it fails instead of bubbling out an error 2023-02-20 15:28:59 +00:00
ui Rollup merge of #108000 - y21:no-zero-init-for-uninhabited, r=jackh726 2023-02-21 14:19:58 +05:30
ui-fulldeps
COMPILER_TESTS.md