Closed
Description
Compiling the following program with the MSVC toolchain and the running it in the MSVC debugger shows that there is some problem with inspecting values of type i8
and u8
(this was originally found while investigating #36503):
fn main() {
let value_i8: i8 = -1;
let value_i16: i16 = -2;
let value_i32: i32 = -3;
let value_i64: i64 = -4;
let value_u8: u8 = 1;
let value_u16: u16 = 2;
let value_u32: u32 = 3;
let value_u64: u64 = 4;
let value_f32: f32 = 5.;
let value_f64: f64 = 6.;
let slice_u8: &[u8] = &[1,2,3];
let slice_i8: &[i8] = &[1,2,3];
let slice_u16: &[u16] = &[1,2,3];
let slice_i16: &[i16] = &[1,2,3];
// Without these, the values would be optimized away
println!("{} {} {} {}", value_i8, value_i16, value_i32, value_i64);
println!("{} {} {} {}", value_u8, value_u16, value_u32, value_u64);
println!("{} {}", value_f32, value_f64);
println!("{:?} {:?} {:?} {:?}", slice_u8, slice_i8, slice_u16, slice_i16);
}
The screenshot shows that the problem also appears for &[u8]
and &[i8]
, where the debugger can't show the pointer (data_ptr
).