mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 12:36:35 +03:00
87d8f5885b
- On `const` and `static` point at the type (like we do for let bindings) - On fn calls, point at const parameter in fn definition - On type, point at const parameter in type definition - On array type lengths, explain that array length is always `usize` - On enum variant discriminant, mention `repr`
16 lines
324 B
Rust
16 lines
324 B
Rust
// Check that error in constant evaluation of enum discriminant
|
|
// provides the context for what caused the evaluation.
|
|
|
|
struct S(i32);
|
|
|
|
const CONSTANT: S = S(0);
|
|
|
|
enum E {
|
|
V = CONSTANT,
|
|
//~^ ERROR: mismatched types
|
|
//~| NOTE: expected `isize`, found `S`
|
|
//~| NOTE: enum variant discriminant
|
|
}
|
|
|
|
fn main() {}
|