Skip to content

refactor: Reduce codegen burden for generated syntax #19408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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) {
2 changes: 1 addition & 1 deletion crates/hir-expand/src/builtin/derive_macro.rs
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion crates/ide/src/syntax_highlighting/highlight.rs
Original file line number Diff line number Diff line change
@@ -852,7 +852,7 @@ fn highlight_name_ref_by_syntax(
}
}
ASSOC_TYPE_ARG => SymbolKind::TypeAlias.into(),
USE_BOUND_GENERIC_ARG => SymbolKind::TypeParam.into(),
USE_BOUND_GENERIC_ARGS => SymbolKind::TypeParam.into(),
_ => default.into(),
}
}
2 changes: 2 additions & 0 deletions crates/parser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -35,6 +35,8 @@ mod shortcuts;
mod syntax_kind;
mod token_set;

pub use T_ as T;

#[cfg(test)]
mod tests;

1 change: 1 addition & 0 deletions crates/parser/src/syntax_kind.rs
Original file line number Diff line number Diff line change
@@ -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;
59 changes: 27 additions & 32 deletions crates/parser/src/syntax_kind/generated.rs

Large diffs are not rendered by default.

Loading