Open
Description
After #113262, this will no longer fail to compile:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8ee721b21617d98d18c5256778b57efe
#[deny(trivial_casts)]
fn main() {
let a = std::ptr::null::<()>();
let _b = a as *const ();
}
The cast is trivial, but we miss it because we have to conservatively assume that raw pointer casts are not trivial. A possible fix would be to check for trivial raw pointer casts in MIR (but correctly considering lifetimes is still not quite easy there I think).