2022-08-01 19:05:20 -04:00
error[E0080]: evaluation of constant value failed
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:40:32
2020-10-26 23:25:12 +00:00
|
LL | get_flag::<false, { unsafe { char_raw.character } }>();
2022-08-01 19:05:20 -04:00
| ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
2020-10-26 23:25:12 +00:00
error[E0080]: it is undefined behavior to use this value
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:43:14
2020-10-26 23:25:12 +00:00
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
2022-06-25 23:46:51 -04:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
2020-10-26 23:25:12 +00:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2021-02-01 12:02:31 +00:00
= note: the raw bytes of the constant (size: 1, align: 1) {
42 │ B
}
2020-10-26 23:25:12 +00:00
error[E0080]: it is undefined behavior to use this value
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:45:14
2020-10-26 23:25:12 +00:00
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
2022-06-25 23:46:51 -04:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
2020-10-26 23:25:12 +00:00
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2021-02-01 12:02:31 +00:00
= note: the raw bytes of the constant (size: 1, align: 1) {
42 │ B
}
2020-10-26 23:25:12 +00:00
2022-08-01 19:05:20 -04:00
error[E0080]: evaluation of constant value failed
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:45:58
2020-10-26 23:25:12 +00:00
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
2022-08-01 19:05:20 -04:00
| ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
2020-10-26 23:25:12 +00:00
2025-01-07 12:33:32 +00:00
error[E0308]: mismatched types
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:31:21
2025-01-07 12:33:32 +00:00
|
LL | get_flag::<false, 0xFF>();
| ^^^^ expected `char`, found `u8`
error[E0308]: mismatched types
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:33:14
2025-01-07 12:33:32 +00:00
|
LL | get_flag::<7, 'c'>();
| ^ expected `bool`, found integer
error[E0308]: mismatched types
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:35:14
2025-01-07 12:33:32 +00:00
|
LL | get_flag::<42, 0x5ad>();
| ^^ expected `bool`, found integer
error[E0308]: mismatched types
2025-04-05 19:19:56 +03:00
--> $DIR/invalid-patterns.rs:35:18
2025-01-07 12:33:32 +00:00
|
LL | get_flag::<42, 0x5ad>();
| ^^^^^ expected `char`, found `u8`
2020-10-26 23:25:12 +00:00
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0080, E0308.
For more information about an error, try `rustc --explain E0080`.