rust/compiler/rustc_const_eval/src/const_eval
Matthias Krüger 9ccbbda6ac
Rollup merge of #122290 - RalfJung:mir-printing, r=compiler-errors
MIR printing: print the path of uneval'd const

Currently it just prints `const _` which makes it impossible to say which constant is being referred to.

Also refer to promoteds in a consistent way; previously MIR printing would do
```
promoted[0] in C1: &Option<Cell<i32>> = {
    // ...
}
```
Now that should be
```
const C1::promoted[0]: &Option<Cell<i32>> = {
    // ...
}
```

We don't seem to have a test for that so I tried it by hand, it seems to work:
```
const main::promoted[12]: &[&str; 3] = {
    let mut _0: &[&str; 3];
    let mut _1: [&str; 3];
    let mut _2: &str;
    let mut _3: &str;
    let mut _4: &str;
    let mut _5: &str;

    bb0: {
        _3 = const "b";
        _2 = &(*_3);
        _5 = const "c";
        _4 = &(*_5);
        _1 = [const "a", move _2, move _4];
        _0 = &_1;
        return;
    }
}
```
2024-03-10 22:16:43 +01:00
..
error.rs Rename DiagnosticMessage as DiagMessage. 2024-03-05 12:14:49 +11:00
eval_queries.rs MIR printing: print the path of uneval'd const; refer to promoteds in a consistent way 2024-03-10 14:59:41 +01:00
fn_queries.rs Make is_intrinsic query return the intrinsic name 2024-02-12 09:33:52 +00:00
machine.rs use Instance::expect_resolve() instead of unwraping Instance::resolve() 2024-03-10 11:49:33 +01:00
mod.rs make it possible for outside crates to inspect a mir::ConstValue with the interpreter 2024-02-21 14:32:52 +01:00
valtrees.rs make it possible for outside crates to inspect a mir::ConstValue with the interpreter 2024-02-21 14:32:52 +01:00