Closed
Description
rust-analyzer version: 0.4.1581-standalone (fdb8aa2 2023-07-08)
rustc version: 1.70.0 (same on 1.69.0)
Reproduction code
fn main() {
// should be [bool; 1]
let mut static_array = Default::default();
// `std::any::type_name_of_val` is not stable yet
fn value_type_name<T>(_v: T) -> &'static str {
std::any::type_name::<T>()
}
// rust compiler is right here
dbg!(value_type_name(static_array)); // [bool; 1]
// this call breaks inference of the type
expects_static_array_ptr(&mut static_array as *mut _);
expects_static_array(static_array);
}
fn expects_static_array(_static_array: [bool; 1]) {}
fn expects_static_array_ptr(_static_array_ptr: *mut bool) {}