Skip to content

SpanlessEq improvements #10478

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
May 19, 2023
Merged

SpanlessEq improvements #10478

merged 3 commits into from
May 19, 2023

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Mar 10, 2023

fixes #9775

Also includes a simplification to consts::constant's interface since I was already touching the code.

At the start of eq_expr the check:

if !self.inner.allow_side_effects && left.span.ctxt() != right.span.ctxt() {
    return false;
}

was removed. This was added in 49e2501 to handle cfg macros. This is better handled by the newly added check_ctxt.

changelog: [various lints]: Don't consider different cfg! expansions to be the same unless they are for the same config.
changelog: [various lints]: Don't consider the expansion of two different macros to be equal, even when they expand to the same token sequence.
changelog: [various lints]: Don't consider two blocks to be equal if they contain disabled code or empty macro expansions, unless those section contain the exact same token sequence.

@rustbot
Copy link
Collaborator

rustbot commented Mar 10, 2023

r? @xFrednet

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 10, 2023
@Jarcho Jarcho force-pushed the block_eq branch 5 times, most recently from c368649 to 867b19b Compare March 10, 2023 20:18
@xFrednet
Copy link
Member

xFrednet commented Mar 13, 2023

Hey, I have a busy week ahead of me. I'll review this next week, when I have a bit more time. Hope that's okay with you :)

Edit: It took a month, sorry!

@bors
Copy link
Contributor

bors commented Mar 27, 2023

☔ The latest upstream changes (presumably #10528) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just two small questions, one is posted as a comment.

Have you measured, how much this change effects performance? I'd guess that it should not be significant, but it would still be good to check before merging it.

Also, thanks for being patient when it comes to the review! I had exams and really needed a break afterwards. The next review or r+ should be much faster 🙃

@xFrednet
Copy link
Member

@Jarcho Have you seen the question in my review comment?

Have you measured, how much this change effects performance? I'd guess that it should not be significant, but it would still be good to check before merging it.

Once that is answered and the PR has been rebased, it should be ready for bors :)

@xFrednet
Copy link
Member

Ping @Jarcho,

I'm currently triaging my PRs. This one was already approved and only requires a rebase. Would you mind doing so? Then you can r=me :)

@Jarcho
Copy link
Contributor Author

Jarcho commented May 18, 2023

Sorry. I kept telling myself I would deal with it 'later', and later has finally come. Don't ask me about when 'someday' is coming though. I'm not looking forward to that one.

Dogfood runs in approximately the same amount of time. So no obvious perf issues.

* Don't consider expansions of different macros to be the same, even if they expand to the same tokens
* Don't consider `cfg!` expansions to be equal if they check different configs.
@Jarcho
Copy link
Contributor Author

Jarcho commented May 19, 2023

@bors r=xFrednet

@bors
Copy link
Contributor

bors commented May 19, 2023

📌 Commit 58132cb has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 19, 2023

⌛ Testing commit 58132cb with merge 1e8d2c5...

@bors
Copy link
Contributor

bors commented May 19, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing 1e8d2c5 to master...

@bors bors merged commit 1e8d2c5 into rust-lang:master May 19, 2023
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.

False Positive in match_same_arms with cfg!()
4 participants