rust/tests/ui/raw-ref-op/const-eval-compare-ice-105047.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
478 B
Rust
Raw Normal View History

// issue: rust-lang/rust#105047
// ICE raw ptr comparison should already be caught in the trait systems
#![feature(raw_ref_op)]
const RCZ: *const i32 = &raw const *&0;
const fn f() {
if let RCZ = &raw const *&0 { }
//~^ WARN function pointers and raw pointers not derived from integers in patterns
2024-03-23 15:14:42 +00:00
//~| ERROR pointers cannot be reliably compared during const eval
//~| WARN this was previously accepted by the compiler but is being phased out
}
fn main() {}