fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.9 KiB95 linesraw
1error: 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
3   |
4LL |     discriminant(&());
5   |     ^^^^^^^^^^^^^^^^^
6   |
7note: 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
9   |
10LL |     discriminant(&());
11   |                  ^^^
12   = note: `#[deny(enum_intrinsics_non_enums)]` on by default
13
14error: 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
16   |
17LL |     discriminant(&&SomeEnum::B);
18   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
19   |
20note: 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
22   |
23LL |     discriminant(&&SomeEnum::B);
24   |                  ^^^^^^^^^^^^^
25
26error: 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
28   |
29LL |     discriminant(&SomeStruct);
30   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
31   |
32note: 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
34   |
35LL |     discriminant(&SomeStruct);
36   |                  ^^^^^^^^^^^
37
38error: 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
40   |
41LL |     discriminant(&123u32);
42   |     ^^^^^^^^^^^^^^^^^^^^^
43   |
44note: 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
46   |
47LL |     discriminant(&123u32);
48   |                  ^^^^^^^
49
50error: 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
52   |
53LL |     discriminant(&&123i8);
54   |     ^^^^^^^^^^^^^^^^^^^^^
55   |
56note: 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
58   |
59LL |     discriminant(&&123i8);
60   |                  ^^^^^^^
61
62error: 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
64   |
65LL |     variant_count::<&str>();
66   |     ^^^^^^^^^^^^^^^^^^^^^^^
67   |
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.
69
70error: 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
72   |
73LL |     variant_count::<*const u8>();
74   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75   |
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.
77
78error: 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
80   |
81LL |     variant_count::<()>();
82   |     ^^^^^^^^^^^^^^^^^^^^^
83   |
84   = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `()`, which is not an enum.
85
86error: 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
88   |
89LL |     variant_count::<&SomeEnum>();
90   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91   |
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.
93
94error: aborting due to 9 previous errors
95