Supress swapping lhs and rhs in equality suggestion in extern macro #144266
Supress swapping lhs and rhs in equality suggestion in extern macro #144266bors merged 2 commits intorust-lang:masterfrom
Conversation
|
If the test can't actually demonstrate the change, then there's no reason to make this into two commits. Please squash this into one. |
2ec2014 to
749762a
Compare
| if rhs_expr.span.in_external_macro(sm) || lhs_expr.span.in_external_macro(sm) { | ||
| return; | ||
| } | ||
|
|
|
I submitted #144268. We can find the correct span with the newly added methods, thus not needing to suppress this suggestion. |
3abc2ff to
68ea691
Compare
This comment has been minimized.
This comment has been minimized.
|
r? compiler |
|
|
||
| use std::fmt::Debug; | ||
|
|
||
| macro_rules! eq_local { |
There was a problem hiding this comment.
You should fix these whitespace issues in the first commit.
|
This seems like it's doing what's it's supposed to. But it's papering over a problem, which is that the suggestion to switch the argument is incorrect -- it doesn't fix the problem. And this suggestion seems to be a new one. I don't get it in rust 1.89.0. It would be better if the suggestion wasn't given at all... |
|
@xizheyin any updates on this? thanks |
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Sorry for slow response! @Dylan-DPC @nnethercote :) I revised the code. My initial thinking was to provide different and more precise suggestions for user-written external libraries. However, for a minimal change, directly suppressing it is also a good approach. In this version, I directly suppressed the lhs and rhs from external macros because we cannot obtain precise spans. Additionally, I fixed the formatting issues in the first commit proposed by @nnethercote . |
|
@bors r+ rollup |
Supress swapping lhs and rhs in equality suggestion in extern macro Fixes rust-lang#139050
Rollup of 7 pull requests Successful merges: - #144266 (Supress swapping lhs and rhs in equality suggestion in extern macro ) - #147471 (Assert that non-extended temporaries and `super let` bindings have scopes) - #147533 (Renumber return local after state transform) - #147566 (rewrite outlives placeholder constraints to outlives static when handling opaque types) - #147613 (Make logging filters work again by moving EnvFilter into its own layer) - #147615 (reduce calls to attr.span() in old doc attr parsing) - #147636 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 7 pull requests Successful merges: - rust-lang/rust#144266 (Supress swapping lhs and rhs in equality suggestion in extern macro ) - rust-lang/rust#147471 (Assert that non-extended temporaries and `super let` bindings have scopes) - rust-lang/rust#147533 (Renumber return local after state transform) - rust-lang/rust#147566 (rewrite outlives placeholder constraints to outlives static when handling opaque types) - rust-lang/rust#147613 (Make logging filters work again by moving EnvFilter into its own layer) - rust-lang/rust#147615 (reduce calls to attr.span() in old doc attr parsing) - rust-lang/rust#147636 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#144266 (Supress swapping lhs and rhs in equality suggestion in extern macro ) - rust-lang#147471 (Assert that non-extended temporaries and `super let` bindings have scopes) - rust-lang#147533 (Renumber return local after state transform) - rust-lang#147566 (rewrite outlives placeholder constraints to outlives static when handling opaque types) - rust-lang#147613 (Make logging filters work again by moving EnvFilter into its own layer) - rust-lang#147615 (reduce calls to attr.span() in old doc attr parsing) - rust-lang#147636 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #139050