Rust analyzer version: 0.3.2913 (Linux)
rustc version: 1.95.0
I have a program that causes rust-analyzer to report errors where rustc does not.
I've reduced my program to a short repro example:
// lib.rs
pub fn testcase(xml_str: &str) {
let mut reader = quick_xml::Reader::from_str(xml_str);
match reader.read_event().unwrap() {
quick_xml::events::Event::GeneralRef(bytes_ref) => {
match bytes_ref.as_ref() {
b"amp" => {}
b"lt" => {}
b"apos" => {}
_ => {}
};
}
_ => {}
}
}
# Cargo.toml
[package]
name = "ra-bug-repro"
edition = "2024"
[dependencies]
quick-xml = "0.40.1"
zip = "8.6.0"
Rust analyzer reports:
Line 7: expected &[u8; 3], found &'static [u8; 2]
Line 8: expected &[u8; 3], found &'static [u8; 4]
I made a particularly interesting discovery while reducing my code to the testcase: If the dependency on zip is removed in Cargo.toml then rust-analyzer no longer reports any errors. Just including this dependency, even unused, changes the behavior.
Rust analyzer version: 0.3.2913 (Linux)
rustc version: 1.95.0
I have a program that causes rust-analyzer to report errors where rustc does not.
I've reduced my program to a short repro example:
Rust analyzer reports:
I made a particularly interesting discovery while reducing my code to the testcase: If the dependency on
zipis removed inCargo.tomlthen rust-analyzer no longer reports any errors. Just including this dependency, even unused, changes the behavior.