Skip to content

fix: generate-method skips trait impl blocks when picking insertion site#22124

Open
Brumbelow wants to merge 1 commit intorust-lang:masterfrom
Brumbelow:fix/22123-generate-method-skip-trait-impl
Open

fix: generate-method skips trait impl blocks when picking insertion site#22124
Brumbelow wants to merge 1 commit intorust-lang:masterfrom
Brumbelow:fix/22123-generate-method-skip-trait-impl

Conversation

@Brumbelow
Copy link
Copy Markdown
Contributor

Follow up to #21684

  • The enclosing-impl shortcut accepted any impl whose self_ty matched the adt, so a call to a missing inherent method from inside a trait impl body appended the stub to the trait impl
  • This produced code that does not compile (the trait does not declare the generated fn).

The fix:

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 21, 2026
@Brumbelow
Copy link
Copy Markdown
Contributor Author

I can remove the comments here too (if needed), just force of habit. LMK either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assist "Generate method" selects current impl block even if it's a trait impl block

2 participants