1 error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
2 --> $DIR/lint-enum-intrinsics-non-enums.rs:26:5
4 LL | discriminant(&());
7 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.
8 --> $DIR/lint-enum-intrinsics-non-enums.rs:26:18
10 LL | discriminant(&());
12 = note: `#[deny(enum_intrinsics_non_enums)]` on by default
14 error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
15 --> $DIR/lint-enum-intrinsics-non-enums.rs:29:5
17 LL | discriminant(&&SomeEnum::B);
18 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 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.
21 --> $DIR/lint-enum-intrinsics-non-enums.rs:29:18
23 LL | discriminant(&&SomeEnum::B);
26 error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
27 --> $DIR/lint-enum-intrinsics-non-enums.rs:32:5
29 LL | discriminant(&SomeStruct);
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^
32 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.
33 --> $DIR/lint-enum-intrinsics-non-enums.rs:32:18
35 LL | discriminant(&SomeStruct);
38 error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
39 --> $DIR/lint-enum-intrinsics-non-enums.rs:35:5
41 LL | discriminant(&123u32);
42 | ^^^^^^^^^^^^^^^^^^^^^
44 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.
45 --> $DIR/lint-enum-intrinsics-non-enums.rs:35:18
47 LL | discriminant(&123u32);
50 error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
51 --> $DIR/lint-enum-intrinsics-non-enums.rs:38:5
53 LL | discriminant(&&123i8);
54 | ^^^^^^^^^^^^^^^^^^^^^
56 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.
57 --> $DIR/lint-enum-intrinsics-non-enums.rs:38:18
59 LL | discriminant(&&123i8);
62 error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
63 --> $DIR/lint-enum-intrinsics-non-enums.rs:46:5
65 LL | variant_count::<&str>();
66 | ^^^^^^^^^^^^^^^^^^^^^^^
68 = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `&str`, which is not an enum.
70 error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
71 --> $DIR/lint-enum-intrinsics-non-enums.rs:49:5
73 LL | variant_count::<*const u8>();
74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 = 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.
78 error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
79 --> $DIR/lint-enum-intrinsics-non-enums.rs:52:5
81 LL | variant_count::<()>();
82 | ^^^^^^^^^^^^^^^^^^^^^
84 = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `()`, which is not an enum.
86 error: the return value of `mem::variant_count` is unspecified when called with a non-enum type
87 --> $DIR/lint-enum-intrinsics-non-enums.rs:55:5
89 LL | variant_count::<&SomeEnum>();
90 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92 = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `&SomeEnum`, which is not an enum.
94 error: aborting due to 9 previous errors