Skip to content

Migrate generate_trait_from_impl assist to use SyntaxEditor #20371

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

Conversation

Hmikihiro
Copy link
Contributor

part of #15710 and #18285

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2025
@Hmikihiro Hmikihiro force-pushed the migrate_generate_trait_from_impl branch 2 times, most recently from 67815bf to fa03efa Compare August 3, 2025 06:34
@@ -1020,7 +1020,7 @@ pub fn trait_(
ident: &str,
gen_params: Option<ast::GenericParamList>,
where_clause: Option<ast::WhereClause>,
assoc_items: ast::AssocItemList,
assoc_items: Option<ast::AssocItemList>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This being non-optional sounds correct to me as it would be an invalid trait definition otherwise (ignoring the trait alias feature for now). It should be fine to just unwrap the cast in the assist above, as should that fail that's a bug in SyntaxEditor (correct me if I am wrong, I am not too familiar with this API)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That sounds correct.

@Hmikihiro Hmikihiro force-pushed the migrate_generate_trait_from_impl branch from fa03efa to 24f7f73 Compare August 3, 2025 07:12
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril enabled auto-merge August 3, 2025 07:13
@Veykril Veykril added this pull request to the merge queue Aug 3, 2025
Merged via the queue into rust-lang:master with commit 531a02c Aug 3, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants