Closed
Description
This program (playground) changed behavior between 97e58c0...1dd1884.
And broke bindgen as a result in funny ways.
use std::cmp;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord)]
pub enum SizednessResult {
NonZeroSized,
DependsOnTypeParam,
ZeroSized,
}
impl cmp::PartialOrd for SizednessResult {
fn partial_cmp(&self, rhs: &Self) -> Option<cmp::Ordering> {
use self::SizednessResult::*;
match (*self, *rhs) {
(x, y) if x == y => Some(cmp::Ordering::Equal),
(NonZeroSized, _) => Some(cmp::Ordering::Greater),
(_, NonZeroSized) => Some(cmp::Ordering::Less),
(DependsOnTypeParam, _) => Some(cmp::Ordering::Greater),
(_, DependsOnTypeParam) => Some(cmp::Ordering::Less),
_ => unreachable!(),
}
}
}
fn main() {
println!("{:?}", cmp::max(SizednessResult::ZeroSized, SizednessResult::NonZeroSized))
}
I suspect #64047.
Metadata
Metadata
Assignees
Labels
No labels