Skip to content

Skip suggestions pointing to macro def for assert_eq#154551

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-146204-assert-ne-suggestion-span
Mar 31, 2026
Merged

Skip suggestions pointing to macro def for assert_eq#154551
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-146204-assert-ne-suggestion-span

Conversation

@chenyukang
Copy link
Copy Markdown
Member

@chenyukang chenyukang commented Mar 29, 2026

Fixes #146204

It's better to suggest:

help: consider borrowing here
 --> src/main.rs:3:16
  |
 3|      assert_ne!(&buf, b"----");
  |                 +

but i don't want to give a too heuristic but not general enough fix, let suppress them.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 29, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 29, 2026

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

@chenyukang
Copy link
Copy Markdown
Member Author

r? @JohnTitor

{
let derefs = "*".repeat(steps);
let msg = "consider dereferencing here";
if !span.can_be_used_for_suggestions() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess you can use in_external_macro(), suggestions on local macro should be still valid.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, you are right. I added a local macro in test.

@chenyukang chenyukang force-pushed the yukang-fix-146204-assert-ne-suggestion-span branch from cd7f53e to 52125a1 Compare March 30, 2026 13:55
@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-146204-assert-ne-suggestion-span branch from 52125a1 to 6518de3 Compare March 30, 2026 14:58
Copy link
Copy Markdown
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Thanks a lot!
@bors r+ rollup

View changes since this review

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 30, 2026

📌 Commit 6518de3 has been approved by JohnTitor

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 30, 2026
tgross35 added a commit to tgross35/rust that referenced this pull request Mar 30, 2026
…t-ne-suggestion-span, r=JohnTitor

Skip suggestions pointing to macro def for assert_eq

Fixes rust-lang#146204

It's better to suggest:
```console
help: consider borrowing here
 --> src/main.rs:3:16
  |
 3|      assert_ne!(&buf, b"----");
  |                 +
```
but i don't want to give a too heuristic but not general enough fix, let suppress them.
rust-bors bot pushed a commit that referenced this pull request Mar 31, 2026
Rollup of 7 pull requests

Successful merges:

 - #142659 (compiler-builtins: Clean up features)
 - #153574 (Avoid ICE when param-env normalization leaves unresolved inference variables)
 - #153648 (Fix EII function aliases eliminated by LTO)
 - #153790 (Fix regression when dealing with generics/values with unresolved inference)
 - #153893 (Lex lifetimes as identifiers, recover from emoji and emit appropriate error)
 - #153980 (refactor: move doc(rust_logo) check to parser)
 - #154551 (Skip suggestions pointing to macro def for assert_eq)
rust-bors bot pushed a commit that referenced this pull request Mar 31, 2026
Rollup of 7 pull requests

Successful merges:

 - #142659 (compiler-builtins: Clean up features)
 - #153574 (Avoid ICE when param-env normalization leaves unresolved inference variables)
 - #153648 (Fix EII function aliases eliminated by LTO)
 - #153790 (Fix regression when dealing with generics/values with unresolved inference)
 - #153893 (Lex lifetimes as identifiers, recover from emoji and emit appropriate error)
 - #153980 (refactor: move doc(rust_logo) check to parser)
 - #154551 (Skip suggestions pointing to macro def for assert_eq)
tgross35 added a commit to tgross35/rust that referenced this pull request Mar 31, 2026
…t-ne-suggestion-span, r=JohnTitor

Skip suggestions pointing to macro def for assert_eq

Fixes rust-lang#146204

It's better to suggest:
```console
help: consider borrowing here
 --> src/main.rs:3:16
  |
 3|      assert_ne!(&buf, b"----");
  |                 +
```
but i don't want to give a too heuristic but not general enough fix, let suppress them.
tgross35 added a commit to tgross35/rust that referenced this pull request Mar 31, 2026
…t-ne-suggestion-span, r=JohnTitor

Skip suggestions pointing to macro def for assert_eq

Fixes rust-lang#146204

It's better to suggest:
```console
help: consider borrowing here
 --> src/main.rs:3:16
  |
 3|      assert_ne!(&buf, b"----");
  |                 +
```
but i don't want to give a too heuristic but not general enough fix, let suppress them.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 31, 2026
…t-ne-suggestion-span, r=JohnTitor

Skip suggestions pointing to macro def for assert_eq

Fixes rust-lang#146204

It's better to suggest:
```console
help: consider borrowing here
 --> src/main.rs:3:16
  |
 3|      assert_ne!(&buf, b"----");
  |                 +
```
but i don't want to give a too heuristic but not general enough fix, let suppress them.
rust-bors bot pushed a commit that referenced this pull request Mar 31, 2026
Rollup of 9 pull requests

Successful merges:

 - #154582 (miri subtree update)
 - #142659 (compiler-builtins: Clean up features)
 - #153574 (Avoid ICE when param-env normalization leaves unresolved inference variables)
 - #153648 (Fix EII function aliases eliminated by LTO)
 - #153790 (Fix regression when dealing with generics/values with unresolved inference)
 - #154551 (Skip suggestions pointing to macro def for assert_eq)
 - #154574 (delete several `ui/consts` tests)
 - #154577 (Update `mir-opt` 64-bit panic-abort tests for `Alignment` rename)
 - #154579 (remove debug requirement from hooks)
@rust-bors rust-bors bot merged commit 472c531 into rust-lang:main Mar 31, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 31, 2026
rust-timer added a commit that referenced this pull request Mar 31, 2026
Rollup merge of #154551 - chenyukang:yukang-fix-146204-assert-ne-suggestion-span, r=JohnTitor

Skip suggestions pointing to macro def for assert_eq

Fixes #146204

It's better to suggest:
```console
help: consider borrowing here
 --> src/main.rs:3:16
  |
 3|      assert_ne!(&buf, b"----");
  |                 +
```
but i don't want to give a too heuristic but not general enough fix, let suppress them.
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Mar 31, 2026
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#154582 (miri subtree update)
 - rust-lang/rust#142659 (compiler-builtins: Clean up features)
 - rust-lang/rust#153574 (Avoid ICE when param-env normalization leaves unresolved inference variables)
 - rust-lang/rust#153648 (Fix EII function aliases eliminated by LTO)
 - rust-lang/rust#153790 (Fix regression when dealing with generics/values with unresolved inference)
 - rust-lang/rust#154551 (Skip suggestions pointing to macro def for assert_eq)
 - rust-lang/rust#154574 (delete several `ui/consts` tests)
 - rust-lang/rust#154577 (Update `mir-opt` 64-bit panic-abort tests for `Alignment` rename)
 - rust-lang/rust#154579 (remove debug requirement from hooks)
chenyukang pushed a commit to chenyukang/rust that referenced this pull request Apr 1, 2026
Rollup of 9 pull requests

Successful merges:

 - rust-lang#154582 (miri subtree update)
 - rust-lang#142659 (compiler-builtins: Clean up features)
 - rust-lang#153574 (Avoid ICE when param-env normalization leaves unresolved inference variables)
 - rust-lang#153648 (Fix EII function aliases eliminated by LTO)
 - rust-lang#153790 (Fix regression when dealing with generics/values with unresolved inference)
 - rust-lang#154551 (Skip suggestions pointing to macro def for assert_eq)
 - rust-lang#154574 (delete several `ui/consts` tests)
 - rust-lang#154577 (Update `mir-opt` 64-bit panic-abort tests for `Alignment` rename)
 - rust-lang#154579 (remove debug requirement from hooks)
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Apr 1, 2026
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#154582 (miri subtree update)
 - rust-lang/rust#142659 (compiler-builtins: Clean up features)
 - rust-lang/rust#153574 (Avoid ICE when param-env normalization leaves unresolved inference variables)
 - rust-lang/rust#153648 (Fix EII function aliases eliminated by LTO)
 - rust-lang/rust#153790 (Fix regression when dealing with generics/values with unresolved inference)
 - rust-lang/rust#154551 (Skip suggestions pointing to macro def for assert_eq)
 - rust-lang/rust#154574 (delete several `ui/consts` tests)
 - rust-lang/rust#154577 (Update `mir-opt` 64-bit panic-abort tests for `Alignment` rename)
 - rust-lang/rust#154579 (remove debug requirement from hooks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix suggestion on assert! points into the macros definition

5 participants