Skip to content

fix(vec_init_then_push): don't lint pushes from a macro expansion#17289

Open
JoakoI98 wants to merge 1 commit into
rust-lang:masterfrom
JoakoI98:vec_init_then_push-no-macro-expand
Open

fix(vec_init_then_push): don't lint pushes from a macro expansion#17289
JoakoI98 wants to merge 1 commit into
rust-lang:masterfrom
JoakoI98:vec_init_then_push-no-macro-expand

Conversation

@JoakoI98

@JoakoI98 JoakoI98 commented Jun 22, 2026

Copy link
Copy Markdown

Fixes #16131

A one-line check that will not count pushes from macro expansions. I'm using from_expansion so same-crate macros won't be counted
Also added UI tests to avoid regression

changelog: [vec_init_then_push]: don't lint when the push calls come from a macro expansion

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 22, 2026
@rustbot

rustbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @dswij (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 8 candidates
  • 8 candidates expanded to 8 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

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.

vec_init_then_push inside macro causes syntax error

3 participants