Trait std::option::SpecOptionPartialEq
source · pub trait SpecOptionPartialEq: Sized {
// Required method
fn eq(l: &Option<Self>, other: &Option<Self>) -> bool;
}🔬This is a nightly-only experimental API. (
spec_option_partial_eq)Expand description
This specialization trait is a workaround for LLVM not currently (2023-01) being able to optimize this itself, even though Alive confirms that it would be legal to do so: https://github.com/llvm/llvm-project/issues/52622
Once that’s fixed, Option should go back to deriving PartialEq, as
it used to do before https://github.com/rust-lang/rust/pull/103556.