-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
I tried this code:
#![feature(const_raw_ptr_comparison)]
static X: u64 = 1;
const B: Option<bool> = (&raw const X).guaranteed_eq(&raw const X);
fn main() {
println!("{B:?}");
}
I expected to the code to output Some(true)
, but it output None
.
guaranteed_eq
is documented to sometimes output None
on equal pointers though, so I'm not sure if this is a bug.
@rustbot labels +A-const-eval
Tracking issue: #53020
Meta
Reproducible on the playground with version 1.90.0-nightly (2025-07-27 f8e355c230c6eb7b78ff)
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.