summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr
blob: 63ed2503cf39f65bea8a9ca50fd580401789cf81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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(&());
   |     ^^^^^^^^^^^^^^^^^
   |
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.
  --> $DIR/lint-enum-intrinsics-non-enums.rs:26:18
   |
LL |     discriminant(&());
   |                  ^^^
   = note: `#[deny(enum_intrinsics_non_enums)]` on by default

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);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
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.
  --> $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);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
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.
  --> $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);
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
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.
  --> $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);
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
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.
  --> $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>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `&str`, which is not an enum.

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>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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.

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::<()>();
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `()`, which is not an enum.

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>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the type parameter of `variant_count` should be an enum, but it was instantiated with the type `&SomeEnum`, which is not an enum.

error: aborting due to 9 previous errors