rust/tests/ui/lint/lint-enum-intrinsics-non-enums.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

96 lines
3.9 KiB
Plaintext
Raw Normal View History

2021-07-31 11:14:30 -05:00
error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:26:5
|
LL | discriminant(&());
| ^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `()`, which is not an enum
2021-07-31 11:14:30 -05:00
--> $DIR/lint-enum-intrinsics-non-enums.rs:26:18
|
LL | discriminant(&());
| ^^^
2022-09-18 10:55:36 -05:00
= note: `#[deny(enum_intrinsics_non_enums)]` on by default
2021-07-31 11:14:30 -05:00
error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:29:5
|
LL | discriminant(&&SomeEnum::B);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `&SomeEnum`, which is not an enum
2021-07-31 11:14:30 -05:00
--> $DIR/lint-enum-intrinsics-non-enums.rs:29:18
|
LL | discriminant(&&SomeEnum::B);
| ^^^^^^^^^^^^^
error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:32:5
|
LL | discriminant(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `SomeStruct`, which is not an enum
2021-07-31 11:14:30 -05:00
--> $DIR/lint-enum-intrinsics-non-enums.rs:32:18
|
LL | discriminant(&SomeStruct);
| ^^^^^^^^^^^
error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:35:5
|
LL | discriminant(&123u32);
| ^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `u32`, which is not an enum
2021-07-31 11:14:30 -05:00
--> $DIR/lint-enum-intrinsics-non-enums.rs:35:18
|
LL | discriminant(&123u32);
| ^^^^^^^
error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:38:5
|
LL | discriminant(&&123i8);
| ^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `&i8`, which is not an enum
2021-07-31 11:14:30 -05:00
--> $DIR/lint-enum-intrinsics-non-enums.rs:38:18
|
LL | discriminant(&&123i8);
| ^^^^^^^
error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:46:5
|
LL | variant_count::<&str>();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
= note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `&str`, which is not an enum
2021-07-31 11:14:30 -05:00
error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:49:5
|
LL | variant_count::<*const u8>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
= note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `*const u8`, which is not an enum
2021-07-31 11:14:30 -05:00
error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:52:5
|
LL | variant_count::<()>();
| ^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
= note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `()`, which is not an enum
2021-07-31 11:14:30 -05:00
error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:55:5
|
LL | variant_count::<&SomeEnum>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-21 17:20:45 -05:00
= note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `&SomeEnum`, which is not an enum
2021-07-31 11:14:30 -05:00
error: aborting due to 9 previous errors