fix: Fix incorrect expansion of builtin PartialOrd derive

This commit is contained in:
Lukas Wirth 2025-03-21 10:26:55 +01:00
parent c9355c69bd
commit ed4a749f52
3 changed files with 3 additions and 2 deletions

View file

@ -336,7 +336,7 @@ enum Command {
}
impl <> $crate::cmp::PartialOrd for Command< > where {
fn partial_cmp(&self , other: &Self ) -> $crate::option::Option::Option<$crate::cmp::Ordering> {
fn partial_cmp(&self , other: &Self ) -> $crate::option::Option<$crate::cmp::Ordering> {
match $crate::intrinsics::discriminant_value(self ).partial_cmp(&$crate::intrinsics::discriminant_value(other)) {
$crate::option::Option::Some($crate::cmp::Ordering::Equal)=> {
match (self , other) {

View file

@ -969,7 +969,7 @@ fn partial_ord_expand(
span,
);
quote! {span =>
fn partial_cmp(&self, other: &Self) -> #krate::option::Option::Option<#krate::cmp::Ordering> {
fn partial_cmp(&self, other: &Self) -> #krate::option::Option<#krate::cmp::Ordering> {
#body
}
}

View file

@ -1,6 +1,7 @@
//! Defines [`SyntaxKind`] -- a fieldless enum of all possible syntactic
//! constructs of the Rust language.
#[rustfmt::skip]
mod generated;
use crate::Edition;