Skip to content

Commit 7b9a95c

Browse files
committed
Ord: Fix build when PartialOrd is not enabled
1 parent ecaf0f2 commit 7b9a95c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/trait_handlers/ord/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ impl TraitHandler for OrdHandler {
3333
}
3434
}
3535

36-
fn supertraits(traits: &[Trait]) -> Vec<proc_macro2::TokenStream> {
36+
fn supertraits(
37+
#[allow(unused_variables)]
38+
traits: &[Trait],
39+
) -> Vec<proc_macro2::TokenStream> {
3740
let mut supertraits = vec![];
3841
supertraits.push(quote! {::core::cmp::Eq});
3942

4043
// We mustn't add the PartialOrd bound to the educed PartialOrd impl.
4144
// When we're educing PartialOrd we can leave it off the Ord impl too,
4245
// since we *know* Self is going to be PartialOrd.
46+
#[cfg(feature = "PartialOrd")]
4347
if !traits.contains(&Trait::PartialOrd) {
4448
supertraits.push(quote! {::core::cmp::PartialOrd});
4549
};

0 commit comments

Comments
 (0)