diff options
| author | Ralf Jung <post@ralfj.de> | 2022-09-25 22:56:01 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-09-26 09:44:10 +0200 |
| commit | c19daa472b69fdcbbb15402e8d1e8e05bae39f38 (patch) | |
| tree | fc592cc8e6edd8569da64bb5ee112d7d79724a58 /src/test/ui/consts | |
| parent | f3fafbb006ee98635874f73e480655912b465e65 (diff) | |
| download | rust-c19daa472b69fdcbbb15402e8d1e8e05bae39f38.tar.gz rust-c19daa472b69fdcbbb15402e8d1e8e05bae39f38.zip | |
make invalid_value lint a bit smarter around enums
Diffstat (limited to 'src/test/ui/consts')
| -rw-r--r-- | src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr index bdaeb4a0fbe..b568518b449 100644 --- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr +++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr @@ -40,11 +40,11 @@ LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | -note: enums with no variants have no valid value (in this struct field) - --> $DIR/validate_uninhabited_zsts.rs:16:22 +note: enums with no inhabited variants have no valid value + --> $DIR/validate_uninhabited_zsts.rs:13:5 | -LL | pub struct Empty(Void); - | ^^^^ +LL | enum Void {} + | ^^^^^^^^^ error: aborting due to 2 previous errors; 2 warnings emitted diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr index bdaeb4a0fbe..b568518b449 100644 --- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr +++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr @@ -40,11 +40,11 @@ LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3]; | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | -note: enums with no variants have no valid value (in this struct field) - --> $DIR/validate_uninhabited_zsts.rs:16:22 +note: enums with no inhabited variants have no valid value + --> $DIR/validate_uninhabited_zsts.rs:13:5 | -LL | pub struct Empty(Void); - | ^^^^ +LL | enum Void {} + | ^^^^^^^^^ error: aborting due to 2 previous errors; 2 warnings emitted |
