We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecaf0f2 commit 7b9a95cCopy full SHA for 7b9a95c
src/trait_handlers/ord/mod.rs
@@ -33,13 +33,17 @@ impl TraitHandler for OrdHandler {
33
}
34
35
36
-fn supertraits(traits: &[Trait]) -> Vec<proc_macro2::TokenStream> {
+fn supertraits(
37
+ #[allow(unused_variables)]
38
+ traits: &[Trait],
39
+) -> Vec<proc_macro2::TokenStream> {
40
let mut supertraits = vec![];
41
supertraits.push(quote! {::core::cmp::Eq});
42
43
// We mustn't add the PartialOrd bound to the educed PartialOrd impl.
44
// When we're educing PartialOrd we can leave it off the Ord impl too,
45
// since we *know* Self is going to be PartialOrd.
46
+ #[cfg(feature = "PartialOrd")]
47
if !traits.contains(&Trait::PartialOrd) {
48
supertraits.push(quote! {::core::cmp::PartialOrd});
49
};
0 commit comments