]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / lint / lint-enum-intrinsics-non-enums.stderr
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
3    |
4 LL |     discriminant(&());
5    |     ^^^^^^^^^^^^^^^^^
6    |
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
9    |
10 LL |     discriminant(&());
11    |                  ^^^
12    = note: `#[deny(enum_intrinsics_non_enums)]` on by default
13
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
16    |
17 LL |     discriminant(&&SomeEnum::B);
18    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
19    |
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
22    |
23 LL |     discriminant(&&SomeEnum::B);
24    |                  ^^^^^^^^^^^^^
25
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
28    |
29 LL |     discriminant(&SomeStruct);
30    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
31    |
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
34    |
35 LL |     discriminant(&SomeStruct);
36    |                  ^^^^^^^^^^^
37
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
40    |
41 LL |     discriminant(&123u32);
42    |     ^^^^^^^^^^^^^^^^^^^^^
43    |
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
46    |
47 LL |     discriminant(&123u32);
48    |                  ^^^^^^^
49
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
52    |
53 LL |     discriminant(&&123i8);
54    |     ^^^^^^^^^^^^^^^^^^^^^
55    |
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
58    |
59 LL |     discriminant(&&123i8);
60    |                  ^^^^^^^
61
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
64    |
65 LL |     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
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
72    |
73 LL |     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
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
80    |
81 LL |     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
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
88    |
89 LL |     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
94 error: aborting due to 9 previous errors
95